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 storagegateway provides the API client, operations, and parameter types
// for AWS Storage Gateway.
//
// Storage Gateway Service Storage Gateway is the service that connects an
// on-premises software appliance with cloud-based storage to provide seamless and
// secure integration between an organization's on-premises IT environment and the
// Amazon Web Services storage infrastructure. The service enables you to securely
// upload data to the Amazon Web Services Cloud for cost effective backup and rapid
// disaster recovery. Use the following links to get started using the Storage
// Gateway Service API Reference:
// - Storage Gateway required request headers (https://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#AWSStorageGatewayHTTPRequestsHeaders)
// : Describes the required headers that you must send with every POST request to
// Storage Gateway.
// - Signing requests (https://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#AWSStorageGatewaySigningRequests)
// : Storage Gateway requires that you authenticate every request you send; this
// topic describes how sign such a request.
// - Error responses (https://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html#APIErrorResponses)
// : Provides reference information about Storage Gateway errors.
// - Operations in Storage Gateway (https://docs.aws.amazon.com/storagegateway/latest/APIReference/API_Operations.html)
// : Contains detailed descriptions of all Storage Gateway operations, their
// request parameters, response elements, possible errors, and examples of requests
// and responses.
// - Storage Gateway endpoints and quotas (https://docs.aws.amazon.com/general/latest/gr/sg.html)
// : Provides a list of each Amazon Web Services Region and the endpoints available
// for use with Storage Gateway.
//
// Storage Gateway resource IDs are in uppercase. When you use these resource IDs
// with the Amazon EC2 API, EC2 expects resource IDs in lowercase. You must change
// your resource ID to lowercase to use it with the EC2 API. For example, in
// Storage Gateway the ID for a volume might be vol-AA22BB012345DAF670 . When you
// use this ID with the EC2 API, you must change it to vol-aa22bb012345daf670 .
// Otherwise, the EC2 API might not behave as expected. IDs for Storage Gateway
// volumes and Amazon EBS snapshots created from gateway volumes are changing to a
// longer format. Starting in December 2016, all new volumes and snapshots will be
// created with a 17-character string. Starting in April 2016, you will be able to
// use these longer IDs so you can test your systems with the new format. For more
// information, see Longer EC2 and EBS resource IDs (http://aws.amazon.com/ec2/faqs/#longer-ids)
// . For example, a volume Amazon Resource Name (ARN) with the longer volume ID
// format looks like the following:
// arn:aws:storagegateway:us-west-2:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABBCCDDEEFFG
// . A snapshot ID with the longer ID format looks like the following:
// snap-78e226633445566ee . For more information, see Announcement: Heads-up –
// Longer Storage Gateway volume and snapshot IDs coming in 2016 (http://forums.aws.amazon.com/ann.jspa?annID=3557)
// .
package storagegateway
| 48 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
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/storagegateway/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 = "storagegateway"
}
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 storagegateway
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.18.14"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/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"
"path"
)
type awsAwsjson11_serializeOpActivateGateway struct {
}
func (*awsAwsjson11_serializeOpActivateGateway) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpActivateGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ActivateGatewayInput)
_ = 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("StorageGateway_20130630.ActivateGateway")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentActivateGatewayInput(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_serializeOpAddCache struct {
}
func (*awsAwsjson11_serializeOpAddCache) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddCache) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddCacheInput)
_ = 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("StorageGateway_20130630.AddCache")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddCacheInput(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_serializeOpAddTagsToResource struct {
}
func (*awsAwsjson11_serializeOpAddTagsToResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddTagsToResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddTagsToResourceInput)
_ = 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("StorageGateway_20130630.AddTagsToResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddTagsToResourceInput(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_serializeOpAddUploadBuffer struct {
}
func (*awsAwsjson11_serializeOpAddUploadBuffer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddUploadBuffer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddUploadBufferInput)
_ = 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("StorageGateway_20130630.AddUploadBuffer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddUploadBufferInput(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_serializeOpAddWorkingStorage struct {
}
func (*awsAwsjson11_serializeOpAddWorkingStorage) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddWorkingStorage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddWorkingStorageInput)
_ = 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("StorageGateway_20130630.AddWorkingStorage")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddWorkingStorageInput(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_serializeOpAssignTapePool struct {
}
func (*awsAwsjson11_serializeOpAssignTapePool) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssignTapePool) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssignTapePoolInput)
_ = 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("StorageGateway_20130630.AssignTapePool")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssignTapePoolInput(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_serializeOpAssociateFileSystem struct {
}
func (*awsAwsjson11_serializeOpAssociateFileSystem) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssociateFileSystem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateFileSystemInput)
_ = 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("StorageGateway_20130630.AssociateFileSystem")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssociateFileSystemInput(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_serializeOpAttachVolume struct {
}
func (*awsAwsjson11_serializeOpAttachVolume) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAttachVolume) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AttachVolumeInput)
_ = 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("StorageGateway_20130630.AttachVolume")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAttachVolumeInput(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_serializeOpCancelArchival struct {
}
func (*awsAwsjson11_serializeOpCancelArchival) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCancelArchival) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CancelArchivalInput)
_ = 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("StorageGateway_20130630.CancelArchival")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCancelArchivalInput(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_serializeOpCancelRetrieval struct {
}
func (*awsAwsjson11_serializeOpCancelRetrieval) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCancelRetrieval) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CancelRetrievalInput)
_ = 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("StorageGateway_20130630.CancelRetrieval")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCancelRetrievalInput(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_serializeOpCreateCachediSCSIVolume struct {
}
func (*awsAwsjson11_serializeOpCreateCachediSCSIVolume) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateCachediSCSIVolume) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateCachediSCSIVolumeInput)
_ = 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("StorageGateway_20130630.CreateCachediSCSIVolume")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateCachediSCSIVolumeInput(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_serializeOpCreateNFSFileShare struct {
}
func (*awsAwsjson11_serializeOpCreateNFSFileShare) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateNFSFileShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateNFSFileShareInput)
_ = 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("StorageGateway_20130630.CreateNFSFileShare")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateNFSFileShareInput(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_serializeOpCreateSMBFileShare struct {
}
func (*awsAwsjson11_serializeOpCreateSMBFileShare) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateSMBFileShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSMBFileShareInput)
_ = 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("StorageGateway_20130630.CreateSMBFileShare")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateSMBFileShareInput(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_serializeOpCreateSnapshot struct {
}
func (*awsAwsjson11_serializeOpCreateSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_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)}
}
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("StorageGateway_20130630.CreateSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_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 = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateSnapshotFromVolumeRecoveryPoint struct {
}
func (*awsAwsjson11_serializeOpCreateSnapshotFromVolumeRecoveryPoint) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateSnapshotFromVolumeRecoveryPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSnapshotFromVolumeRecoveryPointInput)
_ = 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("StorageGateway_20130630.CreateSnapshotFromVolumeRecoveryPoint")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateSnapshotFromVolumeRecoveryPointInput(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_serializeOpCreateStorediSCSIVolume struct {
}
func (*awsAwsjson11_serializeOpCreateStorediSCSIVolume) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateStorediSCSIVolume) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateStorediSCSIVolumeInput)
_ = 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("StorageGateway_20130630.CreateStorediSCSIVolume")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateStorediSCSIVolumeInput(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_serializeOpCreateTapePool struct {
}
func (*awsAwsjson11_serializeOpCreateTapePool) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateTapePool) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateTapePoolInput)
_ = 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("StorageGateway_20130630.CreateTapePool")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateTapePoolInput(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_serializeOpCreateTapes struct {
}
func (*awsAwsjson11_serializeOpCreateTapes) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateTapes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateTapesInput)
_ = 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("StorageGateway_20130630.CreateTapes")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateTapesInput(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_serializeOpCreateTapeWithBarcode struct {
}
func (*awsAwsjson11_serializeOpCreateTapeWithBarcode) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateTapeWithBarcode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateTapeWithBarcodeInput)
_ = 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("StorageGateway_20130630.CreateTapeWithBarcode")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateTapeWithBarcodeInput(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_serializeOpDeleteAutomaticTapeCreationPolicy struct {
}
func (*awsAwsjson11_serializeOpDeleteAutomaticTapeCreationPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteAutomaticTapeCreationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAutomaticTapeCreationPolicyInput)
_ = 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("StorageGateway_20130630.DeleteAutomaticTapeCreationPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteAutomaticTapeCreationPolicyInput(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_serializeOpDeleteBandwidthRateLimit struct {
}
func (*awsAwsjson11_serializeOpDeleteBandwidthRateLimit) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteBandwidthRateLimit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteBandwidthRateLimitInput)
_ = 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("StorageGateway_20130630.DeleteBandwidthRateLimit")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteBandwidthRateLimitInput(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_serializeOpDeleteChapCredentials struct {
}
func (*awsAwsjson11_serializeOpDeleteChapCredentials) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteChapCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteChapCredentialsInput)
_ = 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("StorageGateway_20130630.DeleteChapCredentials")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteChapCredentialsInput(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_serializeOpDeleteFileShare struct {
}
func (*awsAwsjson11_serializeOpDeleteFileShare) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteFileShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteFileShareInput)
_ = 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("StorageGateway_20130630.DeleteFileShare")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteFileShareInput(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_serializeOpDeleteGateway struct {
}
func (*awsAwsjson11_serializeOpDeleteGateway) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteGatewayInput)
_ = 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("StorageGateway_20130630.DeleteGateway")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteGatewayInput(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_serializeOpDeleteSnapshotSchedule struct {
}
func (*awsAwsjson11_serializeOpDeleteSnapshotSchedule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteSnapshotSchedule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSnapshotScheduleInput)
_ = 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("StorageGateway_20130630.DeleteSnapshotSchedule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteSnapshotScheduleInput(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_serializeOpDeleteTape struct {
}
func (*awsAwsjson11_serializeOpDeleteTape) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteTape) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteTapeInput)
_ = 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("StorageGateway_20130630.DeleteTape")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteTapeInput(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_serializeOpDeleteTapeArchive struct {
}
func (*awsAwsjson11_serializeOpDeleteTapeArchive) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteTapeArchive) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteTapeArchiveInput)
_ = 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("StorageGateway_20130630.DeleteTapeArchive")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteTapeArchiveInput(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_serializeOpDeleteTapePool struct {
}
func (*awsAwsjson11_serializeOpDeleteTapePool) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteTapePool) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteTapePoolInput)
_ = 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("StorageGateway_20130630.DeleteTapePool")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteTapePoolInput(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_serializeOpDeleteVolume struct {
}
func (*awsAwsjson11_serializeOpDeleteVolume) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteVolume) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteVolumeInput)
_ = 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("StorageGateway_20130630.DeleteVolume")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteVolumeInput(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_serializeOpDescribeAvailabilityMonitorTest struct {
}
func (*awsAwsjson11_serializeOpDescribeAvailabilityMonitorTest) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeAvailabilityMonitorTest) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAvailabilityMonitorTestInput)
_ = 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("StorageGateway_20130630.DescribeAvailabilityMonitorTest")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeAvailabilityMonitorTestInput(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_serializeOpDescribeBandwidthRateLimit struct {
}
func (*awsAwsjson11_serializeOpDescribeBandwidthRateLimit) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeBandwidthRateLimit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeBandwidthRateLimitInput)
_ = 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("StorageGateway_20130630.DescribeBandwidthRateLimit")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeBandwidthRateLimitInput(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_serializeOpDescribeBandwidthRateLimitSchedule struct {
}
func (*awsAwsjson11_serializeOpDescribeBandwidthRateLimitSchedule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeBandwidthRateLimitSchedule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeBandwidthRateLimitScheduleInput)
_ = 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("StorageGateway_20130630.DescribeBandwidthRateLimitSchedule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeBandwidthRateLimitScheduleInput(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_serializeOpDescribeCache struct {
}
func (*awsAwsjson11_serializeOpDescribeCache) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeCache) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeCacheInput)
_ = 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("StorageGateway_20130630.DescribeCache")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeCacheInput(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_serializeOpDescribeCachediSCSIVolumes struct {
}
func (*awsAwsjson11_serializeOpDescribeCachediSCSIVolumes) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeCachediSCSIVolumes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeCachediSCSIVolumesInput)
_ = 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("StorageGateway_20130630.DescribeCachediSCSIVolumes")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeCachediSCSIVolumesInput(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_serializeOpDescribeChapCredentials struct {
}
func (*awsAwsjson11_serializeOpDescribeChapCredentials) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeChapCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeChapCredentialsInput)
_ = 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("StorageGateway_20130630.DescribeChapCredentials")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeChapCredentialsInput(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_serializeOpDescribeFileSystemAssociations struct {
}
func (*awsAwsjson11_serializeOpDescribeFileSystemAssociations) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeFileSystemAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeFileSystemAssociationsInput)
_ = 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("StorageGateway_20130630.DescribeFileSystemAssociations")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeFileSystemAssociationsInput(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_serializeOpDescribeGatewayInformation struct {
}
func (*awsAwsjson11_serializeOpDescribeGatewayInformation) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeGatewayInformation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeGatewayInformationInput)
_ = 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("StorageGateway_20130630.DescribeGatewayInformation")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeGatewayInformationInput(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_serializeOpDescribeMaintenanceStartTime struct {
}
func (*awsAwsjson11_serializeOpDescribeMaintenanceStartTime) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeMaintenanceStartTime) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeMaintenanceStartTimeInput)
_ = 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("StorageGateway_20130630.DescribeMaintenanceStartTime")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeMaintenanceStartTimeInput(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_serializeOpDescribeNFSFileShares struct {
}
func (*awsAwsjson11_serializeOpDescribeNFSFileShares) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeNFSFileShares) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeNFSFileSharesInput)
_ = 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("StorageGateway_20130630.DescribeNFSFileShares")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeNFSFileSharesInput(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_serializeOpDescribeSMBFileShares struct {
}
func (*awsAwsjson11_serializeOpDescribeSMBFileShares) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeSMBFileShares) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSMBFileSharesInput)
_ = 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("StorageGateway_20130630.DescribeSMBFileShares")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeSMBFileSharesInput(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_serializeOpDescribeSMBSettings struct {
}
func (*awsAwsjson11_serializeOpDescribeSMBSettings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeSMBSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSMBSettingsInput)
_ = 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("StorageGateway_20130630.DescribeSMBSettings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeSMBSettingsInput(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_serializeOpDescribeSnapshotSchedule struct {
}
func (*awsAwsjson11_serializeOpDescribeSnapshotSchedule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeSnapshotSchedule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSnapshotScheduleInput)
_ = 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("StorageGateway_20130630.DescribeSnapshotSchedule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeSnapshotScheduleInput(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_serializeOpDescribeStorediSCSIVolumes struct {
}
func (*awsAwsjson11_serializeOpDescribeStorediSCSIVolumes) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeStorediSCSIVolumes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStorediSCSIVolumesInput)
_ = 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("StorageGateway_20130630.DescribeStorediSCSIVolumes")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeStorediSCSIVolumesInput(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_serializeOpDescribeTapeArchives struct {
}
func (*awsAwsjson11_serializeOpDescribeTapeArchives) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeTapeArchives) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTapeArchivesInput)
_ = 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("StorageGateway_20130630.DescribeTapeArchives")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeTapeArchivesInput(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_serializeOpDescribeTapeRecoveryPoints struct {
}
func (*awsAwsjson11_serializeOpDescribeTapeRecoveryPoints) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeTapeRecoveryPoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTapeRecoveryPointsInput)
_ = 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("StorageGateway_20130630.DescribeTapeRecoveryPoints")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeTapeRecoveryPointsInput(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_serializeOpDescribeTapes struct {
}
func (*awsAwsjson11_serializeOpDescribeTapes) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeTapes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTapesInput)
_ = 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("StorageGateway_20130630.DescribeTapes")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeTapesInput(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_serializeOpDescribeUploadBuffer struct {
}
func (*awsAwsjson11_serializeOpDescribeUploadBuffer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeUploadBuffer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeUploadBufferInput)
_ = 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("StorageGateway_20130630.DescribeUploadBuffer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeUploadBufferInput(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_serializeOpDescribeVTLDevices struct {
}
func (*awsAwsjson11_serializeOpDescribeVTLDevices) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeVTLDevices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeVTLDevicesInput)
_ = 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("StorageGateway_20130630.DescribeVTLDevices")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeVTLDevicesInput(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_serializeOpDescribeWorkingStorage struct {
}
func (*awsAwsjson11_serializeOpDescribeWorkingStorage) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeWorkingStorage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeWorkingStorageInput)
_ = 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("StorageGateway_20130630.DescribeWorkingStorage")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeWorkingStorageInput(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_serializeOpDetachVolume struct {
}
func (*awsAwsjson11_serializeOpDetachVolume) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetachVolume) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DetachVolumeInput)
_ = 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("StorageGateway_20130630.DetachVolume")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetachVolumeInput(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_serializeOpDisableGateway struct {
}
func (*awsAwsjson11_serializeOpDisableGateway) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisableGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisableGatewayInput)
_ = 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("StorageGateway_20130630.DisableGateway")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisableGatewayInput(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_serializeOpDisassociateFileSystem struct {
}
func (*awsAwsjson11_serializeOpDisassociateFileSystem) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisassociateFileSystem) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateFileSystemInput)
_ = 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("StorageGateway_20130630.DisassociateFileSystem")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisassociateFileSystemInput(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_serializeOpJoinDomain struct {
}
func (*awsAwsjson11_serializeOpJoinDomain) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpJoinDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*JoinDomainInput)
_ = 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("StorageGateway_20130630.JoinDomain")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentJoinDomainInput(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_serializeOpListAutomaticTapeCreationPolicies struct {
}
func (*awsAwsjson11_serializeOpListAutomaticTapeCreationPolicies) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListAutomaticTapeCreationPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAutomaticTapeCreationPoliciesInput)
_ = 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("StorageGateway_20130630.ListAutomaticTapeCreationPolicies")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListAutomaticTapeCreationPoliciesInput(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_serializeOpListFileShares struct {
}
func (*awsAwsjson11_serializeOpListFileShares) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListFileShares) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListFileSharesInput)
_ = 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("StorageGateway_20130630.ListFileShares")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListFileSharesInput(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_serializeOpListFileSystemAssociations struct {
}
func (*awsAwsjson11_serializeOpListFileSystemAssociations) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListFileSystemAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListFileSystemAssociationsInput)
_ = 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("StorageGateway_20130630.ListFileSystemAssociations")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListFileSystemAssociationsInput(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_serializeOpListGateways struct {
}
func (*awsAwsjson11_serializeOpListGateways) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListGateways) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListGatewaysInput)
_ = 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("StorageGateway_20130630.ListGateways")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListGatewaysInput(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_serializeOpListLocalDisks struct {
}
func (*awsAwsjson11_serializeOpListLocalDisks) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListLocalDisks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListLocalDisksInput)
_ = 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("StorageGateway_20130630.ListLocalDisks")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListLocalDisksInput(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_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_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)}
}
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("StorageGateway_20130630.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(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_serializeOpListTapePools struct {
}
func (*awsAwsjson11_serializeOpListTapePools) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTapePools) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTapePoolsInput)
_ = 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("StorageGateway_20130630.ListTapePools")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTapePoolsInput(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_serializeOpListTapes struct {
}
func (*awsAwsjson11_serializeOpListTapes) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTapes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTapesInput)
_ = 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("StorageGateway_20130630.ListTapes")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTapesInput(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_serializeOpListVolumeInitiators struct {
}
func (*awsAwsjson11_serializeOpListVolumeInitiators) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListVolumeInitiators) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListVolumeInitiatorsInput)
_ = 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("StorageGateway_20130630.ListVolumeInitiators")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListVolumeInitiatorsInput(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_serializeOpListVolumeRecoveryPoints struct {
}
func (*awsAwsjson11_serializeOpListVolumeRecoveryPoints) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListVolumeRecoveryPoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListVolumeRecoveryPointsInput)
_ = 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("StorageGateway_20130630.ListVolumeRecoveryPoints")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListVolumeRecoveryPointsInput(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_serializeOpListVolumes struct {
}
func (*awsAwsjson11_serializeOpListVolumes) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListVolumes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListVolumesInput)
_ = 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("StorageGateway_20130630.ListVolumes")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListVolumesInput(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_serializeOpNotifyWhenUploaded struct {
}
func (*awsAwsjson11_serializeOpNotifyWhenUploaded) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpNotifyWhenUploaded) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*NotifyWhenUploadedInput)
_ = 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("StorageGateway_20130630.NotifyWhenUploaded")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentNotifyWhenUploadedInput(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_serializeOpRefreshCache struct {
}
func (*awsAwsjson11_serializeOpRefreshCache) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRefreshCache) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RefreshCacheInput)
_ = 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("StorageGateway_20130630.RefreshCache")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRefreshCacheInput(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_serializeOpRemoveTagsFromResource struct {
}
func (*awsAwsjson11_serializeOpRemoveTagsFromResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRemoveTagsFromResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RemoveTagsFromResourceInput)
_ = 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("StorageGateway_20130630.RemoveTagsFromResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRemoveTagsFromResourceInput(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_serializeOpResetCache struct {
}
func (*awsAwsjson11_serializeOpResetCache) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpResetCache) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ResetCacheInput)
_ = 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("StorageGateway_20130630.ResetCache")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentResetCacheInput(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_serializeOpRetrieveTapeArchive struct {
}
func (*awsAwsjson11_serializeOpRetrieveTapeArchive) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRetrieveTapeArchive) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RetrieveTapeArchiveInput)
_ = 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("StorageGateway_20130630.RetrieveTapeArchive")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRetrieveTapeArchiveInput(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_serializeOpRetrieveTapeRecoveryPoint struct {
}
func (*awsAwsjson11_serializeOpRetrieveTapeRecoveryPoint) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRetrieveTapeRecoveryPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RetrieveTapeRecoveryPointInput)
_ = 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("StorageGateway_20130630.RetrieveTapeRecoveryPoint")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRetrieveTapeRecoveryPointInput(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_serializeOpSetLocalConsolePassword struct {
}
func (*awsAwsjson11_serializeOpSetLocalConsolePassword) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSetLocalConsolePassword) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SetLocalConsolePasswordInput)
_ = 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("StorageGateway_20130630.SetLocalConsolePassword")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSetLocalConsolePasswordInput(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_serializeOpSetSMBGuestPassword struct {
}
func (*awsAwsjson11_serializeOpSetSMBGuestPassword) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSetSMBGuestPassword) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SetSMBGuestPasswordInput)
_ = 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("StorageGateway_20130630.SetSMBGuestPassword")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSetSMBGuestPasswordInput(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_serializeOpShutdownGateway struct {
}
func (*awsAwsjson11_serializeOpShutdownGateway) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpShutdownGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ShutdownGatewayInput)
_ = 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("StorageGateway_20130630.ShutdownGateway")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentShutdownGatewayInput(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_serializeOpStartAvailabilityMonitorTest struct {
}
func (*awsAwsjson11_serializeOpStartAvailabilityMonitorTest) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartAvailabilityMonitorTest) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartAvailabilityMonitorTestInput)
_ = 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("StorageGateway_20130630.StartAvailabilityMonitorTest")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartAvailabilityMonitorTestInput(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_serializeOpStartGateway struct {
}
func (*awsAwsjson11_serializeOpStartGateway) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartGatewayInput)
_ = 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("StorageGateway_20130630.StartGateway")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartGatewayInput(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_serializeOpUpdateAutomaticTapeCreationPolicy struct {
}
func (*awsAwsjson11_serializeOpUpdateAutomaticTapeCreationPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateAutomaticTapeCreationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateAutomaticTapeCreationPolicyInput)
_ = 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("StorageGateway_20130630.UpdateAutomaticTapeCreationPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateAutomaticTapeCreationPolicyInput(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_serializeOpUpdateBandwidthRateLimit struct {
}
func (*awsAwsjson11_serializeOpUpdateBandwidthRateLimit) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateBandwidthRateLimit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateBandwidthRateLimitInput)
_ = 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("StorageGateway_20130630.UpdateBandwidthRateLimit")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateBandwidthRateLimitInput(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_serializeOpUpdateBandwidthRateLimitSchedule struct {
}
func (*awsAwsjson11_serializeOpUpdateBandwidthRateLimitSchedule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateBandwidthRateLimitSchedule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateBandwidthRateLimitScheduleInput)
_ = 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("StorageGateway_20130630.UpdateBandwidthRateLimitSchedule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateBandwidthRateLimitScheduleInput(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_serializeOpUpdateChapCredentials struct {
}
func (*awsAwsjson11_serializeOpUpdateChapCredentials) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateChapCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateChapCredentialsInput)
_ = 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("StorageGateway_20130630.UpdateChapCredentials")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateChapCredentialsInput(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_serializeOpUpdateFileSystemAssociation struct {
}
func (*awsAwsjson11_serializeOpUpdateFileSystemAssociation) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateFileSystemAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateFileSystemAssociationInput)
_ = 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("StorageGateway_20130630.UpdateFileSystemAssociation")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateFileSystemAssociationInput(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_serializeOpUpdateGatewayInformation struct {
}
func (*awsAwsjson11_serializeOpUpdateGatewayInformation) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateGatewayInformation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateGatewayInformationInput)
_ = 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("StorageGateway_20130630.UpdateGatewayInformation")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateGatewayInformationInput(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_serializeOpUpdateGatewaySoftwareNow struct {
}
func (*awsAwsjson11_serializeOpUpdateGatewaySoftwareNow) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateGatewaySoftwareNow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateGatewaySoftwareNowInput)
_ = 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("StorageGateway_20130630.UpdateGatewaySoftwareNow")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateGatewaySoftwareNowInput(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_serializeOpUpdateMaintenanceStartTime struct {
}
func (*awsAwsjson11_serializeOpUpdateMaintenanceStartTime) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateMaintenanceStartTime) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateMaintenanceStartTimeInput)
_ = 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("StorageGateway_20130630.UpdateMaintenanceStartTime")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateMaintenanceStartTimeInput(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_serializeOpUpdateNFSFileShare struct {
}
func (*awsAwsjson11_serializeOpUpdateNFSFileShare) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateNFSFileShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateNFSFileShareInput)
_ = 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("StorageGateway_20130630.UpdateNFSFileShare")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateNFSFileShareInput(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_serializeOpUpdateSMBFileShare struct {
}
func (*awsAwsjson11_serializeOpUpdateSMBFileShare) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateSMBFileShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSMBFileShareInput)
_ = 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("StorageGateway_20130630.UpdateSMBFileShare")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateSMBFileShareInput(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_serializeOpUpdateSMBFileShareVisibility struct {
}
func (*awsAwsjson11_serializeOpUpdateSMBFileShareVisibility) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateSMBFileShareVisibility) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSMBFileShareVisibilityInput)
_ = 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("StorageGateway_20130630.UpdateSMBFileShareVisibility")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateSMBFileShareVisibilityInput(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_serializeOpUpdateSMBLocalGroups struct {
}
func (*awsAwsjson11_serializeOpUpdateSMBLocalGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateSMBLocalGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSMBLocalGroupsInput)
_ = 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("StorageGateway_20130630.UpdateSMBLocalGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateSMBLocalGroupsInput(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_serializeOpUpdateSMBSecurityStrategy struct {
}
func (*awsAwsjson11_serializeOpUpdateSMBSecurityStrategy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateSMBSecurityStrategy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSMBSecurityStrategyInput)
_ = 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("StorageGateway_20130630.UpdateSMBSecurityStrategy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateSMBSecurityStrategyInput(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_serializeOpUpdateSnapshotSchedule struct {
}
func (*awsAwsjson11_serializeOpUpdateSnapshotSchedule) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateSnapshotSchedule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSnapshotScheduleInput)
_ = 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("StorageGateway_20130630.UpdateSnapshotSchedule")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateSnapshotScheduleInput(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_serializeOpUpdateVTLDeviceType struct {
}
func (*awsAwsjson11_serializeOpUpdateVTLDeviceType) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateVTLDeviceType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateVTLDeviceTypeInput)
_ = 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("StorageGateway_20130630.UpdateVTLDeviceType")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateVTLDeviceTypeInput(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_serializeDocumentAutomaticTapeCreationRule(v *types.AutomaticTapeCreationRule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MinimumNumTapes != nil {
ok := object.Key("MinimumNumTapes")
ok.Integer(*v.MinimumNumTapes)
}
if v.PoolId != nil {
ok := object.Key("PoolId")
ok.String(*v.PoolId)
}
if v.TapeBarcodePrefix != nil {
ok := object.Key("TapeBarcodePrefix")
ok.String(*v.TapeBarcodePrefix)
}
if v.TapeSizeInBytes != nil {
ok := object.Key("TapeSizeInBytes")
ok.Long(*v.TapeSizeInBytes)
}
if v.Worm {
ok := object.Key("Worm")
ok.Boolean(v.Worm)
}
return nil
}
func awsAwsjson11_serializeDocumentAutomaticTapeCreationRules(v []types.AutomaticTapeCreationRule, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentAutomaticTapeCreationRule(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentBandwidthRateLimitInterval(v *types.BandwidthRateLimitInterval, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AverageDownloadRateLimitInBitsPerSec != nil {
ok := object.Key("AverageDownloadRateLimitInBitsPerSec")
ok.Long(*v.AverageDownloadRateLimitInBitsPerSec)
}
if v.AverageUploadRateLimitInBitsPerSec != nil {
ok := object.Key("AverageUploadRateLimitInBitsPerSec")
ok.Long(*v.AverageUploadRateLimitInBitsPerSec)
}
if v.DaysOfWeek != nil {
ok := object.Key("DaysOfWeek")
if err := awsAwsjson11_serializeDocumentDaysOfWeek(v.DaysOfWeek, ok); err != nil {
return err
}
}
if v.EndHourOfDay != nil {
ok := object.Key("EndHourOfDay")
ok.Integer(*v.EndHourOfDay)
}
if v.EndMinuteOfHour != nil {
ok := object.Key("EndMinuteOfHour")
ok.Integer(*v.EndMinuteOfHour)
}
if v.StartHourOfDay != nil {
ok := object.Key("StartHourOfDay")
ok.Integer(*v.StartHourOfDay)
}
if v.StartMinuteOfHour != nil {
ok := object.Key("StartMinuteOfHour")
ok.Integer(*v.StartMinuteOfHour)
}
return nil
}
func awsAwsjson11_serializeDocumentBandwidthRateLimitIntervals(v []types.BandwidthRateLimitInterval, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentBandwidthRateLimitInterval(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCacheAttributes(v *types.CacheAttributes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CacheStaleTimeoutInSeconds != nil {
ok := object.Key("CacheStaleTimeoutInSeconds")
ok.Integer(*v.CacheStaleTimeoutInSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentDaysOfWeek(v []int32, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.Integer(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentDiskIds(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_serializeDocumentEndpointNetworkConfiguration(v *types.EndpointNetworkConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IpAddresses != nil {
ok := object.Key("IpAddresses")
if err := awsAwsjson11_serializeDocumentIpAddressList(v.IpAddresses, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFileShareARNList(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_serializeDocumentFileShareClientList(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_serializeDocumentFileSystemAssociationARNList(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_serializeDocumentFolderList(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_serializeDocumentHosts(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_serializeDocumentIpAddressList(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_serializeDocumentNFSFileShareDefaults(v *types.NFSFileShareDefaults, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DirectoryMode != nil {
ok := object.Key("DirectoryMode")
ok.String(*v.DirectoryMode)
}
if v.FileMode != nil {
ok := object.Key("FileMode")
ok.String(*v.FileMode)
}
if v.GroupId != nil {
ok := object.Key("GroupId")
ok.Long(*v.GroupId)
}
if v.OwnerId != nil {
ok := object.Key("OwnerId")
ok.Long(*v.OwnerId)
}
return nil
}
func awsAwsjson11_serializeDocumentPoolARNs(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_serializeDocumentSMBLocalGroups(v *types.SMBLocalGroups, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayAdmins != nil {
ok := object.Key("GatewayAdmins")
if err := awsAwsjson11_serializeDocumentUserList(v.GatewayAdmins, 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_serializeDocumentTagKeys(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_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_serializeDocumentTapeARNs(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_serializeDocumentUserList(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_serializeDocumentVolumeARNs(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_serializeDocumentVTLDeviceARNs(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_serializeOpDocumentActivateGatewayInput(v *ActivateGatewayInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActivationKey != nil {
ok := object.Key("ActivationKey")
ok.String(*v.ActivationKey)
}
if v.GatewayName != nil {
ok := object.Key("GatewayName")
ok.String(*v.GatewayName)
}
if v.GatewayRegion != nil {
ok := object.Key("GatewayRegion")
ok.String(*v.GatewayRegion)
}
if v.GatewayTimezone != nil {
ok := object.Key("GatewayTimezone")
ok.String(*v.GatewayTimezone)
}
if v.GatewayType != nil {
ok := object.Key("GatewayType")
ok.String(*v.GatewayType)
}
if v.MediumChangerType != nil {
ok := object.Key("MediumChangerType")
ok.String(*v.MediumChangerType)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.TapeDriveType != nil {
ok := object.Key("TapeDriveType")
ok.String(*v.TapeDriveType)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddCacheInput(v *AddCacheInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskIds != nil {
ok := object.Key("DiskIds")
if err := awsAwsjson11_serializeDocumentDiskIds(v.DiskIds, ok); err != nil {
return err
}
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddTagsToResourceInput(v *AddTagsToResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddUploadBufferInput(v *AddUploadBufferInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskIds != nil {
ok := object.Key("DiskIds")
if err := awsAwsjson11_serializeDocumentDiskIds(v.DiskIds, ok); err != nil {
return err
}
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddWorkingStorageInput(v *AddWorkingStorageInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskIds != nil {
ok := object.Key("DiskIds")
if err := awsAwsjson11_serializeDocumentDiskIds(v.DiskIds, ok); err != nil {
return err
}
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAssignTapePoolInput(v *AssignTapePoolInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BypassGovernanceRetention {
ok := object.Key("BypassGovernanceRetention")
ok.Boolean(v.BypassGovernanceRetention)
}
if v.PoolId != nil {
ok := object.Key("PoolId")
ok.String(*v.PoolId)
}
if v.TapeARN != nil {
ok := object.Key("TapeARN")
ok.String(*v.TapeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAssociateFileSystemInput(v *AssociateFileSystemInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AuditDestinationARN != nil {
ok := object.Key("AuditDestinationARN")
ok.String(*v.AuditDestinationARN)
}
if v.CacheAttributes != nil {
ok := object.Key("CacheAttributes")
if err := awsAwsjson11_serializeDocumentCacheAttributes(v.CacheAttributes, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.EndpointNetworkConfiguration != nil {
ok := object.Key("EndpointNetworkConfiguration")
if err := awsAwsjson11_serializeDocumentEndpointNetworkConfiguration(v.EndpointNetworkConfiguration, ok); err != nil {
return err
}
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.LocationARN != nil {
ok := object.Key("LocationARN")
ok.String(*v.LocationARN)
}
if v.Password != nil {
ok := object.Key("Password")
ok.String(*v.Password)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.UserName != nil {
ok := object.Key("UserName")
ok.String(*v.UserName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAttachVolumeInput(v *AttachVolumeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskId != nil {
ok := object.Key("DiskId")
ok.String(*v.DiskId)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.NetworkInterfaceId != nil {
ok := object.Key("NetworkInterfaceId")
ok.String(*v.NetworkInterfaceId)
}
if v.TargetName != nil {
ok := object.Key("TargetName")
ok.String(*v.TargetName)
}
if v.VolumeARN != nil {
ok := object.Key("VolumeARN")
ok.String(*v.VolumeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCancelArchivalInput(v *CancelArchivalInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.TapeARN != nil {
ok := object.Key("TapeARN")
ok.String(*v.TapeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCancelRetrievalInput(v *CancelRetrievalInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.TapeARN != nil {
ok := object.Key("TapeARN")
ok.String(*v.TapeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateCachediSCSIVolumeInput(v *CreateCachediSCSIVolumeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.KMSEncrypted != nil {
ok := object.Key("KMSEncrypted")
ok.Boolean(*v.KMSEncrypted)
}
if v.KMSKey != nil {
ok := object.Key("KMSKey")
ok.String(*v.KMSKey)
}
if v.NetworkInterfaceId != nil {
ok := object.Key("NetworkInterfaceId")
ok.String(*v.NetworkInterfaceId)
}
if v.SnapshotId != nil {
ok := object.Key("SnapshotId")
ok.String(*v.SnapshotId)
}
if v.SourceVolumeARN != nil {
ok := object.Key("SourceVolumeARN")
ok.String(*v.SourceVolumeARN)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.TargetName != nil {
ok := object.Key("TargetName")
ok.String(*v.TargetName)
}
{
ok := object.Key("VolumeSizeInBytes")
ok.Long(v.VolumeSizeInBytes)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateNFSFileShareInput(v *CreateNFSFileShareInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AuditDestinationARN != nil {
ok := object.Key("AuditDestinationARN")
ok.String(*v.AuditDestinationARN)
}
if v.BucketRegion != nil {
ok := object.Key("BucketRegion")
ok.String(*v.BucketRegion)
}
if v.CacheAttributes != nil {
ok := object.Key("CacheAttributes")
if err := awsAwsjson11_serializeDocumentCacheAttributes(v.CacheAttributes, ok); err != nil {
return err
}
}
if v.ClientList != nil {
ok := object.Key("ClientList")
if err := awsAwsjson11_serializeDocumentFileShareClientList(v.ClientList, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.DefaultStorageClass != nil {
ok := object.Key("DefaultStorageClass")
ok.String(*v.DefaultStorageClass)
}
if v.FileShareName != nil {
ok := object.Key("FileShareName")
ok.String(*v.FileShareName)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.GuessMIMETypeEnabled != nil {
ok := object.Key("GuessMIMETypeEnabled")
ok.Boolean(*v.GuessMIMETypeEnabled)
}
if v.KMSEncrypted != nil {
ok := object.Key("KMSEncrypted")
ok.Boolean(*v.KMSEncrypted)
}
if v.KMSKey != nil {
ok := object.Key("KMSKey")
ok.String(*v.KMSKey)
}
if v.LocationARN != nil {
ok := object.Key("LocationARN")
ok.String(*v.LocationARN)
}
if v.NFSFileShareDefaults != nil {
ok := object.Key("NFSFileShareDefaults")
if err := awsAwsjson11_serializeDocumentNFSFileShareDefaults(v.NFSFileShareDefaults, ok); err != nil {
return err
}
}
if v.NotificationPolicy != nil {
ok := object.Key("NotificationPolicy")
ok.String(*v.NotificationPolicy)
}
if len(v.ObjectACL) > 0 {
ok := object.Key("ObjectACL")
ok.String(string(v.ObjectACL))
}
if v.ReadOnly != nil {
ok := object.Key("ReadOnly")
ok.Boolean(*v.ReadOnly)
}
if v.RequesterPays != nil {
ok := object.Key("RequesterPays")
ok.Boolean(*v.RequesterPays)
}
if v.Role != nil {
ok := object.Key("Role")
ok.String(*v.Role)
}
if v.Squash != nil {
ok := object.Key("Squash")
ok.String(*v.Squash)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.VPCEndpointDNSName != nil {
ok := object.Key("VPCEndpointDNSName")
ok.String(*v.VPCEndpointDNSName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateSMBFileShareInput(v *CreateSMBFileShareInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessBasedEnumeration != nil {
ok := object.Key("AccessBasedEnumeration")
ok.Boolean(*v.AccessBasedEnumeration)
}
if v.AdminUserList != nil {
ok := object.Key("AdminUserList")
if err := awsAwsjson11_serializeDocumentUserList(v.AdminUserList, ok); err != nil {
return err
}
}
if v.AuditDestinationARN != nil {
ok := object.Key("AuditDestinationARN")
ok.String(*v.AuditDestinationARN)
}
if v.Authentication != nil {
ok := object.Key("Authentication")
ok.String(*v.Authentication)
}
if v.BucketRegion != nil {
ok := object.Key("BucketRegion")
ok.String(*v.BucketRegion)
}
if v.CacheAttributes != nil {
ok := object.Key("CacheAttributes")
if err := awsAwsjson11_serializeDocumentCacheAttributes(v.CacheAttributes, ok); err != nil {
return err
}
}
if len(v.CaseSensitivity) > 0 {
ok := object.Key("CaseSensitivity")
ok.String(string(v.CaseSensitivity))
}
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.DefaultStorageClass != nil {
ok := object.Key("DefaultStorageClass")
ok.String(*v.DefaultStorageClass)
}
if v.FileShareName != nil {
ok := object.Key("FileShareName")
ok.String(*v.FileShareName)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.GuessMIMETypeEnabled != nil {
ok := object.Key("GuessMIMETypeEnabled")
ok.Boolean(*v.GuessMIMETypeEnabled)
}
if v.InvalidUserList != nil {
ok := object.Key("InvalidUserList")
if err := awsAwsjson11_serializeDocumentUserList(v.InvalidUserList, ok); err != nil {
return err
}
}
if v.KMSEncrypted != nil {
ok := object.Key("KMSEncrypted")
ok.Boolean(*v.KMSEncrypted)
}
if v.KMSKey != nil {
ok := object.Key("KMSKey")
ok.String(*v.KMSKey)
}
if v.LocationARN != nil {
ok := object.Key("LocationARN")
ok.String(*v.LocationARN)
}
if v.NotificationPolicy != nil {
ok := object.Key("NotificationPolicy")
ok.String(*v.NotificationPolicy)
}
if len(v.ObjectACL) > 0 {
ok := object.Key("ObjectACL")
ok.String(string(v.ObjectACL))
}
if v.OplocksEnabled != nil {
ok := object.Key("OplocksEnabled")
ok.Boolean(*v.OplocksEnabled)
}
if v.ReadOnly != nil {
ok := object.Key("ReadOnly")
ok.Boolean(*v.ReadOnly)
}
if v.RequesterPays != nil {
ok := object.Key("RequesterPays")
ok.Boolean(*v.RequesterPays)
}
if v.Role != nil {
ok := object.Key("Role")
ok.String(*v.Role)
}
if v.SMBACLEnabled != nil {
ok := object.Key("SMBACLEnabled")
ok.Boolean(*v.SMBACLEnabled)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.ValidUserList != nil {
ok := object.Key("ValidUserList")
if err := awsAwsjson11_serializeDocumentUserList(v.ValidUserList, ok); err != nil {
return err
}
}
if v.VPCEndpointDNSName != nil {
ok := object.Key("VPCEndpointDNSName")
ok.String(*v.VPCEndpointDNSName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateSnapshotFromVolumeRecoveryPointInput(v *CreateSnapshotFromVolumeRecoveryPointInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SnapshotDescription != nil {
ok := object.Key("SnapshotDescription")
ok.String(*v.SnapshotDescription)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.VolumeARN != nil {
ok := object.Key("VolumeARN")
ok.String(*v.VolumeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateSnapshotInput(v *CreateSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SnapshotDescription != nil {
ok := object.Key("SnapshotDescription")
ok.String(*v.SnapshotDescription)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.VolumeARN != nil {
ok := object.Key("VolumeARN")
ok.String(*v.VolumeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateStorediSCSIVolumeInput(v *CreateStorediSCSIVolumeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskId != nil {
ok := object.Key("DiskId")
ok.String(*v.DiskId)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.KMSEncrypted != nil {
ok := object.Key("KMSEncrypted")
ok.Boolean(*v.KMSEncrypted)
}
if v.KMSKey != nil {
ok := object.Key("KMSKey")
ok.String(*v.KMSKey)
}
if v.NetworkInterfaceId != nil {
ok := object.Key("NetworkInterfaceId")
ok.String(*v.NetworkInterfaceId)
}
{
ok := object.Key("PreserveExistingData")
ok.Boolean(v.PreserveExistingData)
}
if v.SnapshotId != nil {
ok := object.Key("SnapshotId")
ok.String(*v.SnapshotId)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.TargetName != nil {
ok := object.Key("TargetName")
ok.String(*v.TargetName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateTapePoolInput(v *CreateTapePoolInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PoolName != nil {
ok := object.Key("PoolName")
ok.String(*v.PoolName)
}
if v.RetentionLockTimeInDays != nil {
ok := object.Key("RetentionLockTimeInDays")
ok.Integer(*v.RetentionLockTimeInDays)
}
if len(v.RetentionLockType) > 0 {
ok := object.Key("RetentionLockType")
ok.String(string(v.RetentionLockType))
}
if len(v.StorageClass) > 0 {
ok := object.Key("StorageClass")
ok.String(string(v.StorageClass))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateTapesInput(v *CreateTapesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("ClientToken")
ok.String(*v.ClientToken)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.KMSEncrypted != nil {
ok := object.Key("KMSEncrypted")
ok.Boolean(*v.KMSEncrypted)
}
if v.KMSKey != nil {
ok := object.Key("KMSKey")
ok.String(*v.KMSKey)
}
if v.NumTapesToCreate != nil {
ok := object.Key("NumTapesToCreate")
ok.Integer(*v.NumTapesToCreate)
}
if v.PoolId != nil {
ok := object.Key("PoolId")
ok.String(*v.PoolId)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.TapeBarcodePrefix != nil {
ok := object.Key("TapeBarcodePrefix")
ok.String(*v.TapeBarcodePrefix)
}
if v.TapeSizeInBytes != nil {
ok := object.Key("TapeSizeInBytes")
ok.Long(*v.TapeSizeInBytes)
}
if v.Worm {
ok := object.Key("Worm")
ok.Boolean(v.Worm)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateTapeWithBarcodeInput(v *CreateTapeWithBarcodeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.KMSEncrypted != nil {
ok := object.Key("KMSEncrypted")
ok.Boolean(*v.KMSEncrypted)
}
if v.KMSKey != nil {
ok := object.Key("KMSKey")
ok.String(*v.KMSKey)
}
if v.PoolId != nil {
ok := object.Key("PoolId")
ok.String(*v.PoolId)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.TapeBarcode != nil {
ok := object.Key("TapeBarcode")
ok.String(*v.TapeBarcode)
}
if v.TapeSizeInBytes != nil {
ok := object.Key("TapeSizeInBytes")
ok.Long(*v.TapeSizeInBytes)
}
if v.Worm {
ok := object.Key("Worm")
ok.Boolean(v.Worm)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteAutomaticTapeCreationPolicyInput(v *DeleteAutomaticTapeCreationPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteBandwidthRateLimitInput(v *DeleteBandwidthRateLimitInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BandwidthType != nil {
ok := object.Key("BandwidthType")
ok.String(*v.BandwidthType)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteChapCredentialsInput(v *DeleteChapCredentialsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InitiatorName != nil {
ok := object.Key("InitiatorName")
ok.String(*v.InitiatorName)
}
if v.TargetARN != nil {
ok := object.Key("TargetARN")
ok.String(*v.TargetARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteFileShareInput(v *DeleteFileShareInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileShareARN != nil {
ok := object.Key("FileShareARN")
ok.String(*v.FileShareARN)
}
if v.ForceDelete {
ok := object.Key("ForceDelete")
ok.Boolean(v.ForceDelete)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteGatewayInput(v *DeleteGatewayInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteSnapshotScheduleInput(v *DeleteSnapshotScheduleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VolumeARN != nil {
ok := object.Key("VolumeARN")
ok.String(*v.VolumeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteTapeArchiveInput(v *DeleteTapeArchiveInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BypassGovernanceRetention {
ok := object.Key("BypassGovernanceRetention")
ok.Boolean(v.BypassGovernanceRetention)
}
if v.TapeARN != nil {
ok := object.Key("TapeARN")
ok.String(*v.TapeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteTapeInput(v *DeleteTapeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BypassGovernanceRetention {
ok := object.Key("BypassGovernanceRetention")
ok.Boolean(v.BypassGovernanceRetention)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.TapeARN != nil {
ok := object.Key("TapeARN")
ok.String(*v.TapeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteTapePoolInput(v *DeleteTapePoolInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PoolARN != nil {
ok := object.Key("PoolARN")
ok.String(*v.PoolARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteVolumeInput(v *DeleteVolumeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VolumeARN != nil {
ok := object.Key("VolumeARN")
ok.String(*v.VolumeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeAvailabilityMonitorTestInput(v *DescribeAvailabilityMonitorTestInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeBandwidthRateLimitInput(v *DescribeBandwidthRateLimitInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeBandwidthRateLimitScheduleInput(v *DescribeBandwidthRateLimitScheduleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeCachediSCSIVolumesInput(v *DescribeCachediSCSIVolumesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VolumeARNs != nil {
ok := object.Key("VolumeARNs")
if err := awsAwsjson11_serializeDocumentVolumeARNs(v.VolumeARNs, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeCacheInput(v *DescribeCacheInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeChapCredentialsInput(v *DescribeChapCredentialsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TargetARN != nil {
ok := object.Key("TargetARN")
ok.String(*v.TargetARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeFileSystemAssociationsInput(v *DescribeFileSystemAssociationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileSystemAssociationARNList != nil {
ok := object.Key("FileSystemAssociationARNList")
if err := awsAwsjson11_serializeDocumentFileSystemAssociationARNList(v.FileSystemAssociationARNList, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeGatewayInformationInput(v *DescribeGatewayInformationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeMaintenanceStartTimeInput(v *DescribeMaintenanceStartTimeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeNFSFileSharesInput(v *DescribeNFSFileSharesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileShareARNList != nil {
ok := object.Key("FileShareARNList")
if err := awsAwsjson11_serializeDocumentFileShareARNList(v.FileShareARNList, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeSMBFileSharesInput(v *DescribeSMBFileSharesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileShareARNList != nil {
ok := object.Key("FileShareARNList")
if err := awsAwsjson11_serializeDocumentFileShareARNList(v.FileShareARNList, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeSMBSettingsInput(v *DescribeSMBSettingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeSnapshotScheduleInput(v *DescribeSnapshotScheduleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VolumeARN != nil {
ok := object.Key("VolumeARN")
ok.String(*v.VolumeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeStorediSCSIVolumesInput(v *DescribeStorediSCSIVolumesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VolumeARNs != nil {
ok := object.Key("VolumeARNs")
if err := awsAwsjson11_serializeDocumentVolumeARNs(v.VolumeARNs, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeTapeArchivesInput(v *DescribeTapeArchivesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if v.TapeARNs != nil {
ok := object.Key("TapeARNs")
if err := awsAwsjson11_serializeDocumentTapeARNs(v.TapeARNs, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeTapeRecoveryPointsInput(v *DescribeTapeRecoveryPointsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeTapesInput(v *DescribeTapesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if v.TapeARNs != nil {
ok := object.Key("TapeARNs")
if err := awsAwsjson11_serializeDocumentTapeARNs(v.TapeARNs, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeUploadBufferInput(v *DescribeUploadBufferInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeVTLDevicesInput(v *DescribeVTLDevicesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if v.VTLDeviceARNs != nil {
ok := object.Key("VTLDeviceARNs")
if err := awsAwsjson11_serializeDocumentVTLDeviceARNs(v.VTLDeviceARNs, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeWorkingStorageInput(v *DescribeWorkingStorageInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetachVolumeInput(v *DetachVolumeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ForceDetach != nil {
ok := object.Key("ForceDetach")
ok.Boolean(*v.ForceDetach)
}
if v.VolumeARN != nil {
ok := object.Key("VolumeARN")
ok.String(*v.VolumeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDisableGatewayInput(v *DisableGatewayInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDisassociateFileSystemInput(v *DisassociateFileSystemInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileSystemAssociationARN != nil {
ok := object.Key("FileSystemAssociationARN")
ok.String(*v.FileSystemAssociationARN)
}
if v.ForceDelete {
ok := object.Key("ForceDelete")
ok.Boolean(v.ForceDelete)
}
return nil
}
func awsAwsjson11_serializeOpDocumentJoinDomainInput(v *JoinDomainInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DomainControllers != nil {
ok := object.Key("DomainControllers")
if err := awsAwsjson11_serializeDocumentHosts(v.DomainControllers, ok); err != nil {
return err
}
}
if v.DomainName != nil {
ok := object.Key("DomainName")
ok.String(*v.DomainName)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.OrganizationalUnit != nil {
ok := object.Key("OrganizationalUnit")
ok.String(*v.OrganizationalUnit)
}
if v.Password != nil {
ok := object.Key("Password")
ok.String(*v.Password)
}
if v.TimeoutInSeconds != nil {
ok := object.Key("TimeoutInSeconds")
ok.Integer(*v.TimeoutInSeconds)
}
if v.UserName != nil {
ok := object.Key("UserName")
ok.String(*v.UserName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListAutomaticTapeCreationPoliciesInput(v *ListAutomaticTapeCreationPoliciesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListFileSharesInput(v *ListFileSharesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListFileSystemAssociationsInput(v *ListFileSystemAssociationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListGatewaysInput(v *ListGatewaysInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListLocalDisksInput(v *ListLocalDisksInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTapePoolsInput(v *ListTapePoolsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if v.PoolARNs != nil {
ok := object.Key("PoolARNs")
if err := awsAwsjson11_serializeDocumentPoolARNs(v.PoolARNs, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTapesInput(v *ListTapesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if v.TapeARNs != nil {
ok := object.Key("TapeARNs")
if err := awsAwsjson11_serializeDocumentTapeARNs(v.TapeARNs, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentListVolumeInitiatorsInput(v *ListVolumeInitiatorsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VolumeARN != nil {
ok := object.Key("VolumeARN")
ok.String(*v.VolumeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListVolumeRecoveryPointsInput(v *ListVolumeRecoveryPointsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListVolumesInput(v *ListVolumesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentNotifyWhenUploadedInput(v *NotifyWhenUploadedInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileShareARN != nil {
ok := object.Key("FileShareARN")
ok.String(*v.FileShareARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRefreshCacheInput(v *RefreshCacheInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileShareARN != nil {
ok := object.Key("FileShareARN")
ok.String(*v.FileShareARN)
}
if v.FolderList != nil {
ok := object.Key("FolderList")
if err := awsAwsjson11_serializeDocumentFolderList(v.FolderList, ok); err != nil {
return err
}
}
if v.Recursive != nil {
ok := object.Key("Recursive")
ok.Boolean(*v.Recursive)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRemoveTagsFromResourceInput(v *RemoveTagsFromResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeys(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentResetCacheInput(v *ResetCacheInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRetrieveTapeArchiveInput(v *RetrieveTapeArchiveInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.TapeARN != nil {
ok := object.Key("TapeARN")
ok.String(*v.TapeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRetrieveTapeRecoveryPointInput(v *RetrieveTapeRecoveryPointInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.TapeARN != nil {
ok := object.Key("TapeARN")
ok.String(*v.TapeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSetLocalConsolePasswordInput(v *SetLocalConsolePasswordInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.LocalConsolePassword != nil {
ok := object.Key("LocalConsolePassword")
ok.String(*v.LocalConsolePassword)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSetSMBGuestPasswordInput(v *SetSMBGuestPasswordInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.Password != nil {
ok := object.Key("Password")
ok.String(*v.Password)
}
return nil
}
func awsAwsjson11_serializeOpDocumentShutdownGatewayInput(v *ShutdownGatewayInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartAvailabilityMonitorTestInput(v *StartAvailabilityMonitorTestInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartGatewayInput(v *StartGatewayInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateAutomaticTapeCreationPolicyInput(v *UpdateAutomaticTapeCreationPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AutomaticTapeCreationRules != nil {
ok := object.Key("AutomaticTapeCreationRules")
if err := awsAwsjson11_serializeDocumentAutomaticTapeCreationRules(v.AutomaticTapeCreationRules, ok); err != nil {
return err
}
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateBandwidthRateLimitInput(v *UpdateBandwidthRateLimitInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AverageDownloadRateLimitInBitsPerSec != nil {
ok := object.Key("AverageDownloadRateLimitInBitsPerSec")
ok.Long(*v.AverageDownloadRateLimitInBitsPerSec)
}
if v.AverageUploadRateLimitInBitsPerSec != nil {
ok := object.Key("AverageUploadRateLimitInBitsPerSec")
ok.Long(*v.AverageUploadRateLimitInBitsPerSec)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateBandwidthRateLimitScheduleInput(v *UpdateBandwidthRateLimitScheduleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BandwidthRateLimitIntervals != nil {
ok := object.Key("BandwidthRateLimitIntervals")
if err := awsAwsjson11_serializeDocumentBandwidthRateLimitIntervals(v.BandwidthRateLimitIntervals, ok); err != nil {
return err
}
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateChapCredentialsInput(v *UpdateChapCredentialsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InitiatorName != nil {
ok := object.Key("InitiatorName")
ok.String(*v.InitiatorName)
}
if v.SecretToAuthenticateInitiator != nil {
ok := object.Key("SecretToAuthenticateInitiator")
ok.String(*v.SecretToAuthenticateInitiator)
}
if v.SecretToAuthenticateTarget != nil {
ok := object.Key("SecretToAuthenticateTarget")
ok.String(*v.SecretToAuthenticateTarget)
}
if v.TargetARN != nil {
ok := object.Key("TargetARN")
ok.String(*v.TargetARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateFileSystemAssociationInput(v *UpdateFileSystemAssociationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AuditDestinationARN != nil {
ok := object.Key("AuditDestinationARN")
ok.String(*v.AuditDestinationARN)
}
if v.CacheAttributes != nil {
ok := object.Key("CacheAttributes")
if err := awsAwsjson11_serializeDocumentCacheAttributes(v.CacheAttributes, ok); err != nil {
return err
}
}
if v.FileSystemAssociationARN != nil {
ok := object.Key("FileSystemAssociationARN")
ok.String(*v.FileSystemAssociationARN)
}
if v.Password != nil {
ok := object.Key("Password")
ok.String(*v.Password)
}
if v.UserName != nil {
ok := object.Key("UserName")
ok.String(*v.UserName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateGatewayInformationInput(v *UpdateGatewayInformationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLogGroupARN != nil {
ok := object.Key("CloudWatchLogGroupARN")
ok.String(*v.CloudWatchLogGroupARN)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if len(v.GatewayCapacity) > 0 {
ok := object.Key("GatewayCapacity")
ok.String(string(v.GatewayCapacity))
}
if v.GatewayName != nil {
ok := object.Key("GatewayName")
ok.String(*v.GatewayName)
}
if v.GatewayTimezone != nil {
ok := object.Key("GatewayTimezone")
ok.String(*v.GatewayTimezone)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateGatewaySoftwareNowInput(v *UpdateGatewaySoftwareNowInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateMaintenanceStartTimeInput(v *UpdateMaintenanceStartTimeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DayOfMonth != nil {
ok := object.Key("DayOfMonth")
ok.Integer(*v.DayOfMonth)
}
if v.DayOfWeek != nil {
ok := object.Key("DayOfWeek")
ok.Integer(*v.DayOfWeek)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.HourOfDay != nil {
ok := object.Key("HourOfDay")
ok.Integer(*v.HourOfDay)
}
if v.MinuteOfHour != nil {
ok := object.Key("MinuteOfHour")
ok.Integer(*v.MinuteOfHour)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateNFSFileShareInput(v *UpdateNFSFileShareInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AuditDestinationARN != nil {
ok := object.Key("AuditDestinationARN")
ok.String(*v.AuditDestinationARN)
}
if v.CacheAttributes != nil {
ok := object.Key("CacheAttributes")
if err := awsAwsjson11_serializeDocumentCacheAttributes(v.CacheAttributes, ok); err != nil {
return err
}
}
if v.ClientList != nil {
ok := object.Key("ClientList")
if err := awsAwsjson11_serializeDocumentFileShareClientList(v.ClientList, ok); err != nil {
return err
}
}
if v.DefaultStorageClass != nil {
ok := object.Key("DefaultStorageClass")
ok.String(*v.DefaultStorageClass)
}
if v.FileShareARN != nil {
ok := object.Key("FileShareARN")
ok.String(*v.FileShareARN)
}
if v.FileShareName != nil {
ok := object.Key("FileShareName")
ok.String(*v.FileShareName)
}
if v.GuessMIMETypeEnabled != nil {
ok := object.Key("GuessMIMETypeEnabled")
ok.Boolean(*v.GuessMIMETypeEnabled)
}
if v.KMSEncrypted != nil {
ok := object.Key("KMSEncrypted")
ok.Boolean(*v.KMSEncrypted)
}
if v.KMSKey != nil {
ok := object.Key("KMSKey")
ok.String(*v.KMSKey)
}
if v.NFSFileShareDefaults != nil {
ok := object.Key("NFSFileShareDefaults")
if err := awsAwsjson11_serializeDocumentNFSFileShareDefaults(v.NFSFileShareDefaults, ok); err != nil {
return err
}
}
if v.NotificationPolicy != nil {
ok := object.Key("NotificationPolicy")
ok.String(*v.NotificationPolicy)
}
if len(v.ObjectACL) > 0 {
ok := object.Key("ObjectACL")
ok.String(string(v.ObjectACL))
}
if v.ReadOnly != nil {
ok := object.Key("ReadOnly")
ok.Boolean(*v.ReadOnly)
}
if v.RequesterPays != nil {
ok := object.Key("RequesterPays")
ok.Boolean(*v.RequesterPays)
}
if v.Squash != nil {
ok := object.Key("Squash")
ok.String(*v.Squash)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateSMBFileShareInput(v *UpdateSMBFileShareInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessBasedEnumeration != nil {
ok := object.Key("AccessBasedEnumeration")
ok.Boolean(*v.AccessBasedEnumeration)
}
if v.AdminUserList != nil {
ok := object.Key("AdminUserList")
if err := awsAwsjson11_serializeDocumentUserList(v.AdminUserList, ok); err != nil {
return err
}
}
if v.AuditDestinationARN != nil {
ok := object.Key("AuditDestinationARN")
ok.String(*v.AuditDestinationARN)
}
if v.CacheAttributes != nil {
ok := object.Key("CacheAttributes")
if err := awsAwsjson11_serializeDocumentCacheAttributes(v.CacheAttributes, ok); err != nil {
return err
}
}
if len(v.CaseSensitivity) > 0 {
ok := object.Key("CaseSensitivity")
ok.String(string(v.CaseSensitivity))
}
if v.DefaultStorageClass != nil {
ok := object.Key("DefaultStorageClass")
ok.String(*v.DefaultStorageClass)
}
if v.FileShareARN != nil {
ok := object.Key("FileShareARN")
ok.String(*v.FileShareARN)
}
if v.FileShareName != nil {
ok := object.Key("FileShareName")
ok.String(*v.FileShareName)
}
if v.GuessMIMETypeEnabled != nil {
ok := object.Key("GuessMIMETypeEnabled")
ok.Boolean(*v.GuessMIMETypeEnabled)
}
if v.InvalidUserList != nil {
ok := object.Key("InvalidUserList")
if err := awsAwsjson11_serializeDocumentUserList(v.InvalidUserList, ok); err != nil {
return err
}
}
if v.KMSEncrypted != nil {
ok := object.Key("KMSEncrypted")
ok.Boolean(*v.KMSEncrypted)
}
if v.KMSKey != nil {
ok := object.Key("KMSKey")
ok.String(*v.KMSKey)
}
if v.NotificationPolicy != nil {
ok := object.Key("NotificationPolicy")
ok.String(*v.NotificationPolicy)
}
if len(v.ObjectACL) > 0 {
ok := object.Key("ObjectACL")
ok.String(string(v.ObjectACL))
}
if v.OplocksEnabled != nil {
ok := object.Key("OplocksEnabled")
ok.Boolean(*v.OplocksEnabled)
}
if v.ReadOnly != nil {
ok := object.Key("ReadOnly")
ok.Boolean(*v.ReadOnly)
}
if v.RequesterPays != nil {
ok := object.Key("RequesterPays")
ok.Boolean(*v.RequesterPays)
}
if v.SMBACLEnabled != nil {
ok := object.Key("SMBACLEnabled")
ok.Boolean(*v.SMBACLEnabled)
}
if v.ValidUserList != nil {
ok := object.Key("ValidUserList")
if err := awsAwsjson11_serializeDocumentUserList(v.ValidUserList, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateSMBFileShareVisibilityInput(v *UpdateSMBFileShareVisibilityInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileSharesVisible != nil {
ok := object.Key("FileSharesVisible")
ok.Boolean(*v.FileSharesVisible)
}
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateSMBLocalGroupsInput(v *UpdateSMBLocalGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if v.SMBLocalGroups != nil {
ok := object.Key("SMBLocalGroups")
if err := awsAwsjson11_serializeDocumentSMBLocalGroups(v.SMBLocalGroups, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateSMBSecurityStrategyInput(v *UpdateSMBSecurityStrategyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayARN != nil {
ok := object.Key("GatewayARN")
ok.String(*v.GatewayARN)
}
if len(v.SMBSecurityStrategy) > 0 {
ok := object.Key("SMBSecurityStrategy")
ok.String(string(v.SMBSecurityStrategy))
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateSnapshotScheduleInput(v *UpdateSnapshotScheduleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.RecurrenceInHours != nil {
ok := object.Key("RecurrenceInHours")
ok.Integer(*v.RecurrenceInHours)
}
if v.StartAt != nil {
ok := object.Key("StartAt")
ok.Integer(*v.StartAt)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.VolumeARN != nil {
ok := object.Key("VolumeARN")
ok.String(*v.VolumeARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateVTLDeviceTypeInput(v *UpdateVTLDeviceTypeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeviceType != nil {
ok := object.Key("DeviceType")
ok.String(*v.DeviceType)
}
if v.VTLDeviceARN != nil {
ok := object.Key("VTLDeviceARN")
ok.String(*v.VTLDeviceARN)
}
return nil
}
| 7,577 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package storagegateway
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/storagegateway/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpActivateGateway struct {
}
func (*validateOpActivateGateway) ID() string {
return "OperationInputValidation"
}
func (m *validateOpActivateGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ActivateGatewayInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpActivateGatewayInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddCache struct {
}
func (*validateOpAddCache) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddCache) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddCacheInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddCacheInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddTagsToResource struct {
}
func (*validateOpAddTagsToResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddTagsToResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddTagsToResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddTagsToResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddUploadBuffer struct {
}
func (*validateOpAddUploadBuffer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddUploadBuffer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddUploadBufferInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddUploadBufferInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddWorkingStorage struct {
}
func (*validateOpAddWorkingStorage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddWorkingStorage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddWorkingStorageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddWorkingStorageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAssignTapePool struct {
}
func (*validateOpAssignTapePool) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssignTapePool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssignTapePoolInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssignTapePoolInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAssociateFileSystem struct {
}
func (*validateOpAssociateFileSystem) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateFileSystem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateFileSystemInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateFileSystemInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAttachVolume struct {
}
func (*validateOpAttachVolume) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAttachVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AttachVolumeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAttachVolumeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCancelArchival struct {
}
func (*validateOpCancelArchival) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCancelArchival) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CancelArchivalInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCancelArchivalInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCancelRetrieval struct {
}
func (*validateOpCancelRetrieval) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCancelRetrieval) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CancelRetrievalInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCancelRetrievalInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCachediSCSIVolume struct {
}
func (*validateOpCreateCachediSCSIVolume) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCachediSCSIVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCachediSCSIVolumeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCachediSCSIVolumeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateNFSFileShare struct {
}
func (*validateOpCreateNFSFileShare) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateNFSFileShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateNFSFileShareInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateNFSFileShareInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSMBFileShare struct {
}
func (*validateOpCreateSMBFileShare) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSMBFileShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSMBFileShareInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSMBFileShareInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSnapshotFromVolumeRecoveryPoint struct {
}
func (*validateOpCreateSnapshotFromVolumeRecoveryPoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSnapshotFromVolumeRecoveryPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSnapshotFromVolumeRecoveryPointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSnapshotFromVolumeRecoveryPointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
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 validateOpCreateStorediSCSIVolume struct {
}
func (*validateOpCreateStorediSCSIVolume) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateStorediSCSIVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateStorediSCSIVolumeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateStorediSCSIVolumeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateTapePool struct {
}
func (*validateOpCreateTapePool) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateTapePool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateTapePoolInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateTapePoolInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateTapes struct {
}
func (*validateOpCreateTapes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateTapes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateTapesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateTapesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateTapeWithBarcode struct {
}
func (*validateOpCreateTapeWithBarcode) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateTapeWithBarcode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateTapeWithBarcodeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateTapeWithBarcodeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAutomaticTapeCreationPolicy struct {
}
func (*validateOpDeleteAutomaticTapeCreationPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAutomaticTapeCreationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAutomaticTapeCreationPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAutomaticTapeCreationPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBandwidthRateLimit struct {
}
func (*validateOpDeleteBandwidthRateLimit) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBandwidthRateLimit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBandwidthRateLimitInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBandwidthRateLimitInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteChapCredentials struct {
}
func (*validateOpDeleteChapCredentials) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteChapCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteChapCredentialsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteChapCredentialsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteFileShare struct {
}
func (*validateOpDeleteFileShare) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteFileShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteFileShareInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteFileShareInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteGateway struct {
}
func (*validateOpDeleteGateway) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteGatewayInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteGatewayInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSnapshotSchedule struct {
}
func (*validateOpDeleteSnapshotSchedule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSnapshotSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSnapshotScheduleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSnapshotScheduleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteTapeArchive struct {
}
func (*validateOpDeleteTapeArchive) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteTapeArchive) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteTapeArchiveInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteTapeArchiveInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteTape struct {
}
func (*validateOpDeleteTape) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteTape) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteTapeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteTapeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteTapePool struct {
}
func (*validateOpDeleteTapePool) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteTapePool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteTapePoolInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteTapePoolInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteVolume struct {
}
func (*validateOpDeleteVolume) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteVolumeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteVolumeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAvailabilityMonitorTest struct {
}
func (*validateOpDescribeAvailabilityMonitorTest) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAvailabilityMonitorTest) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAvailabilityMonitorTestInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAvailabilityMonitorTestInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeBandwidthRateLimit struct {
}
func (*validateOpDescribeBandwidthRateLimit) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeBandwidthRateLimit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeBandwidthRateLimitInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeBandwidthRateLimitInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeBandwidthRateLimitSchedule struct {
}
func (*validateOpDescribeBandwidthRateLimitSchedule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeBandwidthRateLimitSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeBandwidthRateLimitScheduleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeBandwidthRateLimitScheduleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeCachediSCSIVolumes struct {
}
func (*validateOpDescribeCachediSCSIVolumes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeCachediSCSIVolumes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeCachediSCSIVolumesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeCachediSCSIVolumesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeCache struct {
}
func (*validateOpDescribeCache) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeCache) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeCacheInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeCacheInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeChapCredentials struct {
}
func (*validateOpDescribeChapCredentials) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeChapCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeChapCredentialsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeChapCredentialsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeFileSystemAssociations struct {
}
func (*validateOpDescribeFileSystemAssociations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeFileSystemAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeFileSystemAssociationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeFileSystemAssociationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeGatewayInformation struct {
}
func (*validateOpDescribeGatewayInformation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeGatewayInformation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeGatewayInformationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeGatewayInformationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeMaintenanceStartTime struct {
}
func (*validateOpDescribeMaintenanceStartTime) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeMaintenanceStartTime) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeMaintenanceStartTimeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeMaintenanceStartTimeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeNFSFileShares struct {
}
func (*validateOpDescribeNFSFileShares) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeNFSFileShares) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeNFSFileSharesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeNFSFileSharesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeSMBFileShares struct {
}
func (*validateOpDescribeSMBFileShares) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeSMBFileShares) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeSMBFileSharesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeSMBFileSharesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeSMBSettings struct {
}
func (*validateOpDescribeSMBSettings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeSMBSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeSMBSettingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeSMBSettingsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeSnapshotSchedule struct {
}
func (*validateOpDescribeSnapshotSchedule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeSnapshotSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeSnapshotScheduleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeSnapshotScheduleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeStorediSCSIVolumes struct {
}
func (*validateOpDescribeStorediSCSIVolumes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeStorediSCSIVolumes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeStorediSCSIVolumesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeStorediSCSIVolumesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTapeRecoveryPoints struct {
}
func (*validateOpDescribeTapeRecoveryPoints) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTapeRecoveryPoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTapeRecoveryPointsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTapeRecoveryPointsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTapes struct {
}
func (*validateOpDescribeTapes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTapes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTapesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTapesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeUploadBuffer struct {
}
func (*validateOpDescribeUploadBuffer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeUploadBuffer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeUploadBufferInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeUploadBufferInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeVTLDevices struct {
}
func (*validateOpDescribeVTLDevices) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeVTLDevices) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeVTLDevicesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeVTLDevicesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeWorkingStorage struct {
}
func (*validateOpDescribeWorkingStorage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeWorkingStorage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeWorkingStorageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeWorkingStorageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetachVolume struct {
}
func (*validateOpDetachVolume) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetachVolume) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetachVolumeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetachVolumeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisableGateway struct {
}
func (*validateOpDisableGateway) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisableGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisableGatewayInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisableGatewayInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateFileSystem struct {
}
func (*validateOpDisassociateFileSystem) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateFileSystem) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateFileSystemInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateFileSystemInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpJoinDomain struct {
}
func (*validateOpJoinDomain) ID() string {
return "OperationInputValidation"
}
func (m *validateOpJoinDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*JoinDomainInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpJoinDomainInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListLocalDisks struct {
}
func (*validateOpListLocalDisks) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListLocalDisks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListLocalDisksInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListLocalDisksInput(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 validateOpListVolumeInitiators struct {
}
func (*validateOpListVolumeInitiators) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListVolumeInitiators) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListVolumeInitiatorsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListVolumeInitiatorsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListVolumeRecoveryPoints struct {
}
func (*validateOpListVolumeRecoveryPoints) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListVolumeRecoveryPoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListVolumeRecoveryPointsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListVolumeRecoveryPointsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpNotifyWhenUploaded struct {
}
func (*validateOpNotifyWhenUploaded) ID() string {
return "OperationInputValidation"
}
func (m *validateOpNotifyWhenUploaded) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*NotifyWhenUploadedInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpNotifyWhenUploadedInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRefreshCache struct {
}
func (*validateOpRefreshCache) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRefreshCache) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RefreshCacheInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRefreshCacheInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveTagsFromResource struct {
}
func (*validateOpRemoveTagsFromResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveTagsFromResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveTagsFromResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveTagsFromResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpResetCache struct {
}
func (*validateOpResetCache) ID() string {
return "OperationInputValidation"
}
func (m *validateOpResetCache) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ResetCacheInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpResetCacheInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRetrieveTapeArchive struct {
}
func (*validateOpRetrieveTapeArchive) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRetrieveTapeArchive) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RetrieveTapeArchiveInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRetrieveTapeArchiveInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRetrieveTapeRecoveryPoint struct {
}
func (*validateOpRetrieveTapeRecoveryPoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRetrieveTapeRecoveryPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RetrieveTapeRecoveryPointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRetrieveTapeRecoveryPointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSetLocalConsolePassword struct {
}
func (*validateOpSetLocalConsolePassword) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSetLocalConsolePassword) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SetLocalConsolePasswordInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSetLocalConsolePasswordInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSetSMBGuestPassword struct {
}
func (*validateOpSetSMBGuestPassword) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSetSMBGuestPassword) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SetSMBGuestPasswordInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSetSMBGuestPasswordInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpShutdownGateway struct {
}
func (*validateOpShutdownGateway) ID() string {
return "OperationInputValidation"
}
func (m *validateOpShutdownGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ShutdownGatewayInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpShutdownGatewayInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartAvailabilityMonitorTest struct {
}
func (*validateOpStartAvailabilityMonitorTest) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartAvailabilityMonitorTest) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartAvailabilityMonitorTestInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartAvailabilityMonitorTestInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartGateway struct {
}
func (*validateOpStartGateway) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartGatewayInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartGatewayInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateAutomaticTapeCreationPolicy struct {
}
func (*validateOpUpdateAutomaticTapeCreationPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAutomaticTapeCreationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAutomaticTapeCreationPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAutomaticTapeCreationPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateBandwidthRateLimit struct {
}
func (*validateOpUpdateBandwidthRateLimit) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateBandwidthRateLimit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateBandwidthRateLimitInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateBandwidthRateLimitInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateBandwidthRateLimitSchedule struct {
}
func (*validateOpUpdateBandwidthRateLimitSchedule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateBandwidthRateLimitSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateBandwidthRateLimitScheduleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateBandwidthRateLimitScheduleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateChapCredentials struct {
}
func (*validateOpUpdateChapCredentials) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateChapCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateChapCredentialsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateChapCredentialsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateFileSystemAssociation struct {
}
func (*validateOpUpdateFileSystemAssociation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateFileSystemAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateFileSystemAssociationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateFileSystemAssociationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateGatewayInformation struct {
}
func (*validateOpUpdateGatewayInformation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateGatewayInformation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateGatewayInformationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateGatewayInformationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateGatewaySoftwareNow struct {
}
func (*validateOpUpdateGatewaySoftwareNow) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateGatewaySoftwareNow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateGatewaySoftwareNowInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateGatewaySoftwareNowInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateMaintenanceStartTime struct {
}
func (*validateOpUpdateMaintenanceStartTime) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateMaintenanceStartTime) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateMaintenanceStartTimeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateMaintenanceStartTimeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateNFSFileShare struct {
}
func (*validateOpUpdateNFSFileShare) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateNFSFileShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateNFSFileShareInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateNFSFileShareInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSMBFileShare struct {
}
func (*validateOpUpdateSMBFileShare) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSMBFileShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSMBFileShareInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSMBFileShareInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSMBFileShareVisibility struct {
}
func (*validateOpUpdateSMBFileShareVisibility) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSMBFileShareVisibility) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSMBFileShareVisibilityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSMBFileShareVisibilityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSMBLocalGroups struct {
}
func (*validateOpUpdateSMBLocalGroups) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSMBLocalGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSMBLocalGroupsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSMBLocalGroupsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSMBSecurityStrategy struct {
}
func (*validateOpUpdateSMBSecurityStrategy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSMBSecurityStrategy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSMBSecurityStrategyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSMBSecurityStrategyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSnapshotSchedule struct {
}
func (*validateOpUpdateSnapshotSchedule) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSnapshotSchedule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSnapshotScheduleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSnapshotScheduleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateVTLDeviceType struct {
}
func (*validateOpUpdateVTLDeviceType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateVTLDeviceType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateVTLDeviceTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateVTLDeviceTypeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpActivateGatewayValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpActivateGateway{}, middleware.After)
}
func addOpAddCacheValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddCache{}, middleware.After)
}
func addOpAddTagsToResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddTagsToResource{}, middleware.After)
}
func addOpAddUploadBufferValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddUploadBuffer{}, middleware.After)
}
func addOpAddWorkingStorageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddWorkingStorage{}, middleware.After)
}
func addOpAssignTapePoolValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssignTapePool{}, middleware.After)
}
func addOpAssociateFileSystemValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateFileSystem{}, middleware.After)
}
func addOpAttachVolumeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAttachVolume{}, middleware.After)
}
func addOpCancelArchivalValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCancelArchival{}, middleware.After)
}
func addOpCancelRetrievalValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCancelRetrieval{}, middleware.After)
}
func addOpCreateCachediSCSIVolumeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCachediSCSIVolume{}, middleware.After)
}
func addOpCreateNFSFileShareValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateNFSFileShare{}, middleware.After)
}
func addOpCreateSMBFileShareValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSMBFileShare{}, middleware.After)
}
func addOpCreateSnapshotFromVolumeRecoveryPointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSnapshotFromVolumeRecoveryPoint{}, middleware.After)
}
func addOpCreateSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSnapshot{}, middleware.After)
}
func addOpCreateStorediSCSIVolumeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateStorediSCSIVolume{}, middleware.After)
}
func addOpCreateTapePoolValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateTapePool{}, middleware.After)
}
func addOpCreateTapesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateTapes{}, middleware.After)
}
func addOpCreateTapeWithBarcodeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateTapeWithBarcode{}, middleware.After)
}
func addOpDeleteAutomaticTapeCreationPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAutomaticTapeCreationPolicy{}, middleware.After)
}
func addOpDeleteBandwidthRateLimitValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBandwidthRateLimit{}, middleware.After)
}
func addOpDeleteChapCredentialsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteChapCredentials{}, middleware.After)
}
func addOpDeleteFileShareValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteFileShare{}, middleware.After)
}
func addOpDeleteGatewayValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteGateway{}, middleware.After)
}
func addOpDeleteSnapshotScheduleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSnapshotSchedule{}, middleware.After)
}
func addOpDeleteTapeArchiveValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteTapeArchive{}, middleware.After)
}
func addOpDeleteTapeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteTape{}, middleware.After)
}
func addOpDeleteTapePoolValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteTapePool{}, middleware.After)
}
func addOpDeleteVolumeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteVolume{}, middleware.After)
}
func addOpDescribeAvailabilityMonitorTestValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAvailabilityMonitorTest{}, middleware.After)
}
func addOpDescribeBandwidthRateLimitValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeBandwidthRateLimit{}, middleware.After)
}
func addOpDescribeBandwidthRateLimitScheduleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeBandwidthRateLimitSchedule{}, middleware.After)
}
func addOpDescribeCachediSCSIVolumesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeCachediSCSIVolumes{}, middleware.After)
}
func addOpDescribeCacheValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeCache{}, middleware.After)
}
func addOpDescribeChapCredentialsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeChapCredentials{}, middleware.After)
}
func addOpDescribeFileSystemAssociationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeFileSystemAssociations{}, middleware.After)
}
func addOpDescribeGatewayInformationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeGatewayInformation{}, middleware.After)
}
func addOpDescribeMaintenanceStartTimeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeMaintenanceStartTime{}, middleware.After)
}
func addOpDescribeNFSFileSharesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeNFSFileShares{}, middleware.After)
}
func addOpDescribeSMBFileSharesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeSMBFileShares{}, middleware.After)
}
func addOpDescribeSMBSettingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeSMBSettings{}, middleware.After)
}
func addOpDescribeSnapshotScheduleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeSnapshotSchedule{}, middleware.After)
}
func addOpDescribeStorediSCSIVolumesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeStorediSCSIVolumes{}, middleware.After)
}
func addOpDescribeTapeRecoveryPointsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTapeRecoveryPoints{}, middleware.After)
}
func addOpDescribeTapesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTapes{}, middleware.After)
}
func addOpDescribeUploadBufferValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeUploadBuffer{}, middleware.After)
}
func addOpDescribeVTLDevicesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeVTLDevices{}, middleware.After)
}
func addOpDescribeWorkingStorageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeWorkingStorage{}, middleware.After)
}
func addOpDetachVolumeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetachVolume{}, middleware.After)
}
func addOpDisableGatewayValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisableGateway{}, middleware.After)
}
func addOpDisassociateFileSystemValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateFileSystem{}, middleware.After)
}
func addOpJoinDomainValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpJoinDomain{}, middleware.After)
}
func addOpListLocalDisksValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListLocalDisks{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpListVolumeInitiatorsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListVolumeInitiators{}, middleware.After)
}
func addOpListVolumeRecoveryPointsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListVolumeRecoveryPoints{}, middleware.After)
}
func addOpNotifyWhenUploadedValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpNotifyWhenUploaded{}, middleware.After)
}
func addOpRefreshCacheValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRefreshCache{}, middleware.After)
}
func addOpRemoveTagsFromResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveTagsFromResource{}, middleware.After)
}
func addOpResetCacheValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpResetCache{}, middleware.After)
}
func addOpRetrieveTapeArchiveValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRetrieveTapeArchive{}, middleware.After)
}
func addOpRetrieveTapeRecoveryPointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRetrieveTapeRecoveryPoint{}, middleware.After)
}
func addOpSetLocalConsolePasswordValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSetLocalConsolePassword{}, middleware.After)
}
func addOpSetSMBGuestPasswordValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSetSMBGuestPassword{}, middleware.After)
}
func addOpShutdownGatewayValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpShutdownGateway{}, middleware.After)
}
func addOpStartAvailabilityMonitorTestValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartAvailabilityMonitorTest{}, middleware.After)
}
func addOpStartGatewayValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartGateway{}, middleware.After)
}
func addOpUpdateAutomaticTapeCreationPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAutomaticTapeCreationPolicy{}, middleware.After)
}
func addOpUpdateBandwidthRateLimitValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateBandwidthRateLimit{}, middleware.After)
}
func addOpUpdateBandwidthRateLimitScheduleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateBandwidthRateLimitSchedule{}, middleware.After)
}
func addOpUpdateChapCredentialsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateChapCredentials{}, middleware.After)
}
func addOpUpdateFileSystemAssociationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateFileSystemAssociation{}, middleware.After)
}
func addOpUpdateGatewayInformationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateGatewayInformation{}, middleware.After)
}
func addOpUpdateGatewaySoftwareNowValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateGatewaySoftwareNow{}, middleware.After)
}
func addOpUpdateMaintenanceStartTimeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateMaintenanceStartTime{}, middleware.After)
}
func addOpUpdateNFSFileShareValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateNFSFileShare{}, middleware.After)
}
func addOpUpdateSMBFileShareValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSMBFileShare{}, middleware.After)
}
func addOpUpdateSMBFileShareVisibilityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSMBFileShareVisibility{}, middleware.After)
}
func addOpUpdateSMBLocalGroupsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSMBLocalGroups{}, middleware.After)
}
func addOpUpdateSMBSecurityStrategyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSMBSecurityStrategy{}, middleware.After)
}
func addOpUpdateSnapshotScheduleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSnapshotSchedule{}, middleware.After)
}
func addOpUpdateVTLDeviceTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateVTLDeviceType{}, middleware.After)
}
func validateAutomaticTapeCreationRule(v *types.AutomaticTapeCreationRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AutomaticTapeCreationRule"}
if v.TapeBarcodePrefix == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeBarcodePrefix"))
}
if v.PoolId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PoolId"))
}
if v.TapeSizeInBytes == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeSizeInBytes"))
}
if v.MinimumNumTapes == nil {
invalidParams.Add(smithy.NewErrParamRequired("MinimumNumTapes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAutomaticTapeCreationRules(v []types.AutomaticTapeCreationRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AutomaticTapeCreationRules"}
for i := range v {
if err := validateAutomaticTapeCreationRule(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBandwidthRateLimitInterval(v *types.BandwidthRateLimitInterval) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BandwidthRateLimitInterval"}
if v.StartHourOfDay == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartHourOfDay"))
}
if v.StartMinuteOfHour == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartMinuteOfHour"))
}
if v.EndHourOfDay == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndHourOfDay"))
}
if v.EndMinuteOfHour == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndMinuteOfHour"))
}
if v.DaysOfWeek == nil {
invalidParams.Add(smithy.NewErrParamRequired("DaysOfWeek"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBandwidthRateLimitIntervals(v []types.BandwidthRateLimitInterval) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BandwidthRateLimitIntervals"}
for i := range v {
if err := validateBandwidthRateLimitInterval(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTags(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tags"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpActivateGatewayInput(v *ActivateGatewayInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ActivateGatewayInput"}
if v.ActivationKey == nil {
invalidParams.Add(smithy.NewErrParamRequired("ActivationKey"))
}
if v.GatewayName == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayName"))
}
if v.GatewayTimezone == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayTimezone"))
}
if v.GatewayRegion == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayRegion"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddCacheInput(v *AddCacheInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddCacheInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.DiskIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddTagsToResourceInput(v *AddTagsToResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddTagsToResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} else if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddUploadBufferInput(v *AddUploadBufferInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddUploadBufferInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.DiskIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddWorkingStorageInput(v *AddWorkingStorageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddWorkingStorageInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.DiskIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssignTapePoolInput(v *AssignTapePoolInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssignTapePoolInput"}
if v.TapeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeARN"))
}
if v.PoolId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PoolId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateFileSystemInput(v *AssociateFileSystemInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateFileSystemInput"}
if v.UserName == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserName"))
}
if v.Password == nil {
invalidParams.Add(smithy.NewErrParamRequired("Password"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.LocationARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocationARN"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAttachVolumeInput(v *AttachVolumeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AttachVolumeInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.VolumeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARN"))
}
if v.NetworkInterfaceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCancelArchivalInput(v *CancelArchivalInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CancelArchivalInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.TapeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCancelRetrievalInput(v *CancelRetrievalInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CancelRetrievalInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.TapeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCachediSCSIVolumeInput(v *CreateCachediSCSIVolumeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCachediSCSIVolumeInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.TargetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetName"))
}
if v.NetworkInterfaceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateNFSFileShareInput(v *CreateNFSFileShareInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateNFSFileShareInput"}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.Role == nil {
invalidParams.Add(smithy.NewErrParamRequired("Role"))
}
if v.LocationARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocationARN"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSMBFileShareInput(v *CreateSMBFileShareInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSMBFileShareInput"}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.Role == nil {
invalidParams.Add(smithy.NewErrParamRequired("Role"))
}
if v.LocationARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocationARN"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSnapshotFromVolumeRecoveryPointInput(v *CreateSnapshotFromVolumeRecoveryPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSnapshotFromVolumeRecoveryPointInput"}
if v.VolumeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARN"))
}
if v.SnapshotDescription == nil {
invalidParams.Add(smithy.NewErrParamRequired("SnapshotDescription"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSnapshotInput(v *CreateSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSnapshotInput"}
if v.VolumeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARN"))
}
if v.SnapshotDescription == nil {
invalidParams.Add(smithy.NewErrParamRequired("SnapshotDescription"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateStorediSCSIVolumeInput(v *CreateStorediSCSIVolumeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateStorediSCSIVolumeInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.DiskId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskId"))
}
if v.TargetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetName"))
}
if v.NetworkInterfaceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("NetworkInterfaceId"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateTapePoolInput(v *CreateTapePoolInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateTapePoolInput"}
if v.PoolName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PoolName"))
}
if len(v.StorageClass) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("StorageClass"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateTapesInput(v *CreateTapesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateTapesInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.TapeSizeInBytes == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeSizeInBytes"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.NumTapesToCreate == nil {
invalidParams.Add(smithy.NewErrParamRequired("NumTapesToCreate"))
}
if v.TapeBarcodePrefix == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeBarcodePrefix"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateTapeWithBarcodeInput(v *CreateTapeWithBarcodeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateTapeWithBarcodeInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.TapeSizeInBytes == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeSizeInBytes"))
}
if v.TapeBarcode == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeBarcode"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAutomaticTapeCreationPolicyInput(v *DeleteAutomaticTapeCreationPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAutomaticTapeCreationPolicyInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBandwidthRateLimitInput(v *DeleteBandwidthRateLimitInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBandwidthRateLimitInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.BandwidthType == nil {
invalidParams.Add(smithy.NewErrParamRequired("BandwidthType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteChapCredentialsInput(v *DeleteChapCredentialsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteChapCredentialsInput"}
if v.TargetARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetARN"))
}
if v.InitiatorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InitiatorName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteFileShareInput(v *DeleteFileShareInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteFileShareInput"}
if v.FileShareARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileShareARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteGatewayInput(v *DeleteGatewayInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteGatewayInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSnapshotScheduleInput(v *DeleteSnapshotScheduleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSnapshotScheduleInput"}
if v.VolumeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteTapeArchiveInput(v *DeleteTapeArchiveInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteTapeArchiveInput"}
if v.TapeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteTapeInput(v *DeleteTapeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteTapeInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.TapeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteTapePoolInput(v *DeleteTapePoolInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteTapePoolInput"}
if v.PoolARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("PoolARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteVolumeInput(v *DeleteVolumeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteVolumeInput"}
if v.VolumeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAvailabilityMonitorTestInput(v *DescribeAvailabilityMonitorTestInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAvailabilityMonitorTestInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeBandwidthRateLimitInput(v *DescribeBandwidthRateLimitInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeBandwidthRateLimitInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeBandwidthRateLimitScheduleInput(v *DescribeBandwidthRateLimitScheduleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeBandwidthRateLimitScheduleInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeCachediSCSIVolumesInput(v *DescribeCachediSCSIVolumesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeCachediSCSIVolumesInput"}
if v.VolumeARNs == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARNs"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeCacheInput(v *DescribeCacheInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeCacheInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeChapCredentialsInput(v *DescribeChapCredentialsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeChapCredentialsInput"}
if v.TargetARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeFileSystemAssociationsInput(v *DescribeFileSystemAssociationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeFileSystemAssociationsInput"}
if v.FileSystemAssociationARNList == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileSystemAssociationARNList"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeGatewayInformationInput(v *DescribeGatewayInformationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeGatewayInformationInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeMaintenanceStartTimeInput(v *DescribeMaintenanceStartTimeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeMaintenanceStartTimeInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeNFSFileSharesInput(v *DescribeNFSFileSharesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeNFSFileSharesInput"}
if v.FileShareARNList == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileShareARNList"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeSMBFileSharesInput(v *DescribeSMBFileSharesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeSMBFileSharesInput"}
if v.FileShareARNList == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileShareARNList"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeSMBSettingsInput(v *DescribeSMBSettingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeSMBSettingsInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeSnapshotScheduleInput(v *DescribeSnapshotScheduleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeSnapshotScheduleInput"}
if v.VolumeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeStorediSCSIVolumesInput(v *DescribeStorediSCSIVolumesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeStorediSCSIVolumesInput"}
if v.VolumeARNs == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARNs"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTapeRecoveryPointsInput(v *DescribeTapeRecoveryPointsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTapeRecoveryPointsInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTapesInput(v *DescribeTapesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTapesInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeUploadBufferInput(v *DescribeUploadBufferInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeUploadBufferInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeVTLDevicesInput(v *DescribeVTLDevicesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeVTLDevicesInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeWorkingStorageInput(v *DescribeWorkingStorageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeWorkingStorageInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetachVolumeInput(v *DetachVolumeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetachVolumeInput"}
if v.VolumeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisableGatewayInput(v *DisableGatewayInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisableGatewayInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateFileSystemInput(v *DisassociateFileSystemInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateFileSystemInput"}
if v.FileSystemAssociationARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileSystemAssociationARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpJoinDomainInput(v *JoinDomainInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JoinDomainInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.DomainName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainName"))
}
if v.UserName == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserName"))
}
if v.Password == nil {
invalidParams.Add(smithy.NewErrParamRequired("Password"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListLocalDisksInput(v *ListLocalDisksInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListLocalDisksInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
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 validateOpListVolumeInitiatorsInput(v *ListVolumeInitiatorsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListVolumeInitiatorsInput"}
if v.VolumeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListVolumeRecoveryPointsInput(v *ListVolumeRecoveryPointsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListVolumeRecoveryPointsInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpNotifyWhenUploadedInput(v *NotifyWhenUploadedInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "NotifyWhenUploadedInput"}
if v.FileShareARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileShareARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRefreshCacheInput(v *RefreshCacheInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RefreshCacheInput"}
if v.FileShareARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileShareARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveTagsFromResourceInput(v *RemoveTagsFromResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveTagsFromResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpResetCacheInput(v *ResetCacheInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResetCacheInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRetrieveTapeArchiveInput(v *RetrieveTapeArchiveInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RetrieveTapeArchiveInput"}
if v.TapeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeARN"))
}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRetrieveTapeRecoveryPointInput(v *RetrieveTapeRecoveryPointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RetrieveTapeRecoveryPointInput"}
if v.TapeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TapeARN"))
}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSetLocalConsolePasswordInput(v *SetLocalConsolePasswordInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SetLocalConsolePasswordInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.LocalConsolePassword == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocalConsolePassword"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSetSMBGuestPasswordInput(v *SetSMBGuestPasswordInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SetSMBGuestPasswordInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.Password == nil {
invalidParams.Add(smithy.NewErrParamRequired("Password"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpShutdownGatewayInput(v *ShutdownGatewayInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ShutdownGatewayInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartAvailabilityMonitorTestInput(v *StartAvailabilityMonitorTestInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartAvailabilityMonitorTestInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartGatewayInput(v *StartGatewayInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartGatewayInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateAutomaticTapeCreationPolicyInput(v *UpdateAutomaticTapeCreationPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAutomaticTapeCreationPolicyInput"}
if v.AutomaticTapeCreationRules == nil {
invalidParams.Add(smithy.NewErrParamRequired("AutomaticTapeCreationRules"))
} else if v.AutomaticTapeCreationRules != nil {
if err := validateAutomaticTapeCreationRules(v.AutomaticTapeCreationRules); err != nil {
invalidParams.AddNested("AutomaticTapeCreationRules", err.(smithy.InvalidParamsError))
}
}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateBandwidthRateLimitInput(v *UpdateBandwidthRateLimitInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateBandwidthRateLimitInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateBandwidthRateLimitScheduleInput(v *UpdateBandwidthRateLimitScheduleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateBandwidthRateLimitScheduleInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.BandwidthRateLimitIntervals == nil {
invalidParams.Add(smithy.NewErrParamRequired("BandwidthRateLimitIntervals"))
} else if v.BandwidthRateLimitIntervals != nil {
if err := validateBandwidthRateLimitIntervals(v.BandwidthRateLimitIntervals); err != nil {
invalidParams.AddNested("BandwidthRateLimitIntervals", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateChapCredentialsInput(v *UpdateChapCredentialsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateChapCredentialsInput"}
if v.TargetARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetARN"))
}
if v.SecretToAuthenticateInitiator == nil {
invalidParams.Add(smithy.NewErrParamRequired("SecretToAuthenticateInitiator"))
}
if v.InitiatorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InitiatorName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateFileSystemAssociationInput(v *UpdateFileSystemAssociationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateFileSystemAssociationInput"}
if v.FileSystemAssociationARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileSystemAssociationARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateGatewayInformationInput(v *UpdateGatewayInformationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateGatewayInformationInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateGatewaySoftwareNowInput(v *UpdateGatewaySoftwareNowInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateGatewaySoftwareNowInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateMaintenanceStartTimeInput(v *UpdateMaintenanceStartTimeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateMaintenanceStartTimeInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.HourOfDay == nil {
invalidParams.Add(smithy.NewErrParamRequired("HourOfDay"))
}
if v.MinuteOfHour == nil {
invalidParams.Add(smithy.NewErrParamRequired("MinuteOfHour"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateNFSFileShareInput(v *UpdateNFSFileShareInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateNFSFileShareInput"}
if v.FileShareARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileShareARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSMBFileShareInput(v *UpdateSMBFileShareInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSMBFileShareInput"}
if v.FileShareARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileShareARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSMBFileShareVisibilityInput(v *UpdateSMBFileShareVisibilityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSMBFileShareVisibilityInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.FileSharesVisible == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileSharesVisible"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSMBLocalGroupsInput(v *UpdateSMBLocalGroupsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSMBLocalGroupsInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if v.SMBLocalGroups == nil {
invalidParams.Add(smithy.NewErrParamRequired("SMBLocalGroups"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSMBSecurityStrategyInput(v *UpdateSMBSecurityStrategyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSMBSecurityStrategyInput"}
if v.GatewayARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayARN"))
}
if len(v.SMBSecurityStrategy) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("SMBSecurityStrategy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSnapshotScheduleInput(v *UpdateSnapshotScheduleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSnapshotScheduleInput"}
if v.VolumeARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeARN"))
}
if v.StartAt == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartAt"))
}
if v.RecurrenceInHours == nil {
invalidParams.Add(smithy.NewErrParamRequired("RecurrenceInHours"))
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateVTLDeviceTypeInput(v *UpdateVTLDeviceTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateVTLDeviceTypeInput"}
if v.VTLDeviceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("VTLDeviceARN"))
}
if v.DeviceType == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeviceType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 3,582 |
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 Storage Gateway 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: "storagegateway.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "storagegateway-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "storagegateway-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "storagegateway.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-4",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "storagegateway-fips.ca-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "ca-central-1-fips",
}: endpoints.Endpoint{
Hostname: "storagegateway-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "fips",
}: endpoints.Endpoint{
Hostname: "storagegateway-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "me-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "storagegateway-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-1-fips",
}: endpoints.Endpoint{
Hostname: "storagegateway-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "storagegateway-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2-fips",
}: endpoints.Endpoint{
Hostname: "storagegateway-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "storagegateway-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1-fips",
}: endpoints.Endpoint{
Hostname: "storagegateway-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "storagegateway-fips.us-west-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2-fips",
}: endpoints.Endpoint{
Hostname: "storagegateway-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "storagegateway.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "storagegateway-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "storagegateway-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "storagegateway.{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: "storagegateway-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "storagegateway.{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: "storagegateway-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "storagegateway.{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: "storagegateway-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "storagegateway.{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: "storagegateway-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "storagegateway.{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: "storagegateway.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "storagegateway-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "storagegateway-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "storagegateway.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips",
}: endpoints.Endpoint{
Hostname: "storagegateway-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: "storagegateway-fips.us-gov-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-east-1-fips",
}: endpoints.Endpoint{
Hostname: "storagegateway-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "storagegateway-fips.us-gov-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1-fips",
}: endpoints.Endpoint{
Hostname: "storagegateway-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
},
},
}
| 519 |
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 ActiveDirectoryStatus string
// Enum values for ActiveDirectoryStatus
const (
ActiveDirectoryStatusAccessDenied ActiveDirectoryStatus = "ACCESS_DENIED"
ActiveDirectoryStatusDetached ActiveDirectoryStatus = "DETACHED"
ActiveDirectoryStatusJoined ActiveDirectoryStatus = "JOINED"
ActiveDirectoryStatusJoining ActiveDirectoryStatus = "JOINING"
ActiveDirectoryStatusNetworkError ActiveDirectoryStatus = "NETWORK_ERROR"
ActiveDirectoryStatusTimeout ActiveDirectoryStatus = "TIMEOUT"
ActiveDirectoryStatusUnknownError ActiveDirectoryStatus = "UNKNOWN_ERROR"
)
// Values returns all known values for ActiveDirectoryStatus. 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 (ActiveDirectoryStatus) Values() []ActiveDirectoryStatus {
return []ActiveDirectoryStatus{
"ACCESS_DENIED",
"DETACHED",
"JOINED",
"JOINING",
"NETWORK_ERROR",
"TIMEOUT",
"UNKNOWN_ERROR",
}
}
type AvailabilityMonitorTestStatus string
// Enum values for AvailabilityMonitorTestStatus
const (
AvailabilityMonitorTestStatusComplete AvailabilityMonitorTestStatus = "COMPLETE"
AvailabilityMonitorTestStatusFailed AvailabilityMonitorTestStatus = "FAILED"
AvailabilityMonitorTestStatusPending AvailabilityMonitorTestStatus = "PENDING"
)
// Values returns all known values for AvailabilityMonitorTestStatus. 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 (AvailabilityMonitorTestStatus) Values() []AvailabilityMonitorTestStatus {
return []AvailabilityMonitorTestStatus{
"COMPLETE",
"FAILED",
"PENDING",
}
}
type CaseSensitivity string
// Enum values for CaseSensitivity
const (
CaseSensitivityClientSpecified CaseSensitivity = "ClientSpecified"
CaseSensitivityCaseSensitive CaseSensitivity = "CaseSensitive"
)
// Values returns all known values for CaseSensitivity. 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 (CaseSensitivity) Values() []CaseSensitivity {
return []CaseSensitivity{
"ClientSpecified",
"CaseSensitive",
}
}
type ErrorCode string
// Enum values for ErrorCode
const (
ErrorCodeActivationKeyExpired ErrorCode = "ActivationKeyExpired"
ErrorCodeActivationKeyInvalid ErrorCode = "ActivationKeyInvalid"
ErrorCodeActivationKeyNotFound ErrorCode = "ActivationKeyNotFound"
ErrorCodeGatewayInternalError ErrorCode = "GatewayInternalError"
ErrorCodeGatewayNotConnected ErrorCode = "GatewayNotConnected"
ErrorCodeGatewayNotFound ErrorCode = "GatewayNotFound"
ErrorCodeGatewayProxyNetworkConnectionBusy ErrorCode = "GatewayProxyNetworkConnectionBusy"
ErrorCodeAuthenticationFailure ErrorCode = "AuthenticationFailure"
ErrorCodeBandwidthThrottleScheduleNotFound ErrorCode = "BandwidthThrottleScheduleNotFound"
ErrorCodeBlocked ErrorCode = "Blocked"
ErrorCodeCannotExportSnapshot ErrorCode = "CannotExportSnapshot"
ErrorCodeChapCredentialNotFound ErrorCode = "ChapCredentialNotFound"
ErrorCodeDiskAlreadyAllocated ErrorCode = "DiskAlreadyAllocated"
ErrorCodeDiskDoesNotExist ErrorCode = "DiskDoesNotExist"
ErrorCodeDiskSizeGreaterThanVolumeMaxSize ErrorCode = "DiskSizeGreaterThanVolumeMaxSize"
ErrorCodeDiskSizeLessThanVolumeSize ErrorCode = "DiskSizeLessThanVolumeSize"
ErrorCodeDiskSizeNotGigAligned ErrorCode = "DiskSizeNotGigAligned"
ErrorCodeDuplicateCertificateInfo ErrorCode = "DuplicateCertificateInfo"
ErrorCodeDuplicateSchedule ErrorCode = "DuplicateSchedule"
ErrorCodeEndpointNotFound ErrorCode = "EndpointNotFound"
ErrorCodeIAMNotSupported ErrorCode = "IAMNotSupported"
ErrorCodeInitiatorInvalid ErrorCode = "InitiatorInvalid"
ErrorCodeInitiatorNotFound ErrorCode = "InitiatorNotFound"
ErrorCodeInternalError ErrorCode = "InternalError"
ErrorCodeInvalidGateway ErrorCode = "InvalidGateway"
ErrorCodeInvalidEndpoint ErrorCode = "InvalidEndpoint"
ErrorCodeInvalidParameters ErrorCode = "InvalidParameters"
ErrorCodeInvalidSchedule ErrorCode = "InvalidSchedule"
ErrorCodeLocalStorageLimitExceeded ErrorCode = "LocalStorageLimitExceeded"
ErrorCodeLunAlreadyAllocated ErrorCode = "LunAlreadyAllocated "
ErrorCodeLunInvalid ErrorCode = "LunInvalid"
ErrorCodeJoinDomainInProgress ErrorCode = "JoinDomainInProgress"
ErrorCodeMaximumContentLengthExceeded ErrorCode = "MaximumContentLengthExceeded"
ErrorCodeMaximumTapeCartridgeCountExceeded ErrorCode = "MaximumTapeCartridgeCountExceeded"
ErrorCodeMaximumVolumeCountExceeded ErrorCode = "MaximumVolumeCountExceeded"
ErrorCodeNetworkConfigurationChanged ErrorCode = "NetworkConfigurationChanged"
ErrorCodeNoDisksAvailable ErrorCode = "NoDisksAvailable"
ErrorCodeNotImplemented ErrorCode = "NotImplemented"
ErrorCodeNotSupported ErrorCode = "NotSupported"
ErrorCodeOperationAborted ErrorCode = "OperationAborted"
ErrorCodeOutdatedGateway ErrorCode = "OutdatedGateway"
ErrorCodeParametersNotImplemented ErrorCode = "ParametersNotImplemented"
ErrorCodeRegionInvalid ErrorCode = "RegionInvalid"
ErrorCodeRequestTimeout ErrorCode = "RequestTimeout"
ErrorCodeServiceUnavailable ErrorCode = "ServiceUnavailable"
ErrorCodeSnapshotDeleted ErrorCode = "SnapshotDeleted"
ErrorCodeSnapshotIdInvalid ErrorCode = "SnapshotIdInvalid"
ErrorCodeSnapshotInProgress ErrorCode = "SnapshotInProgress"
ErrorCodeSnapshotNotFound ErrorCode = "SnapshotNotFound"
ErrorCodeSnapshotScheduleNotFound ErrorCode = "SnapshotScheduleNotFound"
ErrorCodeStagingAreaFull ErrorCode = "StagingAreaFull"
ErrorCodeStorageFailure ErrorCode = "StorageFailure"
ErrorCodeTapeCartridgeNotFound ErrorCode = "TapeCartridgeNotFound"
ErrorCodeTargetAlreadyExists ErrorCode = "TargetAlreadyExists"
ErrorCodeTargetInvalid ErrorCode = "TargetInvalid"
ErrorCodeTargetNotFound ErrorCode = "TargetNotFound"
ErrorCodeUnauthorizedOperation ErrorCode = "UnauthorizedOperation"
ErrorCodeVolumeAlreadyExists ErrorCode = "VolumeAlreadyExists"
ErrorCodeVolumeIdInvalid ErrorCode = "VolumeIdInvalid"
ErrorCodeVolumeInUse ErrorCode = "VolumeInUse"
ErrorCodeVolumeNotFound ErrorCode = "VolumeNotFound"
ErrorCodeVolumeNotReady ErrorCode = "VolumeNotReady"
)
// Values returns all known values for ErrorCode. 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 (ErrorCode) Values() []ErrorCode {
return []ErrorCode{
"ActivationKeyExpired",
"ActivationKeyInvalid",
"ActivationKeyNotFound",
"GatewayInternalError",
"GatewayNotConnected",
"GatewayNotFound",
"GatewayProxyNetworkConnectionBusy",
"AuthenticationFailure",
"BandwidthThrottleScheduleNotFound",
"Blocked",
"CannotExportSnapshot",
"ChapCredentialNotFound",
"DiskAlreadyAllocated",
"DiskDoesNotExist",
"DiskSizeGreaterThanVolumeMaxSize",
"DiskSizeLessThanVolumeSize",
"DiskSizeNotGigAligned",
"DuplicateCertificateInfo",
"DuplicateSchedule",
"EndpointNotFound",
"IAMNotSupported",
"InitiatorInvalid",
"InitiatorNotFound",
"InternalError",
"InvalidGateway",
"InvalidEndpoint",
"InvalidParameters",
"InvalidSchedule",
"LocalStorageLimitExceeded",
"LunAlreadyAllocated ",
"LunInvalid",
"JoinDomainInProgress",
"MaximumContentLengthExceeded",
"MaximumTapeCartridgeCountExceeded",
"MaximumVolumeCountExceeded",
"NetworkConfigurationChanged",
"NoDisksAvailable",
"NotImplemented",
"NotSupported",
"OperationAborted",
"OutdatedGateway",
"ParametersNotImplemented",
"RegionInvalid",
"RequestTimeout",
"ServiceUnavailable",
"SnapshotDeleted",
"SnapshotIdInvalid",
"SnapshotInProgress",
"SnapshotNotFound",
"SnapshotScheduleNotFound",
"StagingAreaFull",
"StorageFailure",
"TapeCartridgeNotFound",
"TargetAlreadyExists",
"TargetInvalid",
"TargetNotFound",
"UnauthorizedOperation",
"VolumeAlreadyExists",
"VolumeIdInvalid",
"VolumeInUse",
"VolumeNotFound",
"VolumeNotReady",
}
}
type FileShareType string
// Enum values for FileShareType
const (
FileShareTypeNfs FileShareType = "NFS"
FileShareTypeSmb FileShareType = "SMB"
)
// Values returns all known values for FileShareType. 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 (FileShareType) Values() []FileShareType {
return []FileShareType{
"NFS",
"SMB",
}
}
type GatewayCapacity string
// Enum values for GatewayCapacity
const (
GatewayCapacitySmall GatewayCapacity = "Small"
GatewayCapacityMedium GatewayCapacity = "Medium"
GatewayCapacityLarge GatewayCapacity = "Large"
)
// Values returns all known values for GatewayCapacity. 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 (GatewayCapacity) Values() []GatewayCapacity {
return []GatewayCapacity{
"Small",
"Medium",
"Large",
}
}
type HostEnvironment string
// Enum values for HostEnvironment
const (
HostEnvironmentVmware HostEnvironment = "VMWARE"
HostEnvironmentHyperV HostEnvironment = "HYPER-V"
HostEnvironmentEc2 HostEnvironment = "EC2"
HostEnvironmentKvm HostEnvironment = "KVM"
HostEnvironmentOther HostEnvironment = "OTHER"
HostEnvironmentSnowball HostEnvironment = "SNOWBALL"
)
// Values returns all known values for HostEnvironment. 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 (HostEnvironment) Values() []HostEnvironment {
return []HostEnvironment{
"VMWARE",
"HYPER-V",
"EC2",
"KVM",
"OTHER",
"SNOWBALL",
}
}
type ObjectACL string
// Enum values for ObjectACL
const (
ObjectACLPrivate ObjectACL = "private"
ObjectACLPublicRead ObjectACL = "public-read"
ObjectACLPublicReadWrite ObjectACL = "public-read-write"
ObjectACLAuthenticatedRead ObjectACL = "authenticated-read"
ObjectACLBucketOwnerRead ObjectACL = "bucket-owner-read"
ObjectACLBucketOwnerFullControl ObjectACL = "bucket-owner-full-control"
ObjectACLAwsExecRead ObjectACL = "aws-exec-read"
)
// Values returns all known values for ObjectACL. 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 (ObjectACL) Values() []ObjectACL {
return []ObjectACL{
"private",
"public-read",
"public-read-write",
"authenticated-read",
"bucket-owner-read",
"bucket-owner-full-control",
"aws-exec-read",
}
}
type PoolStatus string
// Enum values for PoolStatus
const (
PoolStatusActive PoolStatus = "ACTIVE"
PoolStatusDeleted PoolStatus = "DELETED"
)
// Values returns all known values for PoolStatus. 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 (PoolStatus) Values() []PoolStatus {
return []PoolStatus{
"ACTIVE",
"DELETED",
}
}
type RetentionLockType string
// Enum values for RetentionLockType
const (
RetentionLockTypeCompliance RetentionLockType = "COMPLIANCE"
RetentionLockTypeGovernance RetentionLockType = "GOVERNANCE"
RetentionLockTypeNone RetentionLockType = "NONE"
)
// Values returns all known values for RetentionLockType. 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 (RetentionLockType) Values() []RetentionLockType {
return []RetentionLockType{
"COMPLIANCE",
"GOVERNANCE",
"NONE",
}
}
type SMBSecurityStrategy string
// Enum values for SMBSecurityStrategy
const (
SMBSecurityStrategyClientSpecified SMBSecurityStrategy = "ClientSpecified"
SMBSecurityStrategyMandatorySigning SMBSecurityStrategy = "MandatorySigning"
SMBSecurityStrategyMandatoryEncryption SMBSecurityStrategy = "MandatoryEncryption"
)
// Values returns all known values for SMBSecurityStrategy. 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 (SMBSecurityStrategy) Values() []SMBSecurityStrategy {
return []SMBSecurityStrategy{
"ClientSpecified",
"MandatorySigning",
"MandatoryEncryption",
}
}
type TapeStorageClass string
// Enum values for TapeStorageClass
const (
TapeStorageClassDeepArchive TapeStorageClass = "DEEP_ARCHIVE"
TapeStorageClassGlacier TapeStorageClass = "GLACIER"
)
// Values returns all known values for TapeStorageClass. 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 (TapeStorageClass) Values() []TapeStorageClass {
return []TapeStorageClass{
"DEEP_ARCHIVE",
"GLACIER",
}
}
| 377 |
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"
)
// An internal server error has occurred during the request. For more information,
// see the error and message fields.
type InternalServerError struct {
Message *string
ErrorCodeOverride *string
Error_ *StorageGatewayError
noSmithyDocumentSerde
}
func (e *InternalServerError) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerError) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerError) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerError"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// An exception occurred because an invalid gateway request was issued to the
// service. For more information, see the error and message fields.
type InvalidGatewayRequestException struct {
Message *string
ErrorCodeOverride *string
Error_ *StorageGatewayError
noSmithyDocumentSerde
}
func (e *InvalidGatewayRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidGatewayRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidGatewayRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidGatewayRequestException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidGatewayRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// An internal server error has occurred because the service is unavailable. For
// more information, see the error and message fields.
type ServiceUnavailableError struct {
Message *string
ErrorCodeOverride *string
Error_ *StorageGatewayError
noSmithyDocumentSerde
}
func (e *ServiceUnavailableError) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceUnavailableError) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceUnavailableError) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceUnavailableError"
}
return *e.ErrorCodeOverride
}
func (e *ServiceUnavailableError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
| 96 |
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 gateway's automatic tape creation policies, including the
// automatic tape creation rules and the gateway that is using the policies.
type AutomaticTapeCreationPolicyInfo struct {
// An automatic tape creation policy consists of a list of automatic tape creation
// rules. This returns the rules that determine when and how to automatically
// create new tapes.
AutomaticTapeCreationRules []AutomaticTapeCreationRule
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
noSmithyDocumentSerde
}
// An automatic tape creation policy consists of automatic tape creation rules
// where each rule defines when and how to create new tapes. For more information
// about automatic tape creation, see Creating Tapes Automatically (https://docs.aws.amazon.com/storagegateway/latest/userguide/GettingStartedCreateTapes.html#CreateTapesAutomatically)
// .
type AutomaticTapeCreationRule struct {
// The minimum number of available virtual tapes that the gateway maintains at all
// times. If the number of tapes on the gateway goes below this value, the gateway
// creates as many new tapes as are needed to have MinimumNumTapes on the gateway.
// For more information about automatic tape creation, see Creating Tapes
// Automatically (https://docs.aws.amazon.com/storagegateway/latest/userguide/GettingStartedCreateTapes.html#CreateTapesAutomatically)
// .
//
// This member is required.
MinimumNumTapes *int32
// The ID of the pool that you want to add your tape to for archiving. The tape in
// this pool is archived in the Amazon S3 storage class that is associated with the
// pool. When you use your backup application to eject the tape, the tape is
// archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive)
// that corresponds to the pool.
//
// This member is required.
PoolId *string
// A prefix that you append to the barcode of the virtual tape that you are
// creating. This prefix makes the barcode unique. The prefix must be 1-4
// characters in length and must be one of the uppercase letters from A to Z.
//
// This member is required.
TapeBarcodePrefix *string
// The size, in bytes, of the virtual tape capacity.
//
// This member is required.
TapeSizeInBytes *int64
// Set to true to indicate that tapes are to be archived as write-once-read-many
// (WORM). Set to false when WORM is not enabled for tapes.
Worm bool
noSmithyDocumentSerde
}
// Describes a bandwidth rate limit interval for a gateway. A bandwidth rate limit
// schedule consists of one or more bandwidth rate limit intervals. A bandwidth
// rate limit interval defines a period of time on one or more days of the week,
// during which bandwidth rate limits are specified for uploading, downloading, or
// both.
type BandwidthRateLimitInterval struct {
// The days of the week component of the bandwidth rate limit interval,
// represented as ordinal numbers from 0 to 6, where 0 represents Sunday and 6
// represents Saturday.
//
// This member is required.
DaysOfWeek []int32
// The hour of the day to end the bandwidth rate limit interval.
//
// This member is required.
EndHourOfDay *int32
// The minute of the hour to end the bandwidth rate limit interval. The bandwidth
// rate limit interval ends at the end of the minute. To end an interval at the end
// of an hour, use the value 59 .
//
// This member is required.
EndMinuteOfHour *int32
// The hour of the day to start the bandwidth rate limit interval.
//
// This member is required.
StartHourOfDay *int32
// The minute of the hour to start the bandwidth rate limit interval. The interval
// begins at the start of that minute. To begin an interval exactly at the start of
// the hour, use the value 0 .
//
// This member is required.
StartMinuteOfHour *int32
// The average download rate limit component of the bandwidth rate limit interval,
// in bits per second. This field does not appear in the response if the download
// rate limit is not set.
AverageDownloadRateLimitInBitsPerSec *int64
// The average upload rate limit component of the bandwidth rate limit interval,
// in bits per second. This field does not appear in the response if the upload
// rate limit is not set.
AverageUploadRateLimitInBitsPerSec *int64
noSmithyDocumentSerde
}
// The refresh cache information for the file share or FSx file systems.
type CacheAttributes struct {
// Refreshes a file share's cache by using Time To Live (TTL). TTL is the length
// of time since the last refresh after which access to the directory would cause
// the file gateway to first refresh that directory's contents from the Amazon S3
// bucket or Amazon FSx file system. The TTL duration is in seconds. Valid
// Values:0, 300 to 2,592,000 seconds (5 minutes to 30 days)
CacheStaleTimeoutInSeconds *int32
noSmithyDocumentSerde
}
// Describes an iSCSI cached volume.
type CachediSCSIVolume struct {
// The date the volume was created. Volumes created prior to March 28, 2017 don’t
// have this timestamp.
CreatedDate *time.Time
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// If the cached volume was created from a snapshot, this field contains the
// snapshot ID used, e.g., snap-78e22663. Otherwise, this field is not included.
SourceSnapshotId *string
// The name of the iSCSI target used by an initiator to connect to a volume and
// used as a suffix for the target ARN. For example, specifying TargetName as
// myvolume results in the target ARN of
// arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume
// . The target name must be unique across all volumes on a gateway. If you don't
// specify a value, Storage Gateway uses the value that was previously used for
// this volume as the new target name.
TargetName *string
// The Amazon Resource Name (ARN) of the storage volume.
VolumeARN *string
// A value that indicates whether a storage volume is attached to or detached from
// a gateway. For more information, see Moving your volumes to a different gateway (https://docs.aws.amazon.com/storagegateway/latest/userguide/managing-volumes.html#attach-detach-volume)
// .
VolumeAttachmentStatus *string
// The unique identifier of the volume, e.g., vol-AE4B946D.
VolumeId *string
// Represents the percentage complete if the volume is restoring or bootstrapping
// that represents the percent of data transferred. This field does not appear in
// the response if the cached volume is not restoring or bootstrapping.
VolumeProgress *float64
// The size, in bytes, of the volume capacity.
VolumeSizeInBytes int64
// One of the VolumeStatus values that indicates the state of the storage volume.
VolumeStatus *string
// One of the VolumeType enumeration values that describes the type of the volume.
VolumeType *string
// The size of the data stored on the volume in bytes. This value is calculated
// based on the number of blocks that are touched, instead of the actual amount of
// data written. This value can be useful for sequential write patterns but less
// accurate for random write patterns. VolumeUsedInBytes is different from the
// compressed size of the volume, which is the value that is used to calculate your
// bill. This value is not available for volumes created prior to May 13, 2015,
// until you store data on the volume. If you use a delete tool that overwrites the
// data on your volume with random data, your usage will not be reduced. This is
// because the random data is not compressible. If you want to reduce the amount of
// billed storage on your volume, we recommend overwriting your files with zeros to
// compress the data to a negligible amount of actual storage.
VolumeUsedInBytes *int64
// An VolumeiSCSIAttributes object that represents a collection of iSCSI
// attributes for one stored volume.
VolumeiSCSIAttributes *VolumeiSCSIAttributes
noSmithyDocumentSerde
}
// Describes Challenge-Handshake Authentication Protocol (CHAP) information that
// supports authentication between your gateway and iSCSI initiators.
type ChapInfo struct {
// The iSCSI initiator that connects to the target.
InitiatorName *string
// The secret key that the initiator (for example, the Windows client) must
// provide to participate in mutual CHAP with the target.
SecretToAuthenticateInitiator *string
// The secret key that the target must provide to participate in mutual CHAP with
// the initiator (e.g., Windows client).
SecretToAuthenticateTarget *string
// The Amazon Resource Name (ARN) of the volume. Valid Values: 50 to 500 lowercase
// letters, numbers, periods (.), and hyphens (-).
TargetARN *string
noSmithyDocumentSerde
}
// Lists iSCSI information about a VTL device.
type DeviceiSCSIAttributes struct {
// Indicates whether mutual CHAP is enabled for the iSCSI target.
ChapEnabled bool
// The network interface identifier of the VTL device.
NetworkInterfaceId *string
// The port used to communicate with iSCSI VTL device targets.
NetworkInterfacePort int32
// Specifies the unique Amazon Resource Name (ARN) that encodes the iSCSI
// qualified name(iqn) of a tape drive or media changer target.
TargetARN *string
noSmithyDocumentSerde
}
// Represents a gateway's local disk.
type Disk struct {
// The iSCSI qualified name (IQN) that is defined for a disk. This field is not
// included in the response if the local disk is not defined as an iSCSI target.
// The format of this field is targetIqn::LUNNumber::region-volumeId.
DiskAllocationResource *string
// One of the DiskAllocationType enumeration values that identifies how a local
// disk is used. Valid Values: UPLOAD_BUFFER | CACHE_STORAGE
DiskAllocationType *string
// A list of values that represents attributes of a local disk.
DiskAttributeList []string
// The unique device ID or other distinguishing data that identifies a local disk.
DiskId *string
// The device node of a local disk as assigned by the virtualization environment.
DiskNode *string
// The path of a local disk in the gateway virtual machine (VM).
DiskPath *string
// The local disk size in bytes.
DiskSizeInBytes int64
// A value that represents the status of a local disk.
DiskStatus *string
noSmithyDocumentSerde
}
// Specifies network configuration information for the gateway associated with the
// Amazon FSx file system.
type EndpointNetworkConfiguration struct {
// A list of gateway IP addresses on which the associated Amazon FSx file system
// is available. If multiple file systems are associated with this gateway, this
// field is required.
IpAddresses []string
noSmithyDocumentSerde
}
// Describes a file share. Only supported S3 File Gateway.
type FileShareInfo struct {
// The Amazon Resource Name (ARN) of the file share.
FileShareARN *string
// The ID of the file share.
FileShareId *string
// The status of the file share. Valid Values: CREATING | UPDATING | AVAILABLE |
// DELETING
FileShareStatus *string
// The type of the file share.
FileShareType FileShareType
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
noSmithyDocumentSerde
}
// Describes the object returned by DescribeFileSystemAssociations that describes
// a created file system association.
type FileSystemAssociationInfo struct {
// The Amazon Resource Name (ARN) of the storage used for the audit logs.
AuditDestinationARN *string
// The refresh cache information for the file share or FSx file systems.
CacheAttributes *CacheAttributes
// Specifies network configuration information for the gateway associated with the
// Amazon FSx file system. If multiple file systems are associated with this
// gateway, this parameter's IpAddresses field is required.
EndpointNetworkConfiguration *EndpointNetworkConfiguration
// The Amazon Resource Name (ARN) of the file system association.
FileSystemAssociationARN *string
// The status of the file system association. Valid Values: AVAILABLE | CREATING |
// DELETING | FORCE_DELETING | UPDATING | ERROR
FileSystemAssociationStatus *string
// An array containing the FileSystemAssociationStatusDetail data type, which
// provides detailed information on file system association status.
FileSystemAssociationStatusDetails []FileSystemAssociationStatusDetail
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The ARN of the backend Amazon FSx file system used for storing file data. For
// information, see FileSystem (https://docs.aws.amazon.com/fsx/latest/APIReference/API_FileSystem.html)
// in the Amazon FSx API Reference.
LocationARN *string
// A list of up to 50 tags assigned to the SMB file share, sorted alphabetically
// by key name. Each tag is a key-value pair.
Tags []Tag
noSmithyDocumentSerde
}
// Detailed information on file system association status.
type FileSystemAssociationStatusDetail struct {
// The error code for a given file system association status.
ErrorCode *string
noSmithyDocumentSerde
}
// Gets the summary returned by ListFileSystemAssociation , which is a summary of a
// created file system association.
type FileSystemAssociationSummary struct {
// The Amazon Resource Name (ARN) of the file system association.
FileSystemAssociationARN *string
// The ID of the file system association.
FileSystemAssociationId *string
// The status of the file share. Valid Values: AVAILABLE | CREATING | DELETING |
// FORCE_DELETING | UPDATING | ERROR
FileSystemAssociationStatus *string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
noSmithyDocumentSerde
}
// Describes a gateway object.
type GatewayInfo struct {
// The ID of the Amazon EC2 instance that was used to launch the gateway.
Ec2InstanceId *string
// The Amazon Web Services Region where the Amazon EC2 instance is located.
Ec2InstanceRegion *string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The unique identifier assigned to your gateway during activation. This ID
// becomes part of the gateway Amazon Resource Name (ARN), which you use as input
// for other operations.
GatewayId *string
// The name of the gateway.
GatewayName *string
// The state of the gateway. Valid Values: DISABLED | ACTIVE
GatewayOperationalState *string
// The type of the gateway.
GatewayType *string
// The type of hardware or software platform on which the gateway is running.
HostEnvironment HostEnvironment
// A unique identifier for the specific instance of the host platform running the
// gateway. This value is only available for certain host environments, and its
// format depends on the host environment type.
HostEnvironmentId *string
noSmithyDocumentSerde
}
// Describes a gateway's network interface.
type NetworkInterface struct {
// The Internet Protocol version 4 (IPv4) address of the interface.
Ipv4Address *string
// The Internet Protocol version 6 (IPv6) address of the interface. Currently not
// supported.
Ipv6Address *string
// The Media Access Control (MAC) address of the interface. This is currently
// unsupported and will not be returned in output.
MacAddress *string
noSmithyDocumentSerde
}
// Describes Network File System (NFS) file share default values. Files and
// folders stored as Amazon S3 objects in S3 buckets don't, by default, have Unix
// file permissions assigned to them. Upon discovery in an S3 bucket by Storage
// Gateway, the S3 objects that represent files and folders are assigned these
// default Unix permissions. This operation is only supported for S3 File Gateways.
type NFSFileShareDefaults struct {
// The Unix directory mode in the form "nnnn". For example, 0666 represents the
// default access mode for all directories inside the file share. The default value
// is 0777 .
DirectoryMode *string
// The Unix file mode in the form "nnnn". For example, 0666 represents the default
// file mode inside the file share. The default value is 0666 .
FileMode *string
// The default group ID for the file share (unless the files have another group ID
// specified). The default value is nfsnobody .
GroupId *int64
// The default owner ID for files in the file share (unless the files have another
// owner ID specified). The default value is nfsnobody .
OwnerId *int64
noSmithyDocumentSerde
}
// The Unix file permissions and ownership information assigned, by default, to
// native S3 objects when an S3 File Gateway discovers them in S3 buckets. This
// operation is only supported in S3 File Gateways.
type NFSFileShareInfo struct {
// The Amazon Resource Name (ARN) of the storage used for audit logs.
AuditDestinationARN *string
// Specifies the Region of the S3 bucket where the NFS file share stores files.
// This parameter is required for NFS file shares that connect to Amazon S3 through
// a VPC endpoint, a VPC access point, or an access point alias that points to a
// VPC access point.
BucketRegion *string
// Refresh cache information for the file share.
CacheAttributes *CacheAttributes
// The list of clients that are allowed to access the S3 File Gateway. The list
// must contain either valid IP addresses or valid CIDR blocks.
ClientList []string
// The default storage class for objects put into an Amazon S3 bucket by the S3
// File Gateway. The default value is S3_STANDARD . Optional. Valid Values:
// S3_STANDARD | S3_INTELLIGENT_TIERING | S3_STANDARD_IA | S3_ONEZONE_IA
DefaultStorageClass *string
// The Amazon Resource Name (ARN) of the file share.
FileShareARN *string
// The ID of the file share.
FileShareId *string
// The name of the file share. Optional. FileShareName must be set if an S3 prefix
// name is set in LocationARN , or if an access point or access point alias is used.
FileShareName *string
// The status of the file share. Valid Values: CREATING | UPDATING | AVAILABLE |
// DELETING
FileShareStatus *string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// A value that enables guessing of the MIME type for uploaded objects based on
// file extensions. Set this value to true to enable MIME type guessing, otherwise
// set to false . The default value is true . Valid Values: true | false
GuessMIMETypeEnabled *bool
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// A custom ARN for the backend storage used for storing data for file shares. It
// includes a resource ARN with an optional prefix concatenation. The prefix must
// end with a forward slash (/). You can specify LocationARN as a bucket ARN,
// access point ARN or access point alias, as shown in the following examples.
// Bucket ARN: arn:aws:s3:::my-bucket/prefix/ Access point ARN:
// arn:aws:s3:region:account-id:accesspoint/access-point-name/prefix/ If you
// specify an access point, the bucket policy must be configured to delegate access
// control to the access point. For information, see Delegating access control to
// access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-policies.html#access-points-delegating-control)
// in the Amazon S3 User Guide. Access point alias:
// test-ap-ab123cdef4gehijklmn5opqrstuvuse1a-s3alias
LocationARN *string
// Describes Network File System (NFS) file share default values. Files and
// folders stored as Amazon S3 objects in S3 buckets don't, by default, have Unix
// file permissions assigned to them. Upon discovery in an S3 bucket by Storage
// Gateway, the S3 objects that represent files and folders are assigned these
// default Unix permissions. This operation is only supported for S3 File Gateways.
NFSFileShareDefaults *NFSFileShareDefaults
// The notification policy of the file share. SettlingTimeInSeconds controls the
// number of seconds to wait after the last point in time a client wrote to a file
// before generating an ObjectUploaded notification. Because clients can make many
// small writes to files, it's best to set this parameter for as long as possible
// to avoid generating multiple notifications for the same file in a small time
// period. SettlingTimeInSeconds has no effect on the timing of the object
// uploading to Amazon S3, only the timing of the notification. The following
// example sets NotificationPolicy on with SettlingTimeInSeconds set to 60.
// {"Upload": {"SettlingTimeInSeconds": 60}} The following example sets
// NotificationPolicy off. {}
NotificationPolicy *string
// A value that sets the access control list (ACL) permission for objects in the
// S3 bucket that an S3 File Gateway puts objects into. The default value is
// private .
ObjectACL ObjectACL
// The file share path used by the NFS client to identify the mount point.
Path *string
// A value that sets the write status of a file share. Set this value to true to
// set the write status to read-only, otherwise set to false . Valid Values: true
// | false
ReadOnly *bool
// A value that sets who pays the cost of the request and the cost associated with
// data download from the S3 bucket. If this value is set to true , the requester
// pays the costs; otherwise, the S3 bucket owner pays. However, the S3 bucket
// owner always pays the cost of storing data. RequesterPays is a configuration
// for the S3 bucket that backs the file share, so make sure that the configuration
// on the file share is the same as the S3 bucket configuration. Valid Values: true
// | false
RequesterPays *bool
// The ARN of the IAM role that an S3 File Gateway assumes when it accesses the
// underlying storage.
Role *string
// The user mapped to anonymous user. Valid options are the following:
// - RootSquash : Only root is mapped to anonymous user.
// - NoSquash : No one is mapped to anonymous user.
// - AllSquash : Everyone is mapped to anonymous user.
Squash *string
// A list of up to 50 tags assigned to the NFS file share, sorted alphabetically
// by key name. Each tag is a key-value pair. For a gateway with more than 10 tags
// assigned, you can view all tags using the ListTagsForResource API operation.
Tags []Tag
// Specifies the DNS name for the VPC endpoint that the NFS file share uses to
// connect to Amazon S3. This parameter is required for NFS file shares that
// connect to Amazon S3 through a VPC endpoint, a VPC access point, or an access
// point alias that points to a VPC access point.
VPCEndpointDNSName *string
noSmithyDocumentSerde
}
// Describes a custom tape pool.
type PoolInfo struct {
// The Amazon Resource Name (ARN) of the custom tape pool. Use the ListTapePools
// operation to return a list of custom tape pools for your account and Amazon Web
// Services Region.
PoolARN *string
// The name of the custom tape pool. PoolName can use all ASCII characters, except
// '/' and '\'.
PoolName *string
// Status of the custom tape pool. Pool can be ACTIVE or DELETED .
PoolStatus PoolStatus
// Tape retention lock time is set in days. Tape retention lock can be enabled for
// up to 100 years (36,500 days).
RetentionLockTimeInDays *int32
// Tape retention lock type, which can be configured in two modes. When configured
// in governance mode, Amazon Web Services accounts with specific IAM permissions
// are authorized to remove the tape retention lock from archived virtual tapes.
// When configured in compliance mode, the tape retention lock cannot be removed by
// any user, including the root Amazon Web Services account.
RetentionLockType RetentionLockType
// The storage class that is associated with the custom pool. When you use your
// backup application to eject the tape, the tape is archived directly into the
// storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the
// pool.
StorageClass TapeStorageClass
noSmithyDocumentSerde
}
// The Windows file permissions and ownership information assigned, by default, to
// native S3 objects when S3 File Gateway discovers them in S3 buckets. This
// operation is only supported for S3 File Gateways.
type SMBFileShareInfo struct {
// Indicates whether AccessBasedEnumeration is enabled.
AccessBasedEnumeration *bool
// A list of users or groups in the Active Directory that have administrator
// rights to the file share. A group must be prefixed with the @ character.
// Acceptable formats include: DOMAIN\User1 , user1 , @group1 , and @DOMAIN\group1
// . Can only be set if Authentication is set to ActiveDirectory .
AdminUserList []string
// The Amazon Resource Name (ARN) of the storage used for audit logs.
AuditDestinationARN *string
// The authentication method of the file share. The default is ActiveDirectory .
// Valid Values: ActiveDirectory | GuestAccess
Authentication *string
// Specifies the Region of the S3 bucket where the SMB file share stores files.
// This parameter is required for SMB file shares that connect to Amazon S3 through
// a VPC endpoint, a VPC access point, or an access point alias that points to a
// VPC access point.
BucketRegion *string
// Refresh cache information for the file share.
CacheAttributes *CacheAttributes
// The case of an object name in an Amazon S3 bucket. For ClientSpecified , the
// client determines the case sensitivity. For CaseSensitive , the gateway
// determines the case sensitivity. The default value is ClientSpecified .
CaseSensitivity CaseSensitivity
// The default storage class for objects put into an Amazon S3 bucket by the S3
// File Gateway. The default value is S3_STANDARD . Optional. Valid Values:
// S3_STANDARD | S3_INTELLIGENT_TIERING | S3_STANDARD_IA | S3_ONEZONE_IA
DefaultStorageClass *string
// The Amazon Resource Name (ARN) of the file share.
FileShareARN *string
// The ID of the file share.
FileShareId *string
// The name of the file share. Optional. FileShareName must be set if an S3 prefix
// name is set in LocationARN , or if an access point or access point alias is used.
FileShareName *string
// The status of the file share. Valid Values: CREATING | UPDATING | AVAILABLE |
// DELETING
FileShareStatus *string
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// A value that enables guessing of the MIME type for uploaded objects based on
// file extensions. Set this value to true to enable MIME type guessing, otherwise
// set to false . The default value is true . Valid Values: true | false
GuessMIMETypeEnabled *bool
// A list of users or groups in the Active Directory that are not allowed to
// access the file share. A group must be prefixed with the @ character. Acceptable
// formats include: DOMAIN\User1 , user1 , @group1 , and @DOMAIN\group1 . Can only
// be set if Authentication is set to ActiveDirectory .
InvalidUserList []string
// Set to true to use Amazon S3 server-side encryption with your own KMS key, or
// false to use a key managed by Amazon S3. Optional. Valid Values: true | false
KMSEncrypted bool
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// A custom ARN for the backend storage used for storing data for file shares. It
// includes a resource ARN with an optional prefix concatenation. The prefix must
// end with a forward slash (/). You can specify LocationARN as a bucket ARN,
// access point ARN or access point alias, as shown in the following examples.
// Bucket ARN: arn:aws:s3:::my-bucket/prefix/ Access point ARN:
// arn:aws:s3:region:account-id:accesspoint/access-point-name/prefix/ If you
// specify an access point, the bucket policy must be configured to delegate access
// control to the access point. For information, see Delegating access control to
// access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-policies.html#access-points-delegating-control)
// in the Amazon S3 User Guide. Access point alias:
// test-ap-ab123cdef4gehijklmn5opqrstuvuse1a-s3alias
LocationARN *string
// The notification policy of the file share. SettlingTimeInSeconds controls the
// number of seconds to wait after the last point in time a client wrote to a file
// before generating an ObjectUploaded notification. Because clients can make many
// small writes to files, it's best to set this parameter for as long as possible
// to avoid generating multiple notifications for the same file in a small time
// period. SettlingTimeInSeconds has no effect on the timing of the object
// uploading to Amazon S3, only the timing of the notification. The following
// example sets NotificationPolicy on with SettlingTimeInSeconds set to 60.
// {"Upload": {"SettlingTimeInSeconds": 60}} The following example sets
// NotificationPolicy off. {}
NotificationPolicy *string
// A value that sets the access control list (ACL) permission for objects in the
// S3 bucket that an S3 File Gateway puts objects into. The default value is
// private .
ObjectACL ObjectACL
// Specifies whether opportunistic locking is enabled for the SMB file share.
// Enabling opportunistic locking on case-sensitive shares is not recommended for
// workloads that involve access to files with the same name in different case.
// Valid Values: true | false
OplocksEnabled *bool
// The file share path used by the SMB client to identify the mount point.
Path *string
// A value that sets the write status of a file share. Set this value to true to
// set the write status to read-only, otherwise set to false . Valid Values: true
// | false
ReadOnly *bool
// A value that sets who pays the cost of the request and the cost associated with
// data download from the S3 bucket. If this value is set to true , the requester
// pays the costs; otherwise, the S3 bucket owner pays. However, the S3 bucket
// owner always pays the cost of storing data. RequesterPays is a configuration
// for the S3 bucket that backs the file share, so make sure that the configuration
// on the file share is the same as the S3 bucket configuration. Valid Values: true
// | false
RequesterPays *bool
// The ARN of the IAM role that an S3 File Gateway assumes when it accesses the
// underlying storage.
Role *string
// If this value is set to true , it indicates that access control list (ACL) is
// enabled on the SMB file share. If it is set to false , it indicates that file
// and directory permissions are mapped to the POSIX permission. For more
// information, see Using Microsoft Windows ACLs to control access to an SMB file
// share (https://docs.aws.amazon.com/storagegateway/latest/userguide/smb-acl.html)
// in the Storage Gateway User Guide.
SMBACLEnabled *bool
// A list of up to 50 tags assigned to the SMB file share, sorted alphabetically
// by key name. Each tag is a key-value pair. For a gateway with more than 10 tags
// assigned, you can view all tags using the ListTagsForResource API operation.
Tags []Tag
// Specifies the DNS name for the VPC endpoint that the SMB file share uses to
// connect to Amazon S3. This parameter is required for SMB file shares that
// connect to Amazon S3 through a VPC endpoint, a VPC access point, or an access
// point alias that points to a VPC access point.
VPCEndpointDNSName *string
// A list of users or groups in the Active Directory that are allowed to access
// the file share. A group must be prefixed with the @ character. Acceptable
// formats include: DOMAIN\User1 , user1 , @group1 , and @DOMAIN\group1 . Can only
// be set if Authentication is set to ActiveDirectory .
ValidUserList []string
noSmithyDocumentSerde
}
// A list of Active Directory users and groups that have special permissions for
// SMB file shares on the gateway.
type SMBLocalGroups struct {
// A list of Active Directory users and groups that have local Gateway Admin
// permissions. Acceptable formats include: DOMAIN\User1 , user1 , DOMAIN\group1 ,
// and group1 . Gateway Admins can use the Shared Folders Microsoft Management
// Console snap-in to force-close files that are open and locked.
GatewayAdmins []string
noSmithyDocumentSerde
}
// Provides additional information about an error that was returned by the
// service. See the errorCode and errorDetails members for more information about
// the error.
type StorageGatewayError struct {
// Additional information about the error.
ErrorCode ErrorCode
// Human-readable text that provides detail about the error that occurred.
ErrorDetails map[string]string
noSmithyDocumentSerde
}
// Describes an iSCSI stored volume.
type StorediSCSIVolume struct {
// The date the volume was created. Volumes created prior to March 28, 2017 don’t
// have this timestamp.
CreatedDate *time.Time
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// Indicates if when the stored volume was created, existing data on the
// underlying local disk was preserved. Valid Values: true | false
PreservedExistingData bool
// If the stored volume was created from a snapshot, this field contains the
// snapshot ID used, e.g. snap-78e22663. Otherwise, this field is not included.
SourceSnapshotId *string
// The name of the iSCSI target used by an initiator to connect to a volume and
// used as a suffix for the target ARN. For example, specifying TargetName as
// myvolume results in the target ARN of
// arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume
// . The target name must be unique across all volumes on a gateway. If you don't
// specify a value, Storage Gateway uses the value that was previously used for
// this volume as the new target name.
TargetName *string
// The Amazon Resource Name (ARN) of the storage volume.
VolumeARN *string
// A value that indicates whether a storage volume is attached to, detached from,
// or is in the process of detaching from a gateway. For more information, see
// Moving your volumes to a different gateway (https://docs.aws.amazon.com/storagegateway/latest/userguide/managing-volumes.html#attach-detach-volume)
// .
VolumeAttachmentStatus *string
// The ID of the local disk that was specified in the CreateStorediSCSIVolume
// operation.
VolumeDiskId *string
// The unique identifier of the volume, e.g., vol-AE4B946D.
VolumeId *string
// Represents the percentage complete if the volume is restoring or bootstrapping
// that represents the percent of data transferred. This field does not appear in
// the response if the stored volume is not restoring or bootstrapping.
VolumeProgress *float64
// The size of the volume in bytes.
VolumeSizeInBytes int64
// One of the VolumeStatus values that indicates the state of the storage volume.
VolumeStatus *string
// One of the VolumeType enumeration values describing the type of the volume.
VolumeType *string
// The size of the data stored on the volume in bytes. This value is calculated
// based on the number of blocks that are touched, instead of the actual amount of
// data written. This value can be useful for sequential write patterns but less
// accurate for random write patterns. VolumeUsedInBytes is different from the
// compressed size of the volume, which is the value that is used to calculate your
// bill. This value is not available for volumes created prior to May 13, 2015,
// until you store data on the volume.
VolumeUsedInBytes *int64
// An VolumeiSCSIAttributes object that represents a collection of iSCSI
// attributes for one stored volume.
VolumeiSCSIAttributes *VolumeiSCSIAttributes
noSmithyDocumentSerde
}
// A key-value pair that helps you manage, filter, and search for your resource.
// Allowed characters: letters, white space, and numbers, representable in UTF-8,
// and the following characters: + - = . _ : /.
type Tag struct {
// Tag key. The key can't start with aws:.
//
// This member is required.
Key *string
// Value of the tag key.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// Describes a virtual tape object.
type Tape struct {
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// The date that the tape enters a custom tape pool.
PoolEntryDate *time.Time
// The ID of the pool that contains tapes that will be archived. The tapes in this
// pool are archived in the S3 storage class that is associated with the pool. When
// you use your backup application to eject the tape, the tape is archived directly
// into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds
// to the pool.
PoolId *string
// For archiving virtual tapes, indicates how much data remains to be uploaded
// before archiving is complete. Range: 0 (not started) to 100 (complete).
Progress *float64
// The date that the tape is first archived with tape retention lock enabled.
RetentionStartDate *time.Time
// The Amazon Resource Name (ARN) of the virtual tape.
TapeARN *string
// The barcode that identifies a specific virtual tape.
TapeBarcode *string
// The date the virtual tape was created.
TapeCreatedDate *time.Time
// The size, in bytes, of the virtual tape capacity.
TapeSizeInBytes *int64
// The current state of the virtual tape.
TapeStatus *string
// The size, in bytes, of data stored on the virtual tape. This value is not
// available for tapes created prior to May 13, 2015.
TapeUsedInBytes *int64
// The virtual tape library (VTL) device that the virtual tape is associated with.
VTLDevice *string
// If the tape is archived as write-once-read-many (WORM), this value is true .
Worm bool
noSmithyDocumentSerde
}
// Represents a virtual tape that is archived in the virtual tape shelf (VTS).
type TapeArchive struct {
// The time that the archiving of the virtual tape was completed. The default
// timestamp format is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
CompletionTime *time.Time
// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used
// for Amazon S3 server-side encryption. Storage Gateway does not support
// asymmetric CMKs. This value can only be set when KMSEncrypted is true . Optional.
KMSKey *string
// The time that the tape entered the custom tape pool. The default timestamp
// format is in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
PoolEntryDate *time.Time
// The ID of the pool that was used to archive the tape. The tapes in this pool
// are archived in the S3 storage class that is associated with the pool.
PoolId *string
// If the archived tape is subject to tape retention lock, the date that the
// archived tape started being retained.
RetentionStartDate *time.Time
// The Amazon Resource Name (ARN) of the tape gateway that the virtual tape is
// being retrieved to. The virtual tape is retrieved from the virtual tape shelf
// (VTS).
RetrievedTo *string
// The Amazon Resource Name (ARN) of an archived virtual tape.
TapeARN *string
// The barcode that identifies the archived virtual tape.
TapeBarcode *string
// The date the virtual tape was created.
TapeCreatedDate *time.Time
// The size, in bytes, of the archived virtual tape.
TapeSizeInBytes *int64
// The current state of the archived virtual tape.
TapeStatus *string
// The size, in bytes, of data stored on the virtual tape. This value is not
// available for tapes created prior to May 13, 2015.
TapeUsedInBytes *int64
// Set to true if the archived tape is stored as write-once-read-many (WORM).
Worm bool
noSmithyDocumentSerde
}
// Describes a virtual tape.
type TapeInfo struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The date that the tape entered the custom tape pool with tape retention lock
// enabled.
PoolEntryDate *time.Time
// The ID of the pool that you want to add your tape to for archiving. The tape in
// this pool is archived in the S3 storage class that is associated with the pool.
// When you use your backup application to eject the tape, the tape is archived
// directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that
// corresponds to the pool.
PoolId *string
// The date that the tape became subject to tape retention lock.
RetentionStartDate *time.Time
// The Amazon Resource Name (ARN) of a virtual tape.
TapeARN *string
// The barcode that identifies a specific virtual tape.
TapeBarcode *string
// The size, in bytes, of a virtual tape.
TapeSizeInBytes *int64
// The status of the tape.
TapeStatus *string
noSmithyDocumentSerde
}
// Describes a recovery point.
type TapeRecoveryPointInfo struct {
// The Amazon Resource Name (ARN) of the virtual tape.
TapeARN *string
// The time when the point-in-time view of the virtual tape was replicated for
// later recovery. The default timestamp format of the tape recovery point time is
// in the ISO8601 extended YYYY-MM-DD'T'HH:MM:SS'Z' format.
TapeRecoveryPointTime *time.Time
// The size, in bytes, of the virtual tapes to recover.
TapeSizeInBytes *int64
// The status of the virtual tapes.
TapeStatus *string
noSmithyDocumentSerde
}
// Describes a storage volume object.
type VolumeInfo struct {
// The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation
// to return a list of gateways for your account and Amazon Web Services Region.
GatewayARN *string
// The unique identifier assigned to your gateway during activation. This ID
// becomes part of the gateway Amazon Resource Name (ARN), which you use as input
// for other operations. Valid Values: 50 to 500 lowercase letters, numbers,
// periods (.), and hyphens (-).
GatewayId *string
// The Amazon Resource Name (ARN) for the storage volume. For example, the
// following is a valid ARN:
// arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABB
// Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and hyphens
// (-).
VolumeARN *string
// One of the VolumeStatus values that indicates the state of the storage volume.
VolumeAttachmentStatus *string
// The unique identifier assigned to the volume. This ID becomes part of the
// volume Amazon Resource Name (ARN), which you use as input for other operations.
// Valid Values: 50 to 500 lowercase letters, numbers, periods (.), and hyphens
// (-).
VolumeId *string
// The size of the volume in bytes. Valid Values: 50 to 500 lowercase letters,
// numbers, periods (.), and hyphens (-).
VolumeSizeInBytes int64
// One of the VolumeType enumeration values describing the type of the volume.
VolumeType *string
noSmithyDocumentSerde
}
// Lists iSCSI information about a volume.
type VolumeiSCSIAttributes struct {
// Indicates whether mutual CHAP is enabled for the iSCSI target.
ChapEnabled bool
// The logical disk number.
LunNumber *int32
// The network interface identifier.
NetworkInterfaceId *string
// The port used to communicate with iSCSI targets.
NetworkInterfacePort int32
// The Amazon Resource Name (ARN) of the volume target.
TargetARN *string
noSmithyDocumentSerde
}
// Describes a storage volume recovery point object.
type VolumeRecoveryPointInfo struct {
// The Amazon Resource Name (ARN) of the volume target.
VolumeARN *string
// The time the recovery point was taken.
VolumeRecoveryPointTime *string
// The size of the volume in bytes.
VolumeSizeInBytes int64
// The size of the data stored on the volume in bytes. This value is not available
// for volumes created prior to May 13, 2015, until you store data on the volume.
VolumeUsageInBytes int64
noSmithyDocumentSerde
}
// Represents a device object associated with a tape gateway.
type VTLDevice struct {
// A list of iSCSI information about a VTL device.
DeviceiSCSIAttributes *DeviceiSCSIAttributes
// Specifies the unique Amazon Resource Name (ARN) of the device (tape drive or
// media changer).
VTLDeviceARN *string
// Specifies the model number of device that the VTL device emulates.
VTLDeviceProductIdentifier *string
// Specifies the type of device that the VTL device emulates.
VTLDeviceType *string
// Specifies the vendor of the device that the VTL device object emulates.
VTLDeviceVendor *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 1,186 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/protocol/query"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "STS"
const ServiceAPIVersion = "2011-06-15"
// Client provides the API client to make operations call for AWS Security Token
// 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, "sts", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
// HTTPPresignerV4 represents presigner interface used by presign url client
type HTTPPresignerV4 interface {
PresignHTTP(
ctx context.Context, credentials aws.Credentials, r *http.Request,
payloadHash string, service string, region string, signingTime time.Time,
optFns ...func(*v4.SignerOptions),
) (url string, signedHeader http.Header, err error)
}
// PresignOptions represents the presign client options
type PresignOptions struct {
// ClientOptions are list of functional options to mutate client options used by
// the presign client.
ClientOptions []func(*Options)
// Presigner is the presigner used by the presign url client
Presigner HTTPPresignerV4
}
func (o PresignOptions) copy() PresignOptions {
clientOptions := make([]func(*Options), len(o.ClientOptions))
copy(clientOptions, o.ClientOptions)
o.ClientOptions = clientOptions
return o
}
// WithPresignClientFromClientOptions is a helper utility to retrieve a function
// that takes PresignOption as input
func WithPresignClientFromClientOptions(optFns ...func(*Options)) func(*PresignOptions) {
return withPresignClientFromClientOptions(optFns).options
}
type withPresignClientFromClientOptions []func(*Options)
func (w withPresignClientFromClientOptions) options(o *PresignOptions) {
o.ClientOptions = append(o.ClientOptions, w...)
}
// PresignClient represents the presign url client
type PresignClient struct {
client *Client
options PresignOptions
}
// NewPresignClient generates a presign client using provided API Client and
// presign options
func NewPresignClient(c *Client, optFns ...func(*PresignOptions)) *PresignClient {
var options PresignOptions
for _, fn := range optFns {
fn(&options)
}
if len(options.ClientOptions) != 0 {
c = New(c.options, options.ClientOptions...)
}
if options.Presigner == nil {
options.Presigner = newDefaultV4Signer(c.options)
}
return &PresignClient{
client: c,
options: options,
}
}
func withNopHTTPClientAPIOption(o *Options) {
o.HTTPClient = smithyhttp.NopClient{}
}
type presignConverter PresignOptions
func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) {
stack.Finalize.Clear()
stack.Deserialize.Clear()
stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID())
stack.Build.Remove("UserAgent")
pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{
CredentialsProvider: options.Credentials,
Presigner: c.Presigner,
LogSigning: options.ClientLogMode.IsSigning(),
})
err = stack.Finalize.Add(pmw, middleware.After)
if err != nil {
return err
}
if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil {
return err
}
// convert request to a GET request
err = query.AddAsGetRequestMiddleware(stack)
if err != nil {
return err
}
err = presignedurlcust.AddAsIsPresigingMiddleware(stack)
if err != nil {
return err
}
return nil
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 538 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
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 sts
import (
"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/sts/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a set of temporary security credentials that you can use to access
// Amazon Web Services resources. These temporary credentials consist of an access
// key ID, a secret access key, and a security token. Typically, you use AssumeRole
// within your account or for cross-account access. For a comparison of AssumeRole
// with other API operations that produce temporary credentials, see Requesting
// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide. Permissions The temporary security credentials created by
// AssumeRole can be used to make API calls to any Amazon Web Services service
// with the following exception: You cannot call the Amazon Web Services STS
// GetFederationToken or GetSessionToken API operations. (Optional) You can pass
// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// to this operation. You can pass a single JSON policy document to use as an
// inline session policy. You can also specify up to 10 managed policy Amazon
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
// use for both inline and managed session policies can't exceed 2,048 characters.
// Passing policies to this operation returns new temporary credentials. The
// resulting session's permissions are the intersection of the role's
// identity-based policy and the session policies. You can use the role's temporary
// credentials in subsequent Amazon Web Services API calls to access resources in
// the account that owns the role. You cannot use session policies to grant more
// permissions than those allowed by the identity-based policy of the role that is
// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide. When you create a role, you create two policies: a role
// trust policy that specifies who can assume the role, and a permissions policy
// that specifies what can be done with the role. You specify the trusted principal
// that is allowed to assume the role in the role trust policy. To assume a role
// from a different account, your Amazon Web Services account must be trusted by
// the role. The trust relationship is defined in the role's trust policy when the
// role is created. That trust policy states which accounts are allowed to delegate
// that access to users in the account. A user who wants to access a role in a
// different account must also have permissions that are delegated from the account
// administrator. The administrator must attach a policy that allows the user to
// call AssumeRole for the ARN of the role in the other account. To allow a user
// to assume a role in the same account, you can do either of the following:
// - Attach a policy to the user that allows the user to call AssumeRole (as long
// as the role's trust policy trusts the account).
// - Add the user as a principal directly in the role's trust policy.
//
// You can do either because the role’s trust policy acts as an IAM resource-based
// policy. When a resource-based policy grants access to a principal in the same
// account, no additional identity-based policy is required. For more information
// about trust policies and resource-based policies, see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
// in the IAM User Guide. Tags (Optional) You can pass tag key-value pairs to your
// session. These tags are called session tags. For more information about session
// tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
// in the IAM User Guide. An administrator must grant you the permissions necessary
// to pass session tags. The administrator can also create granular permissions to
// allow you to pass only specific session tags. For more information, see
// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
// in the IAM User Guide. You can set the session tags as transitive. Transitive
// tags persist during role chaining. For more information, see Chaining Roles
// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
// in the IAM User Guide. Using MFA with AssumeRole (Optional) You can include
// multi-factor authentication (MFA) information when you call AssumeRole . This is
// useful for cross-account scenarios to ensure that the user that assumes the role
// has been authenticated with an Amazon Web Services MFA device. In that scenario,
// the trust policy of the role being assumed includes a condition that tests for
// MFA authentication. If the caller does not include valid MFA information, the
// request to assume the role is denied. The condition in a trust policy that tests
// for MFA authentication might look like the following example. "Condition":
// {"Bool": {"aws:MultiFactorAuthPresent": true}} For more information, see
// Configuring MFA-Protected API Access (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html)
// in the IAM User Guide guide. To use MFA with AssumeRole , you pass values for
// the SerialNumber and TokenCode parameters. The SerialNumber value identifies
// the user's hardware or virtual MFA device. The TokenCode is the time-based
// one-time password (TOTP) that the MFA device produces.
func (c *Client) AssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*Options)) (*AssumeRoleOutput, error) {
if params == nil {
params = &AssumeRoleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssumeRole", params, optFns, c.addOperationAssumeRoleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssumeRoleOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssumeRoleInput struct {
// The Amazon Resource Name (ARN) of the role to assume.
//
// This member is required.
RoleArn *string
// An identifier for the assumed role session. Use the role session name to
// uniquely identify a session when the same role is assumed by different
// principals or for different reasons. In cross-account scenarios, the role
// session name is visible to, and can be logged by the account that owns the role.
// The role session name is also used in the ARN of the assumed role principal.
// This means that subsequent cross-account API requests that use the temporary
// security credentials will expose the role session name to the external account
// in their CloudTrail logs. The regex used to validate this parameter is a string
// of characters consisting of upper- and lower-case alphanumeric characters with
// no spaces. You can also include underscores or any of the following characters:
// =,.@-
//
// This member is required.
RoleSessionName *string
// The duration, in seconds, of the role session. The value specified can range
// from 900 seconds (15 minutes) up to the maximum session duration set for the
// role. The maximum session duration setting can have a value from 1 hour to 12
// hours. If you specify a value higher than this setting or the administrator
// setting (whichever is lower), the operation fails. For example, if you specify a
// session duration of 12 hours, but your administrator set the maximum session
// duration to 6 hours, your operation fails. Role chaining limits your Amazon Web
// Services CLI or Amazon Web Services API role session to a maximum of one hour.
// When you use the AssumeRole API operation to assume a role, you can specify the
// duration of your role session with the DurationSeconds parameter. You can
// specify a parameter value of up to 43200 seconds (12 hours), depending on the
// maximum session duration setting for your role. However, if you assume a role
// using role chaining and provide a DurationSeconds parameter value greater than
// one hour, the operation fails. To learn how to view the maximum value for your
// role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide. By default, the value is set to 3600 seconds. The
// DurationSeconds parameter is separate from the duration of a console session
// that you might request using the returned credentials. The request to the
// federation endpoint for a console sign-in token takes a SessionDuration
// parameter that specifies the maximum length of the console session. For more
// information, see Creating a URL that Enables Federated Users to Access the
// Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
// in the IAM User Guide.
DurationSeconds *int32
// A unique identifier that might be required when you assume a role in another
// account. If the administrator of the account to which the role belongs provided
// you with an external ID, then provide that value in the ExternalId parameter.
// This value can be any string, such as a passphrase or account number. A
// cross-account role is usually set up to trust everyone in an account. Therefore,
// the administrator of the trusting account might send an external ID to the
// administrator of the trusted account. That way, only someone with the ID can
// assume the role, rather than everyone in the account. For more information about
// the external ID, see How to Use an External ID When Granting Access to Your
// Amazon Web Services Resources to a Third Party (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)
// in the IAM User Guide. The regex used to validate this parameter is a string of
// characters consisting of upper- and lower-case alphanumeric characters with no
// spaces. You can also include underscores or any of the following characters:
// =,.@:/-
ExternalId *string
// An IAM policy in JSON format that you want to use as an inline session policy.
// This parameter is optional. Passing policies to this operation returns new
// temporary credentials. The resulting session's permissions are the intersection
// of the role's identity-based policy and the session policies. You can use the
// role's temporary credentials in subsequent Amazon Web Services API calls to
// access resources in the account that owns the role. You cannot use session
// policies to grant more permissions than those allowed by the identity-based
// policy of the role that is being assumed. For more information, see Session
// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide. The plaintext that you use for both inline and managed
// session policies can't exceed 2,048 characters. The JSON policy characters can
// be any ASCII character from the space character to the end of the valid
// character list (\u0020 through \u00FF). It can also include the tab (\u0009),
// linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web
// Services conversion compresses the passed inline session policy, managed policy
// ARNs, and session tags into a packed binary format that has a separate limit.
// Your request can fail for this limit even if your plaintext meets the other
// requirements. The PackedPolicySize response element indicates by percentage how
// close the policies and tags for your request are to the upper size limit.
Policy *string
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
// use as managed session policies. The policies must exist in the same account as
// the role. This parameter is optional. You can provide up to 10 managed policy
// ARNs. However, the plaintext that you use for both inline and managed session
// policies can't exceed 2,048 characters. For more information about ARNs, see
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the Amazon Web Services General Reference. An Amazon Web Services conversion
// compresses the passed inline session policy, managed policy ARNs, and session
// tags into a packed binary format that has a separate limit. Your request can
// fail for this limit even if your plaintext meets the other requirements. The
// PackedPolicySize response element indicates by percentage how close the policies
// and tags for your request are to the upper size limit. Passing policies to this
// operation returns new temporary credentials. The resulting session's permissions
// are the intersection of the role's identity-based policy and the session
// policies. You can use the role's temporary credentials in subsequent Amazon Web
// Services API calls to access resources in the account that owns the role. You
// cannot use session policies to grant more permissions than those allowed by the
// identity-based policy of the role that is being assumed. For more information,
// see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide.
PolicyArns []types.PolicyDescriptorType
// The identification number of the MFA device that is associated with the user
// who is making the AssumeRole call. Specify this value if the trust policy of
// the role being assumed includes a condition that requires MFA authentication.
// The value is either the serial number for a hardware device (such as
// GAHT12345678 ) or an Amazon Resource Name (ARN) for a virtual device (such as
// arn:aws:iam::123456789012:mfa/user ). The regex used to validate this parameter
// is a string of characters consisting of upper- and lower-case alphanumeric
// characters with no spaces. You can also include underscores or any of the
// following characters: =,.@-
SerialNumber *string
// The source identity specified by the principal that is calling the AssumeRole
// operation. You can require users to specify a source identity when they assume a
// role. You do this by using the sts:SourceIdentity condition key in a role trust
// policy. You can use source identity information in CloudTrail logs to determine
// who took actions with a role. You can use the aws:SourceIdentity condition key
// to further control access to Amazon Web Services resources based on the value of
// source identity. For more information about using source identity, see Monitor
// and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
// in the IAM User Guide. The regex used to validate this parameter is a string of
// characters consisting of upper- and lower-case alphanumeric characters with no
// spaces. You can also include underscores or any of the following characters:
// =,.@-. You cannot use a value that begins with the text aws: . This prefix is
// reserved for Amazon Web Services internal use.
SourceIdentity *string
// A list of session tags that you want to pass. Each session tag consists of a
// key name and an associated value. For more information about session tags, see
// Tagging Amazon Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
// in the IAM User Guide. This parameter is optional. You can pass up to 50 session
// tags. The plaintext session tag keys can’t exceed 128 characters, and the values
// can’t exceed 256 characters. For these and additional limits, see IAM and STS
// Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
// inline session policy, managed policy ARNs, and session tags into a packed
// binary format that has a separate limit. Your request can fail for this limit
// even if your plaintext meets the other requirements. The PackedPolicySize
// response element indicates by percentage how close the policies and tags for
// your request are to the upper size limit. You can pass a session tag with the
// same key as a tag that is already attached to the role. When you do, session
// tags override a role tag with the same key. Tag key–value pairs are not case
// sensitive, but case is preserved. This means that you cannot have separate
// Department and department tag keys. Assume that the role has the Department =
// Marketing tag and you pass the department = engineering session tag. Department
// and department are not saved as separate tags, and the session tag passed in
// the request takes precedence over the role tag. Additionally, if you used
// temporary credentials to perform this operation, the new session inherits any
// transitive session tags from the calling session. If you pass a session tag with
// the same key as an inherited tag, the operation fails. To view the inherited
// tags for a session, see the CloudTrail logs. For more information, see Viewing
// Session Tags in CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs)
// in the IAM User Guide.
Tags []types.Tag
// The value provided by the MFA device, if the trust policy of the role being
// assumed requires MFA. (In other words, if the policy includes a condition that
// tests for MFA). If the role being assumed requires MFA and if the TokenCode
// value is missing or expired, the AssumeRole call returns an "access denied"
// error. The format for this parameter, as described by its regex pattern, is a
// sequence of six numeric digits.
TokenCode *string
// A list of keys for session tags that you want to set as transitive. If you set
// a tag key as transitive, the corresponding key and value passes to subsequent
// sessions in a role chain. For more information, see Chaining Roles with Session
// Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
// in the IAM User Guide. This parameter is optional. When you set session tags as
// transitive, the session policy and session tags packed binary limit is not
// affected. If you choose not to specify a transitive tag key, then no tags are
// passed from this session to any subsequent sessions.
TransitiveTagKeys []string
noSmithyDocumentSerde
}
// Contains the response to a successful AssumeRole request, including temporary
// Amazon Web Services credentials that can be used to make Amazon Web Services
// requests.
type AssumeRoleOutput struct {
// The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers
// that you can use to refer to the resulting temporary security credentials. For
// example, you can reference these credentials as a principal in a resource-based
// policy by using the ARN or assumed role ID. The ARN and ID include the
// RoleSessionName that you specified when you called AssumeRole .
AssumedRoleUser *types.AssumedRoleUser
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security (or session) token. The size of the security token
// that STS API operations return is not fixed. We strongly recommend that you make
// no assumptions about the maximum size.
Credentials *types.Credentials
// A percentage value that indicates the packed size of the session policies and
// session tags combined passed in the request. The request fails if the packed
// size is greater than 100 percent, which means the policies and tags exceeded the
// allowed space.
PackedPolicySize *int32
// The source identity specified by the principal that is calling the AssumeRole
// operation. You can require users to specify a source identity when they assume a
// role. You do this by using the sts:SourceIdentity condition key in a role trust
// policy. You can use source identity information in CloudTrail logs to determine
// who took actions with a role. You can use the aws:SourceIdentity condition key
// to further control access to Amazon Web Services resources based on the value of
// source identity. For more information about using source identity, see Monitor
// and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
// in the IAM User Guide. The regex used to validate this parameter is a string of
// characters consisting of upper- and lower-case alphanumeric characters with no
// spaces. You can also include underscores or any of the following characters:
// =,.@-
SourceIdentity *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRole{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRole{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssumeRoleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRole(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssumeRole(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sts",
OperationName: "AssumeRole",
}
}
// PresignAssumeRole is used to generate a presigned HTTP Request which contains
// presigned URL, signed headers and HTTP method used.
func (c *PresignClient) PresignAssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) {
if params == nil {
params = &AssumeRoleInput{}
}
options := c.options.copy()
for _, fn := range optFns {
fn(&options)
}
clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption)
result, _, err := c.client.invokeOperation(ctx, "AssumeRole", params, clientOptFns,
c.client.addOperationAssumeRoleMiddlewares,
presignConverter(options).convertToPresignMiddleware,
)
if err != nil {
return nil, err
}
out := result.(*v4.PresignedHTTPRequest)
return out, nil
}
| 419 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/sts/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a set of temporary security credentials for users who have been
// authenticated via a SAML authentication response. This operation provides a
// mechanism for tying an enterprise identity store or directory to role-based
// Amazon Web Services access without user-specific credentials or configuration.
// For a comparison of AssumeRoleWithSAML with the other API operations that
// produce temporary credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide. The temporary security credentials returned by this
// operation consist of an access key ID, a secret access key, and a security
// token. Applications can use these temporary security credentials to sign calls
// to Amazon Web Services services. Session Duration By default, the temporary
// security credentials created by AssumeRoleWithSAML last for one hour. However,
// you can use the optional DurationSeconds parameter to specify the duration of
// your session. Your role session lasts for the duration that you specify, or
// until the time specified in the SAML authentication response's
// SessionNotOnOrAfter value, whichever is shorter. You can provide a
// DurationSeconds value from 900 seconds (15 minutes) up to the maximum session
// duration setting for the role. This setting can have a value from 1 hour to 12
// hours. To learn how to view the maximum value for your role, see View the
// Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide. The maximum session duration limit applies when you use
// the AssumeRole* API operations or the assume-role* CLI commands. However the
// limit does not apply when you use those operations to create a console URL. For
// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
// in the IAM User Guide. Role chaining (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining)
// limits your CLI or Amazon Web Services API role session to a maximum of one
// hour. When you use the AssumeRole API operation to assume a role, you can
// specify the duration of your role session with the DurationSeconds parameter.
// You can specify a parameter value of up to 43200 seconds (12 hours), depending
// on the maximum session duration setting for your role. However, if you assume a
// role using role chaining and provide a DurationSeconds parameter value greater
// than one hour, the operation fails. Permissions The temporary security
// credentials created by AssumeRoleWithSAML can be used to make API calls to any
// Amazon Web Services service with the following exception: you cannot call the
// STS GetFederationToken or GetSessionToken API operations. (Optional) You can
// pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// to this operation. You can pass a single JSON policy document to use as an
// inline session policy. You can also specify up to 10 managed policy Amazon
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
// use for both inline and managed session policies can't exceed 2,048 characters.
// Passing policies to this operation returns new temporary credentials. The
// resulting session's permissions are the intersection of the role's
// identity-based policy and the session policies. You can use the role's temporary
// credentials in subsequent Amazon Web Services API calls to access resources in
// the account that owns the role. You cannot use session policies to grant more
// permissions than those allowed by the identity-based policy of the role that is
// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide. Calling AssumeRoleWithSAML does not require the use of
// Amazon Web Services security credentials. The identity of the caller is
// validated by using keys in the metadata document that is uploaded for the SAML
// provider entity for your identity provider. Calling AssumeRoleWithSAML can
// result in an entry in your CloudTrail logs. The entry includes the value in the
// NameID element of the SAML assertion. We recommend that you use a NameIDType
// that is not associated with any personally identifiable information (PII). For
// example, you could instead use the persistent identifier (
// urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ). Tags (Optional) You can
// configure your IdP to pass attributes into your SAML assertion as session tags.
// Each session tag consists of a key name and an associated value. For more
// information about session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session
// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters.
// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
// inline session policy, managed policy ARNs, and session tags into a packed
// binary format that has a separate limit. Your request can fail for this limit
// even if your plaintext meets the other requirements. The PackedPolicySize
// response element indicates by percentage how close the policies and tags for
// your request are to the upper size limit. You can pass a session tag with the
// same key as a tag that is attached to the role. When you do, session tags
// override the role's tags with the same key. An administrator must grant you the
// permissions necessary to pass session tags. The administrator can also create
// granular permissions to allow you to pass only specific session tags. For more
// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
// in the IAM User Guide. You can set the session tags as transitive. Transitive
// tags persist during role chaining. For more information, see Chaining Roles
// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
// in the IAM User Guide. SAML Configuration Before your application can call
// AssumeRoleWithSAML , you must configure your SAML identity provider (IdP) to
// issue the claims required by Amazon Web Services. Additionally, you must use
// Identity and Access Management (IAM) to create a SAML provider entity in your
// Amazon Web Services account that represents your identity provider. You must
// also create an IAM role that specifies this SAML provider in its trust policy.
// For more information, see the following resources:
// - About SAML 2.0-based Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html)
// in the IAM User Guide.
// - Creating SAML Identity Providers (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html)
// in the IAM User Guide.
// - Configuring a Relying Party and Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html)
// in the IAM User Guide.
// - Creating a Role for SAML 2.0 Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html)
// in the IAM User Guide.
func (c *Client) AssumeRoleWithSAML(ctx context.Context, params *AssumeRoleWithSAMLInput, optFns ...func(*Options)) (*AssumeRoleWithSAMLOutput, error) {
if params == nil {
params = &AssumeRoleWithSAMLInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithSAML", params, optFns, c.addOperationAssumeRoleWithSAMLMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssumeRoleWithSAMLOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssumeRoleWithSAMLInput struct {
// The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the
// IdP.
//
// This member is required.
PrincipalArn *string
// The Amazon Resource Name (ARN) of the role that the caller is assuming.
//
// This member is required.
RoleArn *string
// The base64 encoded SAML authentication response provided by the IdP. For more
// information, see Configuring a Relying Party and Adding Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html)
// in the IAM User Guide.
//
// This member is required.
SAMLAssertion *string
// The duration, in seconds, of the role session. Your role session lasts for the
// duration that you specify for the DurationSeconds parameter, or until the time
// specified in the SAML authentication response's SessionNotOnOrAfter value,
// whichever is shorter. You can provide a DurationSeconds value from 900 seconds
// (15 minutes) up to the maximum session duration setting for the role. This
// setting can have a value from 1 hour to 12 hours. If you specify a value higher
// than this setting, the operation fails. For example, if you specify a session
// duration of 12 hours, but your administrator set the maximum session duration to
// 6 hours, your operation fails. To learn how to view the maximum value for your
// role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide. By default, the value is set to 3600 seconds. The
// DurationSeconds parameter is separate from the duration of a console session
// that you might request using the returned credentials. The request to the
// federation endpoint for a console sign-in token takes a SessionDuration
// parameter that specifies the maximum length of the console session. For more
// information, see Creating a URL that Enables Federated Users to Access the
// Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
// in the IAM User Guide.
DurationSeconds *int32
// An IAM policy in JSON format that you want to use as an inline session policy.
// This parameter is optional. Passing policies to this operation returns new
// temporary credentials. The resulting session's permissions are the intersection
// of the role's identity-based policy and the session policies. You can use the
// role's temporary credentials in subsequent Amazon Web Services API calls to
// access resources in the account that owns the role. You cannot use session
// policies to grant more permissions than those allowed by the identity-based
// policy of the role that is being assumed. For more information, see Session
// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide. The plaintext that you use for both inline and managed
// session policies can't exceed 2,048 characters. The JSON policy characters can
// be any ASCII character from the space character to the end of the valid
// character list (\u0020 through \u00FF). It can also include the tab (\u0009),
// linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web
// Services conversion compresses the passed inline session policy, managed policy
// ARNs, and session tags into a packed binary format that has a separate limit.
// Your request can fail for this limit even if your plaintext meets the other
// requirements. The PackedPolicySize response element indicates by percentage how
// close the policies and tags for your request are to the upper size limit.
Policy *string
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
// use as managed session policies. The policies must exist in the same account as
// the role. This parameter is optional. You can provide up to 10 managed policy
// ARNs. However, the plaintext that you use for both inline and managed session
// policies can't exceed 2,048 characters. For more information about ARNs, see
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the Amazon Web Services General Reference. An Amazon Web Services conversion
// compresses the passed inline session policy, managed policy ARNs, and session
// tags into a packed binary format that has a separate limit. Your request can
// fail for this limit even if your plaintext meets the other requirements. The
// PackedPolicySize response element indicates by percentage how close the policies
// and tags for your request are to the upper size limit. Passing policies to this
// operation returns new temporary credentials. The resulting session's permissions
// are the intersection of the role's identity-based policy and the session
// policies. You can use the role's temporary credentials in subsequent Amazon Web
// Services API calls to access resources in the account that owns the role. You
// cannot use session policies to grant more permissions than those allowed by the
// identity-based policy of the role that is being assumed. For more information,
// see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide.
PolicyArns []types.PolicyDescriptorType
noSmithyDocumentSerde
}
// Contains the response to a successful AssumeRoleWithSAML request, including
// temporary Amazon Web Services credentials that can be used to make Amazon Web
// Services requests.
type AssumeRoleWithSAMLOutput struct {
// The identifiers for the temporary security credentials that the operation
// returns.
AssumedRoleUser *types.AssumedRoleUser
// The value of the Recipient attribute of the SubjectConfirmationData element of
// the SAML assertion.
Audience *string
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security (or session) token. The size of the security token
// that STS API operations return is not fixed. We strongly recommend that you make
// no assumptions about the maximum size.
Credentials *types.Credentials
// The value of the Issuer element of the SAML assertion.
Issuer *string
// A hash value based on the concatenation of the following:
// - The Issuer response value.
// - The Amazon Web Services account ID.
// - The friendly name (the last part of the ARN) of the SAML provider in IAM.
// The combination of NameQualifier and Subject can be used to uniquely identify a
// user. The following pseudocode shows how the hash value is calculated: BASE64 (
// SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) )
NameQualifier *string
// A percentage value that indicates the packed size of the session policies and
// session tags combined passed in the request. The request fails if the packed
// size is greater than 100 percent, which means the policies and tags exceeded the
// allowed space.
PackedPolicySize *int32
// The value in the SourceIdentity attribute in the SAML assertion. You can
// require users to set a source identity value when they assume a role. You do
// this by using the sts:SourceIdentity condition key in a role trust policy. That
// way, actions that are taken with the role are associated with that user. After
// the source identity is set, the value cannot be changed. It is present in the
// request for all actions that are taken by the role and persists across chained
// role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining)
// sessions. You can configure your SAML identity provider to use an attribute
// associated with your users, like user name or email, as the source identity when
// calling AssumeRoleWithSAML . You do this by adding an attribute to the SAML
// assertion. For more information about using source identity, see Monitor and
// control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
// in the IAM User Guide. The regex used to validate this parameter is a string of
// characters consisting of upper- and lower-case alphanumeric characters with no
// spaces. You can also include underscores or any of the following characters:
// =,.@-
SourceIdentity *string
// The value of the NameID element in the Subject element of the SAML assertion.
Subject *string
// The format of the name ID, as defined by the Format attribute in the NameID
// element of the SAML assertion. Typical examples of the format are transient or
// persistent . If the format includes the prefix
// urn:oasis:names:tc:SAML:2.0:nameid-format , that prefix is removed. For example,
// urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient .
// If the format includes any other prefix, the format is returned with no
// modifications.
SubjectType *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithSAML{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoleWithSAML{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithSAML(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssumeRoleWithSAML(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sts",
OperationName: "AssumeRoleWithSAML",
}
}
| 346 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/sts/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a set of temporary security credentials for users who have been
// authenticated in a mobile or web application with a web identity provider.
// Example providers include the OAuth 2.0 providers Login with Amazon and
// Facebook, or any OpenID Connect-compatible identity provider such as Google or
// Amazon Cognito federated identities (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html)
// . For mobile applications, we recommend that you use Amazon Cognito. You can use
// Amazon Cognito with the Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/)
// and the Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/)
// to uniquely identify a user. You can also supply the user with a consistent
// identity throughout the lifetime of an application. To learn more about Amazon
// Cognito, see Amazon Cognito identity pools (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html)
// in Amazon Cognito Developer Guide. Calling AssumeRoleWithWebIdentity does not
// require the use of Amazon Web Services security credentials. Therefore, you can
// distribute an application (for example, on mobile devices) that requests
// temporary security credentials without including long-term Amazon Web Services
// credentials in the application. You also don't need to deploy server-based proxy
// services that use long-term Amazon Web Services credentials. Instead, the
// identity of the caller is validated by using a token from the web identity
// provider. For a comparison of AssumeRoleWithWebIdentity with the other API
// operations that produce temporary credentials, see Requesting Temporary
// Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide. The temporary security credentials returned by this API
// consist of an access key ID, a secret access key, and a security token.
// Applications can use these temporary security credentials to sign calls to
// Amazon Web Services service API operations. Session Duration By default, the
// temporary security credentials created by AssumeRoleWithWebIdentity last for
// one hour. However, you can use the optional DurationSeconds parameter to
// specify the duration of your session. You can provide a value from 900 seconds
// (15 minutes) up to the maximum session duration setting for the role. This
// setting can have a value from 1 hour to 12 hours. To learn how to view the
// maximum value for your role, see View the Maximum Session Duration Setting for
// a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide. The maximum session duration limit applies when you use
// the AssumeRole* API operations or the assume-role* CLI commands. However the
// limit does not apply when you use those operations to create a console URL. For
// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
// in the IAM User Guide. Permissions The temporary security credentials created by
// AssumeRoleWithWebIdentity can be used to make API calls to any Amazon Web
// Services service with the following exception: you cannot call the STS
// GetFederationToken or GetSessionToken API operations. (Optional) You can pass
// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// to this operation. You can pass a single JSON policy document to use as an
// inline session policy. You can also specify up to 10 managed policy Amazon
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
// use for both inline and managed session policies can't exceed 2,048 characters.
// Passing policies to this operation returns new temporary credentials. The
// resulting session's permissions are the intersection of the role's
// identity-based policy and the session policies. You can use the role's temporary
// credentials in subsequent Amazon Web Services API calls to access resources in
// the account that owns the role. You cannot use session policies to grant more
// permissions than those allowed by the identity-based policy of the role that is
// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide. Tags (Optional) You can configure your IdP to pass
// attributes into your web identity token as session tags. Each session tag
// consists of a key name and an associated value. For more information about
// session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session
// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters.
// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
// inline session policy, managed policy ARNs, and session tags into a packed
// binary format that has a separate limit. Your request can fail for this limit
// even if your plaintext meets the other requirements. The PackedPolicySize
// response element indicates by percentage how close the policies and tags for
// your request are to the upper size limit. You can pass a session tag with the
// same key as a tag that is attached to the role. When you do, the session tag
// overrides the role tag with the same key. An administrator must grant you the
// permissions necessary to pass session tags. The administrator can also create
// granular permissions to allow you to pass only specific session tags. For more
// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
// in the IAM User Guide. You can set the session tags as transitive. Transitive
// tags persist during role chaining. For more information, see Chaining Roles
// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
// in the IAM User Guide. Identities Before your application can call
// AssumeRoleWithWebIdentity , you must have an identity token from a supported
// identity provider and create a role that the application can assume. The role
// that your application assumes must trust the identity provider that is
// associated with the identity token. In other words, the identity provider must
// be specified in the role's trust policy. Calling AssumeRoleWithWebIdentity can
// result in an entry in your CloudTrail logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims)
// of the provided web identity token. We recommend that you avoid using any
// personally identifiable information (PII) in this field. For example, you could
// instead use a GUID or a pairwise identifier, as suggested in the OIDC
// specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes)
// . For more information about how to use web identity federation and the
// AssumeRoleWithWebIdentity API, see the following resources:
// - Using Web Identity Federation API Operations for Mobile Apps (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html)
// and Federation Through a Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
// .
// - Web Identity Federation Playground (https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/)
// . Walk through the process of authenticating through Login with Amazon,
// Facebook, or Google, getting temporary security credentials, and then using
// those credentials to make a request to Amazon Web Services.
// - Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/)
// and Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/)
// . These toolkits contain sample apps that show how to invoke the identity
// providers. The toolkits then show how to use the information from these
// providers to get and use temporary security credentials.
// - Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications)
// . This article discusses web identity federation and shows an example of how to
// use web identity federation to get access to content in Amazon S3.
func (c *Client) AssumeRoleWithWebIdentity(ctx context.Context, params *AssumeRoleWithWebIdentityInput, optFns ...func(*Options)) (*AssumeRoleWithWebIdentityOutput, error) {
if params == nil {
params = &AssumeRoleWithWebIdentityInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssumeRoleWithWebIdentity", params, optFns, c.addOperationAssumeRoleWithWebIdentityMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssumeRoleWithWebIdentityOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssumeRoleWithWebIdentityInput struct {
// The Amazon Resource Name (ARN) of the role that the caller is assuming.
//
// This member is required.
RoleArn *string
// An identifier for the assumed role session. Typically, you pass the name or
// identifier that is associated with the user who is using your application. That
// way, the temporary security credentials that your application will use are
// associated with that user. This session name is included as part of the ARN and
// assumed role ID in the AssumedRoleUser response element. The regex used to
// validate this parameter is a string of characters consisting of upper- and
// lower-case alphanumeric characters with no spaces. You can also include
// underscores or any of the following characters: =,.@-
//
// This member is required.
RoleSessionName *string
// The OAuth 2.0 access token or OpenID Connect ID token that is provided by the
// identity provider. Your application must get this token by authenticating the
// user who is using your application with a web identity provider before the
// application makes an AssumeRoleWithWebIdentity call.
//
// This member is required.
WebIdentityToken *string
// The duration, in seconds, of the role session. The value can range from 900
// seconds (15 minutes) up to the maximum session duration setting for the role.
// This setting can have a value from 1 hour to 12 hours. If you specify a value
// higher than this setting, the operation fails. For example, if you specify a
// session duration of 12 hours, but your administrator set the maximum session
// duration to 6 hours, your operation fails. To learn how to view the maximum
// value for your role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
// in the IAM User Guide. By default, the value is set to 3600 seconds. The
// DurationSeconds parameter is separate from the duration of a console session
// that you might request using the returned credentials. The request to the
// federation endpoint for a console sign-in token takes a SessionDuration
// parameter that specifies the maximum length of the console session. For more
// information, see Creating a URL that Enables Federated Users to Access the
// Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
// in the IAM User Guide.
DurationSeconds *int32
// An IAM policy in JSON format that you want to use as an inline session policy.
// This parameter is optional. Passing policies to this operation returns new
// temporary credentials. The resulting session's permissions are the intersection
// of the role's identity-based policy and the session policies. You can use the
// role's temporary credentials in subsequent Amazon Web Services API calls to
// access resources in the account that owns the role. You cannot use session
// policies to grant more permissions than those allowed by the identity-based
// policy of the role that is being assumed. For more information, see Session
// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide. The plaintext that you use for both inline and managed
// session policies can't exceed 2,048 characters. The JSON policy characters can
// be any ASCII character from the space character to the end of the valid
// character list (\u0020 through \u00FF). It can also include the tab (\u0009),
// linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web
// Services conversion compresses the passed inline session policy, managed policy
// ARNs, and session tags into a packed binary format that has a separate limit.
// Your request can fail for this limit even if your plaintext meets the other
// requirements. The PackedPolicySize response element indicates by percentage how
// close the policies and tags for your request are to the upper size limit.
Policy *string
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
// use as managed session policies. The policies must exist in the same account as
// the role. This parameter is optional. You can provide up to 10 managed policy
// ARNs. However, the plaintext that you use for both inline and managed session
// policies can't exceed 2,048 characters. For more information about ARNs, see
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the Amazon Web Services General Reference. An Amazon Web Services conversion
// compresses the passed inline session policy, managed policy ARNs, and session
// tags into a packed binary format that has a separate limit. Your request can
// fail for this limit even if your plaintext meets the other requirements. The
// PackedPolicySize response element indicates by percentage how close the policies
// and tags for your request are to the upper size limit. Passing policies to this
// operation returns new temporary credentials. The resulting session's permissions
// are the intersection of the role's identity-based policy and the session
// policies. You can use the role's temporary credentials in subsequent Amazon Web
// Services API calls to access resources in the account that owns the role. You
// cannot use session policies to grant more permissions than those allowed by the
// identity-based policy of the role that is being assumed. For more information,
// see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide.
PolicyArns []types.PolicyDescriptorType
// The fully qualified host component of the domain name of the OAuth 2.0 identity
// provider. Do not specify this value for an OpenID Connect identity provider.
// Currently www.amazon.com and graph.facebook.com are the only supported identity
// providers for OAuth 2.0 access tokens. Do not include URL schemes and port
// numbers. Do not specify this value for OpenID Connect ID tokens.
ProviderId *string
noSmithyDocumentSerde
}
// Contains the response to a successful AssumeRoleWithWebIdentity request,
// including temporary Amazon Web Services credentials that can be used to make
// Amazon Web Services requests.
type AssumeRoleWithWebIdentityOutput struct {
// The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers
// that you can use to refer to the resulting temporary security credentials. For
// example, you can reference these credentials as a principal in a resource-based
// policy by using the ARN or assumed role ID. The ARN and ID include the
// RoleSessionName that you specified when you called AssumeRole .
AssumedRoleUser *types.AssumedRoleUser
// The intended audience (also known as client ID) of the web identity token. This
// is traditionally the client identifier issued to the application that requested
// the web identity token.
Audience *string
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security token. The size of the security token that STS API
// operations return is not fixed. We strongly recommend that you make no
// assumptions about the maximum size.
Credentials *types.Credentials
// A percentage value that indicates the packed size of the session policies and
// session tags combined passed in the request. The request fails if the packed
// size is greater than 100 percent, which means the policies and tags exceeded the
// allowed space.
PackedPolicySize *int32
// The issuing authority of the web identity token presented. For OpenID Connect
// ID tokens, this contains the value of the iss field. For OAuth 2.0 access
// tokens, this contains the value of the ProviderId parameter that was passed in
// the AssumeRoleWithWebIdentity request.
Provider *string
// The value of the source identity that is returned in the JSON web token (JWT)
// from the identity provider. You can require users to set a source identity value
// when they assume a role. You do this by using the sts:SourceIdentity condition
// key in a role trust policy. That way, actions that are taken with the role are
// associated with that user. After the source identity is set, the value cannot be
// changed. It is present in the request for all actions that are taken by the role
// and persists across chained role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining)
// sessions. You can configure your identity provider to use an attribute
// associated with your users, like user name or email, as the source identity when
// calling AssumeRoleWithWebIdentity . You do this by adding a claim to the JSON
// web token. To learn more about OIDC tokens and claims, see Using Tokens with
// User Pools (https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html)
// in the Amazon Cognito Developer Guide. For more information about using source
// identity, see Monitor and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
// in the IAM User Guide. The regex used to validate this parameter is a string of
// characters consisting of upper- and lower-case alphanumeric characters with no
// spaces. You can also include underscores or any of the following characters:
// =,.@-
SourceIdentity *string
// The unique user identifier that is returned by the identity provider. This
// identifier is associated with the WebIdentityToken that was submitted with the
// AssumeRoleWithWebIdentity call. The identifier is typically unique to the user
// and the application that acquired the WebIdentityToken (pairwise identifier).
// For OpenID Connect ID tokens, this field contains the value returned by the
// identity provider as the token's sub (Subject) claim.
SubjectFromWebIdentityToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithWebIdentity{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoleWithWebIdentity{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sts",
OperationName: "AssumeRoleWithWebIdentity",
}
}
| 364 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"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"
)
// Decodes additional information about the authorization status of a request from
// an encoded message returned in response to an Amazon Web Services request. For
// example, if a user is not authorized to perform an operation that he or she has
// requested, the request returns a Client.UnauthorizedOperation response (an HTTP
// 403 response). Some Amazon Web Services operations additionally return an
// encoded message that can provide details about this authorization failure. Only
// certain Amazon Web Services operations return an encoded authorization message.
// The documentation for an individual operation indicates whether that operation
// returns an encoded message in addition to returning an HTTP code. The message is
// encoded because the details of the authorization status can contain privileged
// information that the user who requested the operation should not see. To decode
// an authorization status message, a user must be granted permissions through an
// IAM policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
// to request the DecodeAuthorizationMessage ( sts:DecodeAuthorizationMessage )
// action. The decoded message includes the following type of information:
// - Whether the request was denied due to an explicit deny or due to the
// absence of an explicit allow. For more information, see Determining Whether a
// Request is Allowed or Denied (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow)
// in the IAM User Guide.
// - The principal who made the request.
// - The requested action.
// - The requested resource.
// - The values of condition keys in the context of the user's request.
func (c *Client) DecodeAuthorizationMessage(ctx context.Context, params *DecodeAuthorizationMessageInput, optFns ...func(*Options)) (*DecodeAuthorizationMessageOutput, error) {
if params == nil {
params = &DecodeAuthorizationMessageInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DecodeAuthorizationMessage", params, optFns, c.addOperationDecodeAuthorizationMessageMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DecodeAuthorizationMessageOutput)
out.ResultMetadata = metadata
return out, nil
}
type DecodeAuthorizationMessageInput struct {
// The encoded message that was returned with the response.
//
// This member is required.
EncodedMessage *string
noSmithyDocumentSerde
}
// A document that contains additional information about the authorization status
// of a request from an encoded message that is returned in response to an Amazon
// Web Services request.
type DecodeAuthorizationMessageOutput struct {
// The API returns a response with the decoded message.
DecodedMessage *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsquery_serializeOpDecodeAuthorizationMessage{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDecodeAuthorizationMessage{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDecodeAuthorizationMessage(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDecodeAuthorizationMessage(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sts",
OperationName: "DecodeAuthorizationMessage",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"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 account identifier for the specified access key ID. Access keys
// consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE ) and
// a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ).
// For more information about access keys, see Managing Access Keys for IAM Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)
// in the IAM User Guide. When you pass an access key ID to this operation, it
// returns the ID of the Amazon Web Services account to which the keys belong.
// Access key IDs beginning with AKIA are long-term credentials for an IAM user or
// the Amazon Web Services account root user. Access key IDs beginning with ASIA
// are temporary credentials that are created using STS operations. If the account
// in the response belongs to you, you can sign in as the root user and review your
// root user access keys. Then, you can pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html)
// to learn which IAM user owns the keys. To learn who requested the temporary
// credentials for an ASIA access key, view the STS events in your CloudTrail logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html)
// in the IAM User Guide. This operation does not indicate the state of the access
// key. The key might be active, inactive, or deleted. Active keys might not have
// permissions to perform an operation. Providing a deleted access key might return
// an error that the key doesn't exist.
func (c *Client) GetAccessKeyInfo(ctx context.Context, params *GetAccessKeyInfoInput, optFns ...func(*Options)) (*GetAccessKeyInfoOutput, error) {
if params == nil {
params = &GetAccessKeyInfoInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetAccessKeyInfo", params, optFns, c.addOperationGetAccessKeyInfoMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetAccessKeyInfoOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetAccessKeyInfoInput struct {
// The identifier of an access key. This parameter allows (through its regex
// pattern) a string of characters that can consist of any upper- or lowercase
// letter or digit.
//
// This member is required.
AccessKeyId *string
noSmithyDocumentSerde
}
type GetAccessKeyInfoOutput struct {
// The number used to identify the Amazon Web Services account.
Account *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetAccessKeyInfo{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetAccessKeyInfo{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessKeyInfo(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetAccessKeyInfo(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sts",
OperationName: "GetAccessKeyInfo",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"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 details about the IAM user or role whose credentials are used to call
// the operation. No permissions are required to perform this operation. If an
// administrator attaches a policy to your identity that explicitly denies access
// to the sts:GetCallerIdentity action, you can still perform this operation.
// Permissions are not required because the same information is returned when
// access is denied. To view an example response, see I Am Not Authorized to
// Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa)
// in the IAM User Guide.
func (c *Client) GetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*Options)) (*GetCallerIdentityOutput, error) {
if params == nil {
params = &GetCallerIdentityInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetCallerIdentity", params, optFns, c.addOperationGetCallerIdentityMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetCallerIdentityOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetCallerIdentityInput struct {
noSmithyDocumentSerde
}
// Contains the response to a successful GetCallerIdentity request, including
// information about the entity making the request.
type GetCallerIdentityOutput struct {
// The Amazon Web Services account ID number of the account that owns or contains
// the calling entity.
Account *string
// The Amazon Web Services ARN associated with the calling entity.
Arn *string
// The unique identifier of the calling entity. The exact value depends on the
// type of entity that is making the call. The values returned are those listed in
// the aws:userid column in the Principal table (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable)
// found on the Policy Variables reference page in the IAM User Guide.
UserId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetCallerIdentity{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetCallerIdentity{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opGetCallerIdentity(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetCallerIdentity(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sts",
OperationName: "GetCallerIdentity",
}
}
// PresignGetCallerIdentity is used to generate a presigned HTTP Request which
// contains presigned URL, signed headers and HTTP method used.
func (c *PresignClient) PresignGetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) {
if params == nil {
params = &GetCallerIdentityInput{}
}
options := c.options.copy()
for _, fn := range optFns {
fn(&options)
}
clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption)
result, _, err := c.client.invokeOperation(ctx, "GetCallerIdentity", params, clientOptFns,
c.client.addOperationGetCallerIdentityMiddlewares,
presignConverter(options).convertToPresignMiddleware,
)
if err != nil {
return nil, err
}
out := result.(*v4.PresignedHTTPRequest)
return out, nil
}
| 158 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"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/sts/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a set of temporary security credentials (consisting of an access key
// ID, a secret access key, and a security token) for a user. A typical use is in a
// proxy application that gets temporary security credentials on behalf of
// distributed applications inside a corporate network. You must call the
// GetFederationToken operation using the long-term security credentials of an IAM
// user. As a result, this call is appropriate in contexts where those credentials
// can be safeguarded, usually in a server-based application. For a comparison of
// GetFederationToken with the other API operations that produce temporary
// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide. Although it is possible to call GetFederationToken using
// the security credentials of an Amazon Web Services account root user rather than
// an IAM user that you create for the purpose of a proxy application, we do not
// recommend it. For more information, see Safeguard your root user credentials
// and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)
// in the IAM User Guide. You can create a mobile-based or browser-based app that
// can authenticate users using a web identity provider like Login with Amazon,
// Facebook, Google, or an OpenID Connect-compatible identity provider. In this
// case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/)
// or AssumeRoleWithWebIdentity . For more information, see Federation Through a
// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
// in the IAM User Guide. Session duration The temporary credentials are valid for
// the specified duration, from 900 seconds (15 minutes) up to a maximum of 129,600
// seconds (36 hours). The default session duration is 43,200 seconds (12 hours).
// Temporary credentials obtained by using the root user credentials have a maximum
// duration of 3,600 seconds (1 hour). Permissions You can use the temporary
// credentials created by GetFederationToken in any Amazon Web Services service
// with the following exceptions:
// - You cannot call any IAM operations using the CLI or the Amazon Web Services
// API. This limitation does not apply to console sessions.
// - You cannot call any STS operations except GetCallerIdentity .
//
// You can use temporary credentials for single sign-on (SSO) to the console. You
// must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// to this operation. You can pass a single JSON policy document to use as an
// inline session policy. You can also specify up to 10 managed policy Amazon
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
// use for both inline and managed session policies can't exceed 2,048 characters.
// Though the session policy parameters are optional, if you do not pass a policy,
// then the resulting federated user session has no permissions. When you pass
// session policies, the session permissions are the intersection of the IAM user
// policies and the session policies that you pass. This gives you a way to further
// restrict the permissions for a federated user. You cannot use session policies
// to grant more permissions than those that are defined in the permissions policy
// of the IAM user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide. For information about using GetFederationToken to create
// temporary security credentials, see GetFederationToken—Federation Through a
// Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken)
// . You can use the credentials to access a resource that has a resource-based
// policy. If that policy specifically references the federated user session in the
// Principal element of the policy, the session has the permissions allowed by the
// policy. These permissions are granted in addition to the permissions granted by
// the session policies. Tags (Optional) You can pass tag key-value pairs to your
// session. These are called session tags. For more information about session tags,
// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
// in the IAM User Guide. You can create a mobile-based or browser-based app that
// can authenticate users using a web identity provider like Login with Amazon,
// Facebook, Google, or an OpenID Connect-compatible identity provider. In this
// case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/)
// or AssumeRoleWithWebIdentity . For more information, see Federation Through a
// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
// in the IAM User Guide. An administrator must grant you the permissions necessary
// to pass session tags. The administrator can also create granular permissions to
// allow you to pass only specific session tags. For more information, see
// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
// in the IAM User Guide. Tag key–value pairs are not case sensitive, but case is
// preserved. This means that you cannot have separate Department and department
// tag keys. Assume that the user that you are federating has the Department =
// Marketing tag and you pass the department = engineering session tag. Department
// and department are not saved as separate tags, and the session tag passed in
// the request takes precedence over the user tag.
func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTokenInput, optFns ...func(*Options)) (*GetFederationTokenOutput, error) {
if params == nil {
params = &GetFederationTokenInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetFederationToken", params, optFns, c.addOperationGetFederationTokenMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetFederationTokenOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetFederationTokenInput struct {
// The name of the federated user. The name is used as an identifier for the
// temporary security credentials (such as Bob ). For example, you can reference
// the federated user name in a resource-based policy, such as in an Amazon S3
// bucket policy. The regex used to validate this parameter is a string of
// characters consisting of upper- and lower-case alphanumeric characters with no
// spaces. You can also include underscores or any of the following characters:
// =,.@-
//
// This member is required.
Name *string
// The duration, in seconds, that the session should last. Acceptable durations
// for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds
// (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained
// using root user credentials are restricted to a maximum of 3,600 seconds (one
// hour). If the specified duration is longer than one hour, the session obtained
// by using root user credentials defaults to one hour.
DurationSeconds *int32
// An IAM policy in JSON format that you want to use as an inline session policy.
// You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// to this operation. You can pass a single JSON policy document to use as an
// inline session policy. You can also specify up to 10 managed policy Amazon
// Resource Names (ARNs) to use as managed session policies. This parameter is
// optional. However, if you do not pass any session policies, then the resulting
// federated user session has no permissions. When you pass session policies, the
// session permissions are the intersection of the IAM user policies and the
// session policies that you pass. This gives you a way to further restrict the
// permissions for a federated user. You cannot use session policies to grant more
// permissions than those that are defined in the permissions policy of the IAM
// user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide. The resulting credentials can be used to access a
// resource that has a resource-based policy. If that policy specifically
// references the federated user session in the Principal element of the policy,
// the session has the permissions allowed by the policy. These permissions are
// granted in addition to the permissions that are granted by the session policies.
// The plaintext that you use for both inline and managed session policies can't
// exceed 2,048 characters. The JSON policy characters can be any ASCII character
// from the space character to the end of the valid character list (\u0020 through
// \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage
// return (\u000D) characters. An Amazon Web Services conversion compresses the
// passed inline session policy, managed policy ARNs, and session tags into a
// packed binary format that has a separate limit. Your request can fail for this
// limit even if your plaintext meets the other requirements. The PackedPolicySize
// response element indicates by percentage how close the policies and tags for
// your request are to the upper size limit.
Policy *string
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
// use as a managed session policy. The policies must exist in the same account as
// the IAM user that is requesting federated access. You must pass an inline or
// managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// to this operation. You can pass a single JSON policy document to use as an
// inline session policy. You can also specify up to 10 managed policy Amazon
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
// use for both inline and managed session policies can't exceed 2,048 characters.
// You can provide up to 10 managed policy ARNs. For more information about ARNs,
// see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the Amazon Web Services General Reference. This parameter is optional.
// However, if you do not pass any session policies, then the resulting federated
// user session has no permissions. When you pass session policies, the session
// permissions are the intersection of the IAM user policies and the session
// policies that you pass. This gives you a way to further restrict the permissions
// for a federated user. You cannot use session policies to grant more permissions
// than those that are defined in the permissions policy of the IAM user. For more
// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
// in the IAM User Guide. The resulting credentials can be used to access a
// resource that has a resource-based policy. If that policy specifically
// references the federated user session in the Principal element of the policy,
// the session has the permissions allowed by the policy. These permissions are
// granted in addition to the permissions that are granted by the session policies.
// An Amazon Web Services conversion compresses the passed inline session policy,
// managed policy ARNs, and session tags into a packed binary format that has a
// separate limit. Your request can fail for this limit even if your plaintext
// meets the other requirements. The PackedPolicySize response element indicates
// by percentage how close the policies and tags for your request are to the upper
// size limit.
PolicyArns []types.PolicyDescriptorType
// A list of session tags. Each session tag consists of a key name and an
// associated value. For more information about session tags, see Passing Session
// Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
// in the IAM User Guide. This parameter is optional. You can pass up to 50 session
// tags. The plaintext session tag keys can’t exceed 128 characters and the values
// can’t exceed 256 characters. For these and additional limits, see IAM and STS
// Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
// inline session policy, managed policy ARNs, and session tags into a packed
// binary format that has a separate limit. Your request can fail for this limit
// even if your plaintext meets the other requirements. The PackedPolicySize
// response element indicates by percentage how close the policies and tags for
// your request are to the upper size limit. You can pass a session tag with the
// same key as a tag that is already attached to the user you are federating. When
// you do, session tags override a user tag with the same key. Tag key–value pairs
// are not case sensitive, but case is preserved. This means that you cannot have
// separate Department and department tag keys. Assume that the role has the
// Department = Marketing tag and you pass the department = engineering session
// tag. Department and department are not saved as separate tags, and the session
// tag passed in the request takes precedence over the role tag.
Tags []types.Tag
noSmithyDocumentSerde
}
// Contains the response to a successful GetFederationToken request, including
// temporary Amazon Web Services credentials that can be used to make Amazon Web
// Services requests.
type GetFederationTokenOutput struct {
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security (or session) token. The size of the security token
// that STS API operations return is not fixed. We strongly recommend that you make
// no assumptions about the maximum size.
Credentials *types.Credentials
// Identifiers for the federated user associated with the credentials (such as
// arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob ). You can use
// the federated user's ARN in your resource-based policies, such as an Amazon S3
// bucket policy.
FederatedUser *types.FederatedUser
// A percentage value that indicates the packed size of the session policies and
// session tags combined passed in the request. The request fails if the packed
// size is greater than 100 percent, which means the policies and tags exceeded the
// allowed space.
PackedPolicySize *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetFederationToken{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetFederationToken{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetFederationTokenValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFederationToken(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetFederationToken(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sts",
OperationName: "GetFederationToken",
}
}
| 309 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"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/sts/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a set of temporary credentials for an Amazon Web Services account or
// IAM user. The credentials consist of an access key ID, a secret access key, and
// a security token. Typically, you use GetSessionToken if you want to use MFA to
// protect programmatic calls to specific Amazon Web Services API operations like
// Amazon EC2 StopInstances . MFA-enabled IAM users must call GetSessionToken and
// submit an MFA code that is associated with their MFA device. Using the temporary
// security credentials that the call returns, IAM users can then make programmatic
// calls to API operations that require MFA authentication. An incorrect MFA code
// causes the API to return an access denied error. For a comparison of
// GetSessionToken with the other API operations that produce temporary
// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
// in the IAM User Guide. No permissions are required for users to perform this
// operation. The purpose of the sts:GetSessionToken operation is to authenticate
// the user using MFA. You cannot use policies to control authentication
// operations. For more information, see Permissions for GetSessionToken (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html)
// in the IAM User Guide. Session Duration The GetSessionToken operation must be
// called by using the long-term Amazon Web Services security credentials of an IAM
// user. Credentials that are created by IAM users are valid for the duration that
// you specify. This duration can range from 900 seconds (15 minutes) up to a
// maximum of 129,600 seconds (36 hours), with a default of 43,200 seconds (12
// hours). Credentials based on account credentials can range from 900 seconds (15
// minutes) up to 3,600 seconds (1 hour), with a default of 1 hour. Permissions The
// temporary security credentials created by GetSessionToken can be used to make
// API calls to any Amazon Web Services service with the following exceptions:
// - You cannot call any IAM API operations unless MFA authentication
// information is included in the request.
// - You cannot call any STS API except AssumeRole or GetCallerIdentity .
//
// The credentials that GetSessionToken returns are based on permissions
// associated with the IAM user whose credentials were used to call the operation.
// The temporary credentials have the same permissions as the IAM user. Although it
// is possible to call GetSessionToken using the security credentials of an Amazon
// Web Services account root user rather than an IAM user, we do not recommend it.
// If GetSessionToken is called using root user credentials, the temporary
// credentials have root user permissions. For more information, see Safeguard
// your root user credentials and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)
// in the IAM User Guide For more information about using GetSessionToken to
// create temporary credentials, see Temporary Credentials for Users in Untrusted
// Environments (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken)
// in the IAM User Guide.
func (c *Client) GetSessionToken(ctx context.Context, params *GetSessionTokenInput, optFns ...func(*Options)) (*GetSessionTokenOutput, error) {
if params == nil {
params = &GetSessionTokenInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSessionToken", params, optFns, c.addOperationGetSessionTokenMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSessionTokenOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSessionTokenInput struct {
// The duration, in seconds, that the credentials should remain valid. Acceptable
// durations for IAM user sessions range from 900 seconds (15 minutes) to 129,600
// seconds (36 hours), with 43,200 seconds (12 hours) as the default. Sessions for
// Amazon Web Services account owners are restricted to a maximum of 3,600 seconds
// (one hour). If the duration is longer than one hour, the session for Amazon Web
// Services account owners defaults to one hour.
DurationSeconds *int32
// The identification number of the MFA device that is associated with the IAM
// user who is making the GetSessionToken call. Specify this value if the IAM user
// has a policy that requires MFA authentication. The value is either the serial
// number for a hardware device (such as GAHT12345678 ) or an Amazon Resource Name
// (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user ). You
// can find the device for an IAM user by going to the Amazon Web Services
// Management Console and viewing the user's security credentials. The regex used
// to validate this parameter is a string of characters consisting of upper- and
// lower-case alphanumeric characters with no spaces. You can also include
// underscores or any of the following characters: =,.@:/-
SerialNumber *string
// The value provided by the MFA device, if MFA is required. If any policy
// requires the IAM user to submit an MFA code, specify this value. If MFA
// authentication is required, the user must provide a code when requesting a set
// of temporary security credentials. A user who fails to provide the code receives
// an "access denied" response when requesting resources that require MFA
// authentication. The format for this parameter, as described by its regex
// pattern, is a sequence of six numeric digits.
TokenCode *string
noSmithyDocumentSerde
}
// Contains the response to a successful GetSessionToken request, including
// temporary Amazon Web Services credentials that can be used to make Amazon Web
// Services requests.
type GetSessionTokenOutput struct {
// The temporary security credentials, which include an access key ID, a secret
// access key, and a security (or session) token. The size of the security token
// that STS API operations return is not fixed. We strongly recommend that you make
// no assumptions about the maximum size.
Credentials *types.Credentials
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetSessionToken{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetSessionToken{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opGetSessionToken(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetSessionToken(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "sts",
OperationName: "GetSessionToken",
}
}
| 192 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"bytes"
"context"
"encoding/xml"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
awsxml "github.com/aws/aws-sdk-go-v2/aws/protocol/xml"
"github.com/aws/aws-sdk-go-v2/service/sts/types"
smithy "github.com/aws/smithy-go"
smithyxml "github.com/aws/smithy-go/encoding/xml"
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"
"strconv"
"strings"
)
type awsAwsquery_deserializeOpAssumeRole struct {
}
func (*awsAwsquery_deserializeOpAssumeRole) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsquery_deserializeOpAssumeRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsquery_deserializeOpErrorAssumeRole(response, &metadata)
}
output := &AssumeRoleOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("AssumeRoleResult")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeOpDocumentAssumeRoleOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
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 awsAwsquery_deserializeOpErrorAssumeRole(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)
if err != nil {
return err
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("ExpiredTokenException", errorCode):
return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody)
case strings.EqualFold("MalformedPolicyDocument", errorCode):
return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody)
case strings.EqualFold("PackedPolicyTooLarge", errorCode):
return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody)
case strings.EqualFold("RegionDisabledException", errorCode):
return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsquery_deserializeOpAssumeRoleWithSAML struct {
}
func (*awsAwsquery_deserializeOpAssumeRoleWithSAML) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsquery_deserializeOpAssumeRoleWithSAML) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsquery_deserializeOpErrorAssumeRoleWithSAML(response, &metadata)
}
output := &AssumeRoleWithSAMLOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("AssumeRoleWithSAMLResult")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
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 awsAwsquery_deserializeOpErrorAssumeRoleWithSAML(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)
if err != nil {
return err
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("ExpiredTokenException", errorCode):
return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody)
case strings.EqualFold("IDPRejectedClaim", errorCode):
return awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody)
case strings.EqualFold("InvalidIdentityToken", errorCode):
return awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody)
case strings.EqualFold("MalformedPolicyDocument", errorCode):
return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody)
case strings.EqualFold("PackedPolicyTooLarge", errorCode):
return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody)
case strings.EqualFold("RegionDisabledException", errorCode):
return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsquery_deserializeOpAssumeRoleWithWebIdentity struct {
}
func (*awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(response, &metadata)
}
output := &AssumeRoleWithWebIdentityOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("AssumeRoleWithWebIdentityResult")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
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 awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)
if err != nil {
return err
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("ExpiredTokenException", errorCode):
return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody)
case strings.EqualFold("IDPCommunicationError", errorCode):
return awsAwsquery_deserializeErrorIDPCommunicationErrorException(response, errorBody)
case strings.EqualFold("IDPRejectedClaim", errorCode):
return awsAwsquery_deserializeErrorIDPRejectedClaimException(response, errorBody)
case strings.EqualFold("InvalidIdentityToken", errorCode):
return awsAwsquery_deserializeErrorInvalidIdentityTokenException(response, errorBody)
case strings.EqualFold("MalformedPolicyDocument", errorCode):
return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody)
case strings.EqualFold("PackedPolicyTooLarge", errorCode):
return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody)
case strings.EqualFold("RegionDisabledException", errorCode):
return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsquery_deserializeOpDecodeAuthorizationMessage struct {
}
func (*awsAwsquery_deserializeOpDecodeAuthorizationMessage) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsquery_deserializeOpDecodeAuthorizationMessage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsquery_deserializeOpErrorDecodeAuthorizationMessage(response, &metadata)
}
output := &DecodeAuthorizationMessageOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("DecodeAuthorizationMessageResult")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeOpDocumentDecodeAuthorizationMessageOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
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 awsAwsquery_deserializeOpErrorDecodeAuthorizationMessage(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)
if err != nil {
return err
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("InvalidAuthorizationMessageException", errorCode):
return awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsquery_deserializeOpGetAccessKeyInfo struct {
}
func (*awsAwsquery_deserializeOpGetAccessKeyInfo) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsquery_deserializeOpGetAccessKeyInfo) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsquery_deserializeOpErrorGetAccessKeyInfo(response, &metadata)
}
output := &GetAccessKeyInfoOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("GetAccessKeyInfoResult")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeOpDocumentGetAccessKeyInfoOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
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 awsAwsquery_deserializeOpErrorGetAccessKeyInfo(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)
if err != nil {
return err
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsquery_deserializeOpGetCallerIdentity struct {
}
func (*awsAwsquery_deserializeOpGetCallerIdentity) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsquery_deserializeOpGetCallerIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsquery_deserializeOpErrorGetCallerIdentity(response, &metadata)
}
output := &GetCallerIdentityOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("GetCallerIdentityResult")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeOpDocumentGetCallerIdentityOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
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 awsAwsquery_deserializeOpErrorGetCallerIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)
if err != nil {
return err
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsquery_deserializeOpGetFederationToken struct {
}
func (*awsAwsquery_deserializeOpGetFederationToken) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsquery_deserializeOpGetFederationToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsquery_deserializeOpErrorGetFederationToken(response, &metadata)
}
output := &GetFederationTokenOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("GetFederationTokenResult")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
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 awsAwsquery_deserializeOpErrorGetFederationToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)
if err != nil {
return err
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("MalformedPolicyDocument", errorCode):
return awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response, errorBody)
case strings.EqualFold("PackedPolicyTooLarge", errorCode):
return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody)
case strings.EqualFold("RegionDisabledException", errorCode):
return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsquery_deserializeOpGetSessionToken struct {
}
func (*awsAwsquery_deserializeOpGetSessionToken) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsquery_deserializeOpGetSessionToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsquery_deserializeOpErrorGetSessionToken(response, &metadata)
}
output := &GetSessionTokenOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return out, metadata, nil
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("GetSessionTokenResult")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
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 awsAwsquery_deserializeOpErrorGetSessionToken(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)
if err != nil {
return err
}
if reqID := errorComponents.RequestID; len(reqID) != 0 {
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
}
if len(errorComponents.Code) != 0 {
errorCode = errorComponents.Code
}
if len(errorComponents.Message) != 0 {
errorMessage = errorComponents.Message
}
errorBody.Seek(0, io.SeekStart)
switch {
case strings.EqualFold("RegionDisabledException", errorCode):
return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsquery_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ExpiredTokenException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeDocumentExpiredTokenException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsAwsquery_deserializeErrorIDPCommunicationErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.IDPCommunicationErrorException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeDocumentIDPCommunicationErrorException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsAwsquery_deserializeErrorIDPRejectedClaimException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.IDPRejectedClaimException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeDocumentIDPRejectedClaimException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidAuthorizationMessageException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsAwsquery_deserializeErrorInvalidIdentityTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidIdentityTokenException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeDocumentInvalidIdentityTokenException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.MalformedPolicyDocumentException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.PackedPolicyTooLargeException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsAwsquery_deserializeErrorRegionDisabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.RegionDisabledException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
rootDecoder := xml.NewDecoder(body)
t, err := smithyxml.FetchRootElement(rootDecoder)
if err == io.EOF {
return output
}
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
t, err = decoder.GetElement("Error")
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
err = awsAwsquery_deserializeDocumentRegionDisabledException(&output, decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return output
}
func awsAwsquery_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.AssumedRoleUser
if *v == nil {
sv = &types.AssumedRoleUser{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Arn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Arn = ptr.String(xtv)
}
case strings.EqualFold("AssumedRoleId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.AssumedRoleId = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentCredentials(v **types.Credentials, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.Credentials
if *v == nil {
sv = &types.Credentials{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AccessKeyId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.AccessKeyId = ptr.String(xtv)
}
case strings.EqualFold("Expiration", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
t, err := smithytime.ParseDateTime(xtv)
if err != nil {
return err
}
sv.Expiration = ptr.Time(t)
}
case strings.EqualFold("SecretAccessKey", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SecretAccessKey = ptr.String(xtv)
}
case strings.EqualFold("SessionToken", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SessionToken = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.ExpiredTokenException
if *v == nil {
sv = &types.ExpiredTokenException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentFederatedUser(v **types.FederatedUser, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.FederatedUser
if *v == nil {
sv = &types.FederatedUser{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Arn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Arn = ptr.String(xtv)
}
case strings.EqualFold("FederatedUserId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.FederatedUserId = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentIDPCommunicationErrorException(v **types.IDPCommunicationErrorException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.IDPCommunicationErrorException
if *v == nil {
sv = &types.IDPCommunicationErrorException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentIDPRejectedClaimException(v **types.IDPRejectedClaimException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.IDPRejectedClaimException
if *v == nil {
sv = &types.IDPRejectedClaimException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(v **types.InvalidAuthorizationMessageException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.InvalidAuthorizationMessageException
if *v == nil {
sv = &types.InvalidAuthorizationMessageException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentInvalidIdentityTokenException(v **types.InvalidIdentityTokenException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.InvalidIdentityTokenException
if *v == nil {
sv = &types.InvalidIdentityTokenException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.MalformedPolicyDocumentException
if *v == nil {
sv = &types.MalformedPolicyDocumentException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(v **types.PackedPolicyTooLargeException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.PackedPolicyTooLargeException
if *v == nil {
sv = &types.PackedPolicyTooLargeException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeDocumentRegionDisabledException(v **types.RegionDisabledException, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *types.RegionDisabledException
if *v == nil {
sv = &types.RegionDisabledException{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("message", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Message = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeOpDocumentAssumeRoleOutput(v **AssumeRoleOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *AssumeRoleOutput
if *v == nil {
sv = &AssumeRoleOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AssumedRoleUser", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Credentials", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("PackedPolicySize", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.PackedPolicySize = ptr.Int32(int32(i64))
}
case strings.EqualFold("SourceIdentity", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SourceIdentity = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(v **AssumeRoleWithSAMLOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *AssumeRoleWithSAMLOutput
if *v == nil {
sv = &AssumeRoleWithSAMLOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AssumedRoleUser", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Audience", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Audience = ptr.String(xtv)
}
case strings.EqualFold("Credentials", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Issuer", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Issuer = ptr.String(xtv)
}
case strings.EqualFold("NameQualifier", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.NameQualifier = ptr.String(xtv)
}
case strings.EqualFold("PackedPolicySize", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.PackedPolicySize = ptr.Int32(int32(i64))
}
case strings.EqualFold("SourceIdentity", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SourceIdentity = ptr.String(xtv)
}
case strings.EqualFold("Subject", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Subject = ptr.String(xtv)
}
case strings.EqualFold("SubjectType", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SubjectType = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(v **AssumeRoleWithWebIdentityOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *AssumeRoleWithWebIdentityOutput
if *v == nil {
sv = &AssumeRoleWithWebIdentityOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("AssumedRoleUser", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsAwsquery_deserializeDocumentAssumedRoleUser(&sv.AssumedRoleUser, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("Audience", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Audience = ptr.String(xtv)
}
case strings.EqualFold("Credentials", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("PackedPolicySize", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.PackedPolicySize = ptr.Int32(int32(i64))
}
case strings.EqualFold("Provider", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Provider = ptr.String(xtv)
}
case strings.EqualFold("SourceIdentity", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SourceIdentity = ptr.String(xtv)
}
case strings.EqualFold("SubjectFromWebIdentityToken", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.SubjectFromWebIdentityToken = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeOpDocumentDecodeAuthorizationMessageOutput(v **DecodeAuthorizationMessageOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *DecodeAuthorizationMessageOutput
if *v == nil {
sv = &DecodeAuthorizationMessageOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("DecodedMessage", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.DecodedMessage = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeOpDocumentGetAccessKeyInfoOutput(v **GetAccessKeyInfoOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetAccessKeyInfoOutput
if *v == nil {
sv = &GetAccessKeyInfoOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Account", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Account = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeOpDocumentGetCallerIdentityOutput(v **GetCallerIdentityOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetCallerIdentityOutput
if *v == nil {
sv = &GetCallerIdentityOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Account", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Account = ptr.String(xtv)
}
case strings.EqualFold("Arn", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.Arn = ptr.String(xtv)
}
case strings.EqualFold("UserId", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
sv.UserId = ptr.String(xtv)
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(v **GetFederationTokenOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetFederationTokenOutput
if *v == nil {
sv = &GetFederationTokenOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Credentials", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("FederatedUser", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsAwsquery_deserializeDocumentFederatedUser(&sv.FederatedUser, nodeDecoder); err != nil {
return err
}
case strings.EqualFold("PackedPolicySize", t.Name.Local):
val, err := decoder.Value()
if err != nil {
return err
}
if val == nil {
break
}
{
xtv := string(val)
i64, err := strconv.ParseInt(xtv, 10, 64)
if err != nil {
return err
}
sv.PackedPolicySize = ptr.Int32(int32(i64))
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
func awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(v **GetSessionTokenOutput, decoder smithyxml.NodeDecoder) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
var sv *GetSessionTokenOutput
if *v == nil {
sv = &GetSessionTokenOutput{}
} else {
sv = *v
}
for {
t, done, err := decoder.Token()
if err != nil {
return err
}
if done {
break
}
originalDecoder := decoder
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
switch {
case strings.EqualFold("Credentials", t.Name.Local):
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {
return err
}
default:
// Do nothing and ignore the unexpected tag element
err = decoder.Decoder.Skip()
if err != nil {
return err
}
}
decoder = originalDecoder
}
*v = sv
return nil
}
| 2,508 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package sts provides the API client, operations, and parameter types for AWS
// Security Token Service.
//
// Security Token Service Security Token Service (STS) enables you to request
// temporary, limited-privilege credentials for users. This guide provides
// descriptions of the STS API. For more information about using this service, see
// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
// .
package sts
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
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/sts/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 = "sts"
}
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 sts
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.19.2"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/query"
"github.com/aws/aws-sdk-go-v2/service/sts/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"path"
)
type awsAwsquery_serializeOpAssumeRole struct {
}
func (*awsAwsquery_serializeOpAssumeRole) ID() string {
return "OperationSerializer"
}
func (m *awsAwsquery_serializeOpAssumeRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssumeRoleInput)
_ = 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-www-form-urlencoded")
bodyWriter := bytes.NewBuffer(nil)
bodyEncoder := query.NewEncoder(bodyWriter)
body := bodyEncoder.Object()
body.Key("Action").String("AssumeRole")
body.Key("Version").String("2011-06-15")
if err := awsAwsquery_serializeOpDocumentAssumeRoleInput(input, bodyEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
err = bodyEncoder.Encode()
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpAssumeRoleWithSAML struct {
}
func (*awsAwsquery_serializeOpAssumeRoleWithSAML) ID() string {
return "OperationSerializer"
}
func (m *awsAwsquery_serializeOpAssumeRoleWithSAML) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssumeRoleWithSAMLInput)
_ = 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-www-form-urlencoded")
bodyWriter := bytes.NewBuffer(nil)
bodyEncoder := query.NewEncoder(bodyWriter)
body := bodyEncoder.Object()
body.Key("Action").String("AssumeRoleWithSAML")
body.Key("Version").String("2011-06-15")
if err := awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(input, bodyEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
err = bodyEncoder.Encode()
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpAssumeRoleWithWebIdentity struct {
}
func (*awsAwsquery_serializeOpAssumeRoleWithWebIdentity) ID() string {
return "OperationSerializer"
}
func (m *awsAwsquery_serializeOpAssumeRoleWithWebIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssumeRoleWithWebIdentityInput)
_ = 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-www-form-urlencoded")
bodyWriter := bytes.NewBuffer(nil)
bodyEncoder := query.NewEncoder(bodyWriter)
body := bodyEncoder.Object()
body.Key("Action").String("AssumeRoleWithWebIdentity")
body.Key("Version").String("2011-06-15")
if err := awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(input, bodyEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
err = bodyEncoder.Encode()
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpDecodeAuthorizationMessage struct {
}
func (*awsAwsquery_serializeOpDecodeAuthorizationMessage) ID() string {
return "OperationSerializer"
}
func (m *awsAwsquery_serializeOpDecodeAuthorizationMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DecodeAuthorizationMessageInput)
_ = 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-www-form-urlencoded")
bodyWriter := bytes.NewBuffer(nil)
bodyEncoder := query.NewEncoder(bodyWriter)
body := bodyEncoder.Object()
body.Key("Action").String("DecodeAuthorizationMessage")
body.Key("Version").String("2011-06-15")
if err := awsAwsquery_serializeOpDocumentDecodeAuthorizationMessageInput(input, bodyEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
err = bodyEncoder.Encode()
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpGetAccessKeyInfo struct {
}
func (*awsAwsquery_serializeOpGetAccessKeyInfo) ID() string {
return "OperationSerializer"
}
func (m *awsAwsquery_serializeOpGetAccessKeyInfo) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetAccessKeyInfoInput)
_ = 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-www-form-urlencoded")
bodyWriter := bytes.NewBuffer(nil)
bodyEncoder := query.NewEncoder(bodyWriter)
body := bodyEncoder.Object()
body.Key("Action").String("GetAccessKeyInfo")
body.Key("Version").String("2011-06-15")
if err := awsAwsquery_serializeOpDocumentGetAccessKeyInfoInput(input, bodyEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
err = bodyEncoder.Encode()
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpGetCallerIdentity struct {
}
func (*awsAwsquery_serializeOpGetCallerIdentity) ID() string {
return "OperationSerializer"
}
func (m *awsAwsquery_serializeOpGetCallerIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetCallerIdentityInput)
_ = 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-www-form-urlencoded")
bodyWriter := bytes.NewBuffer(nil)
bodyEncoder := query.NewEncoder(bodyWriter)
body := bodyEncoder.Object()
body.Key("Action").String("GetCallerIdentity")
body.Key("Version").String("2011-06-15")
err = bodyEncoder.Encode()
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpGetFederationToken struct {
}
func (*awsAwsquery_serializeOpGetFederationToken) ID() string {
return "OperationSerializer"
}
func (m *awsAwsquery_serializeOpGetFederationToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetFederationTokenInput)
_ = 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-www-form-urlencoded")
bodyWriter := bytes.NewBuffer(nil)
bodyEncoder := query.NewEncoder(bodyWriter)
body := bodyEncoder.Object()
body.Key("Action").String("GetFederationToken")
body.Key("Version").String("2011-06-15")
if err := awsAwsquery_serializeOpDocumentGetFederationTokenInput(input, bodyEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
err = bodyEncoder.Encode()
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeOpGetSessionToken struct {
}
func (*awsAwsquery_serializeOpGetSessionToken) ID() string {
return "OperationSerializer"
}
func (m *awsAwsquery_serializeOpGetSessionToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSessionTokenInput)
_ = 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-www-form-urlencoded")
bodyWriter := bytes.NewBuffer(nil)
bodyEncoder := query.NewEncoder(bodyWriter)
body := bodyEncoder.Object()
body.Key("Action").String("GetSessionToken")
body.Key("Version").String("2011-06-15")
if err := awsAwsquery_serializeOpDocumentGetSessionTokenInput(input, bodyEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
err = bodyEncoder.Encode()
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsAwsquery_serializeDocumentPolicyDescriptorListType(v []types.PolicyDescriptorType, value query.Value) error {
array := value.Array("member")
for i := range v {
av := array.Value()
if err := awsAwsquery_serializeDocumentPolicyDescriptorType(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsquery_serializeDocumentPolicyDescriptorType(v *types.PolicyDescriptorType, value query.Value) error {
object := value.Object()
_ = object
if v.Arn != nil {
objectKey := object.Key("arn")
objectKey.String(*v.Arn)
}
return nil
}
func awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error {
object := value.Object()
_ = object
if v.Key != nil {
objectKey := object.Key("Key")
objectKey.String(*v.Key)
}
if v.Value != nil {
objectKey := object.Key("Value")
objectKey.String(*v.Value)
}
return nil
}
func awsAwsquery_serializeDocumentTagKeyListType(v []string, value query.Value) error {
array := value.Array("member")
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsquery_serializeDocumentTagListType(v []types.Tag, value query.Value) error {
array := value.Array("member")
for i := range v {
av := array.Value()
if err := awsAwsquery_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value query.Value) error {
object := value.Object()
_ = object
if v.DurationSeconds != nil {
objectKey := object.Key("DurationSeconds")
objectKey.Integer(*v.DurationSeconds)
}
if v.ExternalId != nil {
objectKey := object.Key("ExternalId")
objectKey.String(*v.ExternalId)
}
if v.Policy != nil {
objectKey := object.Key("Policy")
objectKey.String(*v.Policy)
}
if v.PolicyArns != nil {
objectKey := object.Key("PolicyArns")
if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil {
return err
}
}
if v.RoleArn != nil {
objectKey := object.Key("RoleArn")
objectKey.String(*v.RoleArn)
}
if v.RoleSessionName != nil {
objectKey := object.Key("RoleSessionName")
objectKey.String(*v.RoleSessionName)
}
if v.SerialNumber != nil {
objectKey := object.Key("SerialNumber")
objectKey.String(*v.SerialNumber)
}
if v.SourceIdentity != nil {
objectKey := object.Key("SourceIdentity")
objectKey.String(*v.SourceIdentity)
}
if v.Tags != nil {
objectKey := object.Key("Tags")
if err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil {
return err
}
}
if v.TokenCode != nil {
objectKey := object.Key("TokenCode")
objectKey.String(*v.TokenCode)
}
if v.TransitiveTagKeys != nil {
objectKey := object.Key("TransitiveTagKeys")
if err := awsAwsquery_serializeDocumentTagKeyListType(v.TransitiveTagKeys, objectKey); err != nil {
return err
}
}
return nil
}
func awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(v *AssumeRoleWithSAMLInput, value query.Value) error {
object := value.Object()
_ = object
if v.DurationSeconds != nil {
objectKey := object.Key("DurationSeconds")
objectKey.Integer(*v.DurationSeconds)
}
if v.Policy != nil {
objectKey := object.Key("Policy")
objectKey.String(*v.Policy)
}
if v.PolicyArns != nil {
objectKey := object.Key("PolicyArns")
if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil {
return err
}
}
if v.PrincipalArn != nil {
objectKey := object.Key("PrincipalArn")
objectKey.String(*v.PrincipalArn)
}
if v.RoleArn != nil {
objectKey := object.Key("RoleArn")
objectKey.String(*v.RoleArn)
}
if v.SAMLAssertion != nil {
objectKey := object.Key("SAMLAssertion")
objectKey.String(*v.SAMLAssertion)
}
return nil
}
func awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(v *AssumeRoleWithWebIdentityInput, value query.Value) error {
object := value.Object()
_ = object
if v.DurationSeconds != nil {
objectKey := object.Key("DurationSeconds")
objectKey.Integer(*v.DurationSeconds)
}
if v.Policy != nil {
objectKey := object.Key("Policy")
objectKey.String(*v.Policy)
}
if v.PolicyArns != nil {
objectKey := object.Key("PolicyArns")
if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil {
return err
}
}
if v.ProviderId != nil {
objectKey := object.Key("ProviderId")
objectKey.String(*v.ProviderId)
}
if v.RoleArn != nil {
objectKey := object.Key("RoleArn")
objectKey.String(*v.RoleArn)
}
if v.RoleSessionName != nil {
objectKey := object.Key("RoleSessionName")
objectKey.String(*v.RoleSessionName)
}
if v.WebIdentityToken != nil {
objectKey := object.Key("WebIdentityToken")
objectKey.String(*v.WebIdentityToken)
}
return nil
}
func awsAwsquery_serializeOpDocumentDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput, value query.Value) error {
object := value.Object()
_ = object
if v.EncodedMessage != nil {
objectKey := object.Key("EncodedMessage")
objectKey.String(*v.EncodedMessage)
}
return nil
}
func awsAwsquery_serializeOpDocumentGetAccessKeyInfoInput(v *GetAccessKeyInfoInput, value query.Value) error {
object := value.Object()
_ = object
if v.AccessKeyId != nil {
objectKey := object.Key("AccessKeyId")
objectKey.String(*v.AccessKeyId)
}
return nil
}
func awsAwsquery_serializeOpDocumentGetCallerIdentityInput(v *GetCallerIdentityInput, value query.Value) error {
object := value.Object()
_ = object
return nil
}
func awsAwsquery_serializeOpDocumentGetFederationTokenInput(v *GetFederationTokenInput, value query.Value) error {
object := value.Object()
_ = object
if v.DurationSeconds != nil {
objectKey := object.Key("DurationSeconds")
objectKey.Integer(*v.DurationSeconds)
}
if v.Name != nil {
objectKey := object.Key("Name")
objectKey.String(*v.Name)
}
if v.Policy != nil {
objectKey := object.Key("Policy")
objectKey.String(*v.Policy)
}
if v.PolicyArns != nil {
objectKey := object.Key("PolicyArns")
if err := awsAwsquery_serializeDocumentPolicyDescriptorListType(v.PolicyArns, objectKey); err != nil {
return err
}
}
if v.Tags != nil {
objectKey := object.Key("Tags")
if err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil {
return err
}
}
return nil
}
func awsAwsquery_serializeOpDocumentGetSessionTokenInput(v *GetSessionTokenInput, value query.Value) error {
object := value.Object()
_ = object
if v.DurationSeconds != nil {
objectKey := object.Key("DurationSeconds")
objectKey.Integer(*v.DurationSeconds)
}
if v.SerialNumber != nil {
objectKey := object.Key("SerialNumber")
objectKey.String(*v.SerialNumber)
}
if v.TokenCode != nil {
objectKey := object.Key("TokenCode")
objectKey.String(*v.TokenCode)
}
return nil
}
| 827 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sts
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/sts/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAssumeRole struct {
}
func (*validateOpAssumeRole) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssumeRole) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssumeRoleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssumeRoleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAssumeRoleWithSAML struct {
}
func (*validateOpAssumeRoleWithSAML) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssumeRoleWithSAML) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssumeRoleWithSAMLInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssumeRoleWithSAMLInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAssumeRoleWithWebIdentity struct {
}
func (*validateOpAssumeRoleWithWebIdentity) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssumeRoleWithWebIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssumeRoleWithWebIdentityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssumeRoleWithWebIdentityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDecodeAuthorizationMessage struct {
}
func (*validateOpDecodeAuthorizationMessage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDecodeAuthorizationMessage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DecodeAuthorizationMessageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDecodeAuthorizationMessageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAccessKeyInfo struct {
}
func (*validateOpGetAccessKeyInfo) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAccessKeyInfo) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAccessKeyInfoInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAccessKeyInfoInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFederationToken struct {
}
func (*validateOpGetFederationToken) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFederationToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFederationTokenInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFederationTokenInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAssumeRoleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssumeRole{}, middleware.After)
}
func addOpAssumeRoleWithSAMLValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssumeRoleWithSAML{}, middleware.After)
}
func addOpAssumeRoleWithWebIdentityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssumeRoleWithWebIdentity{}, middleware.After)
}
func addOpDecodeAuthorizationMessageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDecodeAuthorizationMessage{}, middleware.After)
}
func addOpGetAccessKeyInfoValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAccessKeyInfo{}, middleware.After)
}
func addOpGetFederationTokenValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFederationToken{}, middleware.After)
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTagListType(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagListType"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssumeRoleInput(v *AssumeRoleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleInput"}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.RoleSessionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleSessionName"))
}
if v.Tags != nil {
if err := validateTagListType(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssumeRoleWithSAMLInput(v *AssumeRoleWithSAMLInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleWithSAMLInput"}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.PrincipalArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("PrincipalArn"))
}
if v.SAMLAssertion == nil {
invalidParams.Add(smithy.NewErrParamRequired("SAMLAssertion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssumeRoleWithWebIdentityInput(v *AssumeRoleWithWebIdentityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssumeRoleWithWebIdentityInput"}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.RoleSessionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleSessionName"))
}
if v.WebIdentityToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebIdentityToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DecodeAuthorizationMessageInput"}
if v.EncodedMessage == nil {
invalidParams.Add(smithy.NewErrParamRequired("EncodedMessage"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAccessKeyInfoInput(v *GetAccessKeyInfoInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAccessKeyInfoInput"}
if v.AccessKeyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccessKeyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFederationTokenInput(v *GetFederationTokenInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFederationTokenInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Tags != nil {
if err := validateTagListType(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 306 |
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 STS 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: "sts.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "sts-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "sts.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-4",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "aws-global",
}: endpoints.Endpoint{
Hostname: "sts.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "me-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-1-fips",
}: endpoints.Endpoint{
Hostname: "sts-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2-fips",
}: endpoints.Endpoint{
Hostname: "sts-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1-fips",
}: endpoints.Endpoint{
Hostname: "sts-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts-fips.us-west-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2-fips",
}: endpoints.Endpoint{
Hostname: "sts-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "sts.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "sts-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "sts.{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: "sts-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "sts.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-iso-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-iso-west-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "sts.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-isob-east-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "sts.{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: "sts-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "sts.{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: "sts.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "sts-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "sts.{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-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts.us-gov-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-east-1-fips",
}: endpoints.Endpoint{
Hostname: "sts.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "sts.us-gov-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1-fips",
}: endpoints.Endpoint{
Hostname: "sts.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
},
},
}
| 507 |
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
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// The web identity token that was passed is expired or is not valid. Get a new
// identity token from the identity provider and then retry the request.
type ExpiredTokenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ExpiredTokenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ExpiredTokenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ExpiredTokenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ExpiredTokenException"
}
return *e.ErrorCodeOverride
}
func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request could not be fulfilled because the identity provider (IDP) that was
// asked to verify the incoming identity token could not be reached. This is often
// a transient error caused by network conditions. Retry the request a limited
// number of times so that you don't exceed the request rate. If the error
// persists, the identity provider might be down or not responding.
type IDPCommunicationErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *IDPCommunicationErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *IDPCommunicationErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *IDPCommunicationErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "IDPCommunicationError"
}
return *e.ErrorCodeOverride
}
func (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The identity provider (IdP) reported that authentication failed. This might be
// because the claim is invalid. If this error is returned for the
// AssumeRoleWithWebIdentity operation, it can also mean that the claim has expired
// or has been explicitly revoked.
type IDPRejectedClaimException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *IDPRejectedClaimException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *IDPRejectedClaimException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *IDPRejectedClaimException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "IDPRejectedClaim"
}
return *e.ErrorCodeOverride
}
func (e *IDPRejectedClaimException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The error returned if the message passed to DecodeAuthorizationMessage was
// invalid. This can happen if the token contains invalid characters, such as
// linebreaks.
type InvalidAuthorizationMessageException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidAuthorizationMessageException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidAuthorizationMessageException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidAuthorizationMessageException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidAuthorizationMessageException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidAuthorizationMessageException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// The web identity token that was passed could not be validated by Amazon Web
// Services. Get a new identity token from the identity provider and then retry the
// request.
type InvalidIdentityTokenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidIdentityTokenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidIdentityTokenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidIdentityTokenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidIdentityToken"
}
return *e.ErrorCodeOverride
}
func (e *InvalidIdentityTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because the policy document was malformed. The error
// message describes the specific error.
type MalformedPolicyDocumentException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *MalformedPolicyDocumentException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *MalformedPolicyDocumentException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *MalformedPolicyDocumentException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "MalformedPolicyDocument"
}
return *e.ErrorCodeOverride
}
func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because the total packed size of the session policies
// and session tags combined was too large. An Amazon Web Services conversion
// compresses the session policy document, session policy ARNs, and session tags
// into a packed binary format that has a separate limit. The error message
// indicates by percentage how close the policies and tags are to the upper size
// limit. For more information, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
// in the IAM User Guide. You could receive this error even though you meet other
// defined session policy and session tag limits. For more information, see IAM
// and STS Entity Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length)
// in the IAM User Guide.
type PackedPolicyTooLargeException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *PackedPolicyTooLargeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *PackedPolicyTooLargeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *PackedPolicyTooLargeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "PackedPolicyTooLarge"
}
return *e.ErrorCodeOverride
}
func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// STS is not activated in the requested region for the account that is being
// asked to generate credentials. The account administrator must use the IAM
// console to activate STS in that region. For more information, see Activating
// and Deactivating Amazon Web Services STS in an Amazon Web Services Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
// in the IAM User Guide.
type RegionDisabledException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *RegionDisabledException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *RegionDisabledException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *RegionDisabledException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "RegionDisabledException"
}
return *e.ErrorCodeOverride
}
func (e *RegionDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 245 |
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 identifiers for the temporary security credentials that the operation
// returns.
type AssumedRoleUser struct {
// The ARN of the temporary security credentials that are returned from the
// AssumeRole action. For more information about ARNs and how to use them in
// policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
// in the IAM User Guide.
//
// This member is required.
Arn *string
// A unique identifier that contains the role ID and the role session name of the
// role that is being assumed. The role ID is generated by Amazon Web Services when
// the role is created.
//
// This member is required.
AssumedRoleId *string
noSmithyDocumentSerde
}
// Amazon Web Services credentials for API authentication.
type Credentials struct {
// The access key ID that identifies the temporary security credentials.
//
// This member is required.
AccessKeyId *string
// The date on which the current credentials expire.
//
// This member is required.
Expiration *time.Time
// The secret access key that can be used to sign requests.
//
// This member is required.
SecretAccessKey *string
// The token that users must pass to the service API to use the temporary
// credentials.
//
// This member is required.
SessionToken *string
noSmithyDocumentSerde
}
// Identifiers for the federated user that is associated with the credentials.
type FederatedUser struct {
// The ARN that specifies the federated user that is associated with the
// credentials. For more information about ARNs and how to use them in policies,
// see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
// in the IAM User Guide.
//
// This member is required.
Arn *string
// The string that identifies the federated user associated with the credentials,
// similar to the unique ID of an IAM user.
//
// This member is required.
FederatedUserId *string
noSmithyDocumentSerde
}
// A reference to the IAM managed policy that is passed as a session policy for a
// role session or a federated user session.
type PolicyDescriptorType struct {
// The Amazon Resource Name (ARN) of the IAM managed policy to use as a session
// policy for the role. For more information about ARNs, see Amazon Resource Names
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// in the Amazon Web Services General Reference.
Arn *string
noSmithyDocumentSerde
}
// You can pass custom key-value pair attributes when you assume a role or
// federate a user. These are called session tags. You can then use the session
// tags to control access to resources. For more information, see Tagging Amazon
// Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
// in the IAM User Guide.
type Tag struct {
// The key for a session tag. You can pass up to 50 session tags. The plain text
// session tag keys can’t exceed 128 characters. For these and additional limits,
// see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
// in the IAM User Guide.
//
// This member is required.
Key *string
// The value for a session tag. You can pass up to 50 session tags. The plain text
// session tag values can’t exceed 256 characters. For these and additional limits,
// see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
// in the IAM User Guide.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 119 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
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 = "Support"
const ServiceAPIVersion = "2013-04-15"
// Client provides the API client to make operations call for AWS Support.
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, "support", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
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 support
import (
"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/support/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds one or more attachments to an attachment set. An attachment set is a
// temporary container for attachments that you add to a case or case
// communication. The set is available for 1 hour after it's created. The
// expiryTime returned in the response is when the set expires.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
func (c *Client) AddAttachmentsToSet(ctx context.Context, params *AddAttachmentsToSetInput, optFns ...func(*Options)) (*AddAttachmentsToSetOutput, error) {
if params == nil {
params = &AddAttachmentsToSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddAttachmentsToSet", params, optFns, c.addOperationAddAttachmentsToSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddAttachmentsToSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddAttachmentsToSetInput struct {
// One or more attachments to add to the set. You can add up to three attachments
// per set. The size limit is 5 MB per attachment. In the Attachment object, use
// the data parameter to specify the contents of the attachment file. In the
// previous request syntax, the value for data appear as blob , which is
// represented as a base64-encoded string. The value for fileName is the name of
// the attachment, such as troubleshoot-screenshot.png .
//
// This member is required.
Attachments []types.Attachment
// The ID of the attachment set. If an attachmentSetId is not specified, a new
// attachment set is created, and the ID of the set is returned in the response. If
// an attachmentSetId is specified, the attachments are added to the specified
// set, if it exists.
AttachmentSetId *string
noSmithyDocumentSerde
}
// The ID and expiry time of the attachment set returned by the AddAttachmentsToSet
// operation.
type AddAttachmentsToSetOutput struct {
// The ID of the attachment set. If an attachmentSetId was not specified, a new
// attachment set is created, and the ID of the set is returned in the response. If
// an attachmentSetId was specified, the attachments are added to the specified
// set, if it exists.
AttachmentSetId *string
// The time and date when the attachment set expires.
ExpiryTime *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddAttachmentsToSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddAttachmentsToSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddAttachmentsToSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddAttachmentsToSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddAttachmentsToSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAddAttachmentsToSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "AddAttachmentsToSet",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"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 additional customer communication to an Amazon Web Services Support case.
// Use the caseId parameter to identify the case to which to add communication.
// You can list a set of email addresses to copy on the communication by using the
// ccEmailAddresses parameter. The communicationBody value contains the text of
// the communication.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
func (c *Client) AddCommunicationToCase(ctx context.Context, params *AddCommunicationToCaseInput, optFns ...func(*Options)) (*AddCommunicationToCaseOutput, error) {
if params == nil {
params = &AddCommunicationToCaseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddCommunicationToCase", params, optFns, c.addOperationAddCommunicationToCaseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddCommunicationToCaseOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddCommunicationToCaseInput struct {
// The body of an email communication to add to the support case.
//
// This member is required.
CommunicationBody *string
// The ID of a set of one or more attachments for the communication to add to the
// case. Create the set by calling AddAttachmentsToSet
AttachmentSetId *string
// The support case ID requested or returned in the call. The case ID is an
// alphanumeric string formatted as shown in this example:
// case-12345678910-2013-c4c1d2bf33c5cf47
CaseId *string
// The email addresses in the CC line of an email to be added to the support case.
CcEmailAddresses []string
noSmithyDocumentSerde
}
// The result of the AddCommunicationToCase operation.
type AddCommunicationToCaseOutput struct {
// True if AddCommunicationToCase succeeds. Otherwise, returns an error.
Result bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddCommunicationToCaseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddCommunicationToCase{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddCommunicationToCase{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddCommunicationToCaseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddCommunicationToCase(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAddCommunicationToCase(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "AddCommunicationToCase",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"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/support/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the attachment that has the specified ID. Attachments can include
// screenshots, error logs, or other files that describe your issue. Attachment IDs
// are generated by the case management system when you add an attachment to a case
// or case communication. Attachment IDs are returned in the AttachmentDetails
// objects that are returned by the DescribeCommunications operation.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
func (c *Client) DescribeAttachment(ctx context.Context, params *DescribeAttachmentInput, optFns ...func(*Options)) (*DescribeAttachmentOutput, error) {
if params == nil {
params = &DescribeAttachmentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeAttachment", params, optFns, c.addOperationDescribeAttachmentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeAttachmentOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeAttachmentInput struct {
// The ID of the attachment to return. Attachment IDs are returned by the
// DescribeCommunications operation.
//
// This member is required.
AttachmentId *string
noSmithyDocumentSerde
}
// The content and file name of the attachment returned by the DescribeAttachment
// operation.
type DescribeAttachmentOutput struct {
// This object includes the attachment content and file name. In the previous
// response syntax, the value for the data parameter appears as blob , which is
// represented as a base64-encoded string. The value for fileName is the name of
// the attachment, such as troubleshoot-screenshot.png .
Attachment *types.Attachment
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAttachment{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAttachment{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeAttachmentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAttachment(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeAttachment(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "DescribeAttachment",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
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/support/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns communications and attachments for one or more support cases. Use the
// afterTime and beforeTime parameters to filter by date. You can use the caseId
// parameter to restrict the results to a specific case. Case data is available for
// 12 months after creation. If a case was created more than 12 months ago, a
// request for data might cause an error. You can use the maxResults and nextToken
// parameters to control the pagination of the results. Set maxResults to the
// number of cases that you want to display on each page, and use nextToken to
// specify the resumption of pagination.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
func (c *Client) DescribeCommunications(ctx context.Context, params *DescribeCommunicationsInput, optFns ...func(*Options)) (*DescribeCommunicationsOutput, error) {
if params == nil {
params = &DescribeCommunicationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeCommunications", params, optFns, c.addOperationDescribeCommunicationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeCommunicationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeCommunicationsInput struct {
// The support case ID requested or returned in the call. The case ID is an
// alphanumeric string formatted as shown in this example:
// case-12345678910-2013-c4c1d2bf33c5cf47
//
// This member is required.
CaseId *string
// The start date for a filtered date search on support case communications. Case
// communications are available for 12 months after creation.
AfterTime *string
// The end date for a filtered date search on support case communications. Case
// communications are available for 12 months after creation.
BeforeTime *string
// The maximum number of results to return before paginating.
MaxResults *int32
// A resumption point for pagination.
NextToken *string
noSmithyDocumentSerde
}
// The communications returned by the DescribeCommunications operation.
type DescribeCommunicationsOutput struct {
// The communications for the case.
Communications []types.Communication
// A resumption point for pagination.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeCommunicationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCommunications{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCommunications{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeCommunicationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCommunications(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeCommunicationsAPIClient is a client that implements the
// DescribeCommunications operation.
type DescribeCommunicationsAPIClient interface {
DescribeCommunications(context.Context, *DescribeCommunicationsInput, ...func(*Options)) (*DescribeCommunicationsOutput, error)
}
var _ DescribeCommunicationsAPIClient = (*Client)(nil)
// DescribeCommunicationsPaginatorOptions is the paginator options for
// DescribeCommunications
type DescribeCommunicationsPaginatorOptions struct {
// The maximum number of results to return before paginating.
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
}
// DescribeCommunicationsPaginator is a paginator for DescribeCommunications
type DescribeCommunicationsPaginator struct {
options DescribeCommunicationsPaginatorOptions
client DescribeCommunicationsAPIClient
params *DescribeCommunicationsInput
nextToken *string
firstPage bool
}
// NewDescribeCommunicationsPaginator returns a new DescribeCommunicationsPaginator
func NewDescribeCommunicationsPaginator(client DescribeCommunicationsAPIClient, params *DescribeCommunicationsInput, optFns ...func(*DescribeCommunicationsPaginatorOptions)) *DescribeCommunicationsPaginator {
if params == nil {
params = &DescribeCommunicationsInput{}
}
options := DescribeCommunicationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &DescribeCommunicationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *DescribeCommunicationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next DescribeCommunications page.
func (p *DescribeCommunicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCommunicationsOutput, 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.DescribeCommunications(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opDescribeCommunications(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "DescribeCommunications",
}
}
| 251 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"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/support/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of supported languages for a specified categoryCode , issueType
// and serviceCode . The returned supported languages will include a ISO 639-1 code
// for the language , and the language display name.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
func (c *Client) DescribeSupportedLanguages(ctx context.Context, params *DescribeSupportedLanguagesInput, optFns ...func(*Options)) (*DescribeSupportedLanguagesOutput, error) {
if params == nil {
params = &DescribeSupportedLanguagesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSupportedLanguages", params, optFns, c.addOperationDescribeSupportedLanguagesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSupportedLanguagesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeSupportedLanguagesInput struct {
// The category of problem for the support case. You also use the DescribeServices
// operation to get the category code for a service. Each Amazon Web Services
// service defines its own set of category codes.
//
// This member is required.
CategoryCode *string
// The type of issue for the case. You can specify customer-service or technical .
//
// This member is required.
IssueType *string
// The code for the Amazon Web Services service. You can use the DescribeServices
// operation to get the possible serviceCode values.
//
// This member is required.
ServiceCode *string
noSmithyDocumentSerde
}
type DescribeSupportedLanguagesOutput struct {
// A JSON-formatted array that contains the available ISO 639-1 language codes.
SupportedLanguages []types.SupportedLanguage
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSupportedLanguagesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSupportedLanguages{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSupportedLanguages{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSupportedLanguagesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSupportedLanguages(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeSupportedLanguages(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "DescribeSupportedLanguages",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"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/support/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the refresh status of the Trusted Advisor checks that have the
// specified check IDs. You can get the check IDs by calling the
// DescribeTrustedAdvisorChecks operation. Some checks are refreshed automatically,
// and you can't return their refresh statuses by using the
// DescribeTrustedAdvisorCheckRefreshStatuses operation. If you call this operation
// for these checks, you might see an InvalidParameterValue error.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
//
// To call the Trusted Advisor operations in the Amazon Web Services Support API,
// you must use the US East (N. Virginia) endpoint. Currently, the US West (Oregon)
// and Europe (Ireland) endpoints don't support the Trusted Advisor operations. For
// more information, see About the Amazon Web Services Support API (https://docs.aws.amazon.com/awssupport/latest/user/about-support-api.html#endpoint)
// in the Amazon Web Services Support User Guide.
func (c *Client) DescribeTrustedAdvisorCheckRefreshStatuses(ctx context.Context, params *DescribeTrustedAdvisorCheckRefreshStatusesInput, optFns ...func(*Options)) (*DescribeTrustedAdvisorCheckRefreshStatusesOutput, error) {
if params == nil {
params = &DescribeTrustedAdvisorCheckRefreshStatusesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTrustedAdvisorCheckRefreshStatuses", params, optFns, c.addOperationDescribeTrustedAdvisorCheckRefreshStatusesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTrustedAdvisorCheckRefreshStatusesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTrustedAdvisorCheckRefreshStatusesInput struct {
// The IDs of the Trusted Advisor checks to get the status. If you specify the
// check ID of a check that is automatically refreshed, you might see an
// InvalidParameterValue error.
//
// This member is required.
CheckIds []*string
noSmithyDocumentSerde
}
// The statuses of the Trusted Advisor checks returned by the
// DescribeTrustedAdvisorCheckRefreshStatuses operation.
type DescribeTrustedAdvisorCheckRefreshStatusesOutput struct {
// The refresh status of the specified Trusted Advisor checks.
//
// This member is required.
Statuses []types.TrustedAdvisorCheckRefreshStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTrustedAdvisorCheckRefreshStatusesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeTrustedAdvisorCheckRefreshStatuses{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckRefreshStatuses{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTrustedAdvisorCheckRefreshStatusesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrustedAdvisorCheckRefreshStatuses(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeTrustedAdvisorCheckRefreshStatuses(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "DescribeTrustedAdvisorCheckRefreshStatuses",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"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/support/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the results of the Trusted Advisor check that has the specified check
// ID. You can get the check IDs by calling the DescribeTrustedAdvisorChecks
// operation. The response contains a TrustedAdvisorCheckResult object, which
// contains these three objects:
// - TrustedAdvisorCategorySpecificSummary
// - TrustedAdvisorResourceDetail
// - TrustedAdvisorResourcesSummary
//
// In addition, the response contains these fields:
//
// - status - The alert status of the check can be ok (green), warning (yellow),
// error (red), or not_available .
//
// - timestamp - The time of the last refresh of the check.
//
// - checkId - The unique identifier for the check.
//
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
//
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
//
// To call the Trusted Advisor operations in the Amazon Web Services Support API,
// you must use the US East (N. Virginia) endpoint. Currently, the US West (Oregon)
// and Europe (Ireland) endpoints don't support the Trusted Advisor operations. For
// more information, see About the Amazon Web Services Support API (https://docs.aws.amazon.com/awssupport/latest/user/about-support-api.html#endpoint)
// in the Amazon Web Services Support User Guide.
func (c *Client) DescribeTrustedAdvisorCheckResult(ctx context.Context, params *DescribeTrustedAdvisorCheckResultInput, optFns ...func(*Options)) (*DescribeTrustedAdvisorCheckResultOutput, error) {
if params == nil {
params = &DescribeTrustedAdvisorCheckResultInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTrustedAdvisorCheckResult", params, optFns, c.addOperationDescribeTrustedAdvisorCheckResultMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTrustedAdvisorCheckResultOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTrustedAdvisorCheckResultInput struct {
// The unique identifier for the Trusted Advisor check.
//
// This member is required.
CheckId *string
// The ISO 639-1 code for the language that you want your check results to appear
// in. The Amazon Web Services Support API currently supports the following
// languages for Trusted Advisor:
// - Chinese, Simplified - zh
// - Chinese, Traditional - zh_TW
// - English - en
// - French - fr
// - German - de
// - Indonesian - id
// - Italian - it
// - Japanese - ja
// - Korean - ko
// - Portuguese, Brazilian - pt_BR
// - Spanish - es
Language *string
noSmithyDocumentSerde
}
// The result of the Trusted Advisor check returned by the
// DescribeTrustedAdvisorCheckResult operation.
type DescribeTrustedAdvisorCheckResultOutput struct {
// The detailed results of the Trusted Advisor check.
Result *types.TrustedAdvisorCheckResult
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTrustedAdvisorCheckResultMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeTrustedAdvisorCheckResult{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckResult{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTrustedAdvisorCheckResultValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrustedAdvisorCheckResult(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeTrustedAdvisorCheckResult(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "DescribeTrustedAdvisorCheckResult",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"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/support/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about all available Trusted Advisor checks, including the
// name, ID, category, description, and metadata. You must specify a language code.
// The response contains a TrustedAdvisorCheckDescription object for each check.
// You must set the Amazon Web Services Region to us-east-1.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
// - The names and descriptions for Trusted Advisor checks are subject to
// change. We recommend that you specify the check ID in your code to uniquely
// identify a check.
//
// To call the Trusted Advisor operations in the Amazon Web Services Support API,
// you must use the US East (N. Virginia) endpoint. Currently, the US West (Oregon)
// and Europe (Ireland) endpoints don't support the Trusted Advisor operations. For
// more information, see About the Amazon Web Services Support API (https://docs.aws.amazon.com/awssupport/latest/user/about-support-api.html#endpoint)
// in the Amazon Web Services Support User Guide.
func (c *Client) DescribeTrustedAdvisorChecks(ctx context.Context, params *DescribeTrustedAdvisorChecksInput, optFns ...func(*Options)) (*DescribeTrustedAdvisorChecksOutput, error) {
if params == nil {
params = &DescribeTrustedAdvisorChecksInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTrustedAdvisorChecks", params, optFns, c.addOperationDescribeTrustedAdvisorChecksMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTrustedAdvisorChecksOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTrustedAdvisorChecksInput struct {
// The ISO 639-1 code for the language that you want your checks to appear in. The
// Amazon Web Services Support API currently supports the following languages for
// Trusted Advisor:
// - Chinese, Simplified - zh
// - Chinese, Traditional - zh_TW
// - English - en
// - French - fr
// - German - de
// - Indonesian - id
// - Italian - it
// - Japanese - ja
// - Korean - ko
// - Portuguese, Brazilian - pt_BR
// - Spanish - es
//
// This member is required.
Language *string
noSmithyDocumentSerde
}
// Information about the Trusted Advisor checks returned by the
// DescribeTrustedAdvisorChecks operation.
type DescribeTrustedAdvisorChecksOutput struct {
// Information about all available Trusted Advisor checks.
//
// This member is required.
Checks []types.TrustedAdvisorCheckDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTrustedAdvisorChecksMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeTrustedAdvisorChecks{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeTrustedAdvisorChecks{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTrustedAdvisorChecksValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrustedAdvisorChecks(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeTrustedAdvisorChecks(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "DescribeTrustedAdvisorChecks",
}
}
| 161 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"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/support/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the results for the Trusted Advisor check summaries for the check IDs
// that you specified. You can get the check IDs by calling the
// DescribeTrustedAdvisorChecks operation. The response contains an array of
// TrustedAdvisorCheckSummary objects.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
//
// To call the Trusted Advisor operations in the Amazon Web Services Support API,
// you must use the US East (N. Virginia) endpoint. Currently, the US West (Oregon)
// and Europe (Ireland) endpoints don't support the Trusted Advisor operations. For
// more information, see About the Amazon Web Services Support API (https://docs.aws.amazon.com/awssupport/latest/user/about-support-api.html#endpoint)
// in the Amazon Web Services Support User Guide.
func (c *Client) DescribeTrustedAdvisorCheckSummaries(ctx context.Context, params *DescribeTrustedAdvisorCheckSummariesInput, optFns ...func(*Options)) (*DescribeTrustedAdvisorCheckSummariesOutput, error) {
if params == nil {
params = &DescribeTrustedAdvisorCheckSummariesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTrustedAdvisorCheckSummaries", params, optFns, c.addOperationDescribeTrustedAdvisorCheckSummariesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTrustedAdvisorCheckSummariesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTrustedAdvisorCheckSummariesInput struct {
// The IDs of the Trusted Advisor checks.
//
// This member is required.
CheckIds []*string
noSmithyDocumentSerde
}
// The summaries of the Trusted Advisor checks returned by the
// DescribeTrustedAdvisorCheckSummaries operation.
type DescribeTrustedAdvisorCheckSummariesOutput struct {
// The summary information for the requested Trusted Advisor checks.
//
// This member is required.
Summaries []types.TrustedAdvisorCheckSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTrustedAdvisorCheckSummariesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeTrustedAdvisorCheckSummaries{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckSummaries{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTrustedAdvisorCheckSummariesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTrustedAdvisorCheckSummaries(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeTrustedAdvisorCheckSummaries(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "DescribeTrustedAdvisorCheckSummaries",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"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/support/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Refreshes the Trusted Advisor check that you specify using the check ID. You
// can get the check IDs by calling the DescribeTrustedAdvisorChecks operation.
// Some checks are refreshed automatically. If you call the
// RefreshTrustedAdvisorCheck operation to refresh them, you might see the
// InvalidParameterValue error. The response contains a
// TrustedAdvisorCheckRefreshStatus object.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
//
// To call the Trusted Advisor operations in the Amazon Web Services Support API,
// you must use the US East (N. Virginia) endpoint. Currently, the US West (Oregon)
// and Europe (Ireland) endpoints don't support the Trusted Advisor operations. For
// more information, see About the Amazon Web Services Support API (https://docs.aws.amazon.com/awssupport/latest/user/about-support-api.html#endpoint)
// in the Amazon Web Services Support User Guide.
func (c *Client) RefreshTrustedAdvisorCheck(ctx context.Context, params *RefreshTrustedAdvisorCheckInput, optFns ...func(*Options)) (*RefreshTrustedAdvisorCheckOutput, error) {
if params == nil {
params = &RefreshTrustedAdvisorCheckInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RefreshTrustedAdvisorCheck", params, optFns, c.addOperationRefreshTrustedAdvisorCheckMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RefreshTrustedAdvisorCheckOutput)
out.ResultMetadata = metadata
return out, nil
}
type RefreshTrustedAdvisorCheckInput struct {
// The unique identifier for the Trusted Advisor check to refresh. Specifying the
// check ID of a check that is automatically refreshed causes an
// InvalidParameterValue error.
//
// This member is required.
CheckId *string
noSmithyDocumentSerde
}
// The current refresh status of a Trusted Advisor check.
type RefreshTrustedAdvisorCheckOutput struct {
// The current refresh status for a check, including the amount of time until the
// check is eligible for refresh.
//
// This member is required.
Status *types.TrustedAdvisorCheckRefreshStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRefreshTrustedAdvisorCheckMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRefreshTrustedAdvisorCheck{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRefreshTrustedAdvisorCheck{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRefreshTrustedAdvisorCheckValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRefreshTrustedAdvisorCheck(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRefreshTrustedAdvisorCheck(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "RefreshTrustedAdvisorCheck",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"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"
)
// Resolves a support case. This operation takes a caseId and returns the initial
// and final state of the case.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
func (c *Client) ResolveCase(ctx context.Context, params *ResolveCaseInput, optFns ...func(*Options)) (*ResolveCaseOutput, error) {
if params == nil {
params = &ResolveCaseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ResolveCase", params, optFns, c.addOperationResolveCaseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ResolveCaseOutput)
out.ResultMetadata = metadata
return out, nil
}
type ResolveCaseInput struct {
// The support case ID requested or returned in the call. The case ID is an
// alphanumeric string formatted as shown in this example:
// case-12345678910-2013-c4c1d2bf33c5cf47
CaseId *string
noSmithyDocumentSerde
}
// The status of the case returned by the ResolveCase operation.
type ResolveCaseOutput struct {
// The status of the case after the ResolveCase request was processed.
FinalCaseStatus *string
// The status of the case when the ResolveCase request was sent.
InitialCaseStatus *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationResolveCaseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpResolveCase{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpResolveCase{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opResolveCase(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opResolveCase(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "support",
OperationName: "ResolveCase",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/support/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"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"math"
"strings"
)
type awsAwsjson11_deserializeOpAddAttachmentsToSet struct {
}
func (*awsAwsjson11_deserializeOpAddAttachmentsToSet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddAttachmentsToSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorAddAttachmentsToSet(response, &metadata)
}
output := &AddAttachmentsToSetOutput{}
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_deserializeOpDocumentAddAttachmentsToSetOutput(&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_deserializeOpErrorAddAttachmentsToSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AttachmentLimitExceeded", errorCode):
return awsAwsjson11_deserializeErrorAttachmentLimitExceeded(response, errorBody)
case strings.EqualFold("AttachmentSetExpired", errorCode):
return awsAwsjson11_deserializeErrorAttachmentSetExpired(response, errorBody)
case strings.EqualFold("AttachmentSetIdNotFound", errorCode):
return awsAwsjson11_deserializeErrorAttachmentSetIdNotFound(response, errorBody)
case strings.EqualFold("AttachmentSetSizeLimitExceeded", errorCode):
return awsAwsjson11_deserializeErrorAttachmentSetSizeLimitExceeded(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAddCommunicationToCase struct {
}
func (*awsAwsjson11_deserializeOpAddCommunicationToCase) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddCommunicationToCase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorAddCommunicationToCase(response, &metadata)
}
output := &AddCommunicationToCaseOutput{}
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_deserializeOpDocumentAddCommunicationToCaseOutput(&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_deserializeOpErrorAddCommunicationToCase(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AttachmentSetExpired", errorCode):
return awsAwsjson11_deserializeErrorAttachmentSetExpired(response, errorBody)
case strings.EqualFold("AttachmentSetIdNotFound", errorCode):
return awsAwsjson11_deserializeErrorAttachmentSetIdNotFound(response, errorBody)
case strings.EqualFold("CaseIdNotFound", errorCode):
return awsAwsjson11_deserializeErrorCaseIdNotFound(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateCase struct {
}
func (*awsAwsjson11_deserializeOpCreateCase) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateCase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateCase(response, &metadata)
}
output := &CreateCaseOutput{}
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_deserializeOpDocumentCreateCaseOutput(&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_deserializeOpErrorCreateCase(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AttachmentSetExpired", errorCode):
return awsAwsjson11_deserializeErrorAttachmentSetExpired(response, errorBody)
case strings.EqualFold("AttachmentSetIdNotFound", errorCode):
return awsAwsjson11_deserializeErrorAttachmentSetIdNotFound(response, errorBody)
case strings.EqualFold("CaseCreationLimitExceeded", errorCode):
return awsAwsjson11_deserializeErrorCaseCreationLimitExceeded(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeAttachment struct {
}
func (*awsAwsjson11_deserializeOpDescribeAttachment) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeAttachment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeAttachment(response, &metadata)
}
output := &DescribeAttachmentOutput{}
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_deserializeOpDocumentDescribeAttachmentOutput(&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_deserializeOpErrorDescribeAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AttachmentIdNotFound", errorCode):
return awsAwsjson11_deserializeErrorAttachmentIdNotFound(response, errorBody)
case strings.EqualFold("DescribeAttachmentLimitExceeded", errorCode):
return awsAwsjson11_deserializeErrorDescribeAttachmentLimitExceeded(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeCases struct {
}
func (*awsAwsjson11_deserializeOpDescribeCases) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeCases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeCases(response, &metadata)
}
output := &DescribeCasesOutput{}
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_deserializeOpDocumentDescribeCasesOutput(&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_deserializeOpErrorDescribeCases(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("CaseIdNotFound", errorCode):
return awsAwsjson11_deserializeErrorCaseIdNotFound(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeCommunications struct {
}
func (*awsAwsjson11_deserializeOpDescribeCommunications) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeCommunications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeCommunications(response, &metadata)
}
output := &DescribeCommunicationsOutput{}
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_deserializeOpDocumentDescribeCommunicationsOutput(&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_deserializeOpErrorDescribeCommunications(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("CaseIdNotFound", errorCode):
return awsAwsjson11_deserializeErrorCaseIdNotFound(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeCreateCaseOptions struct {
}
func (*awsAwsjson11_deserializeOpDescribeCreateCaseOptions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeCreateCaseOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeCreateCaseOptions(response, &metadata)
}
output := &DescribeCreateCaseOptionsOutput{}
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_deserializeOpDocumentDescribeCreateCaseOptionsOutput(&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_deserializeOpErrorDescribeCreateCaseOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeServices struct {
}
func (*awsAwsjson11_deserializeOpDescribeServices) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeServices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeServices(response, &metadata)
}
output := &DescribeServicesOutput{}
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_deserializeOpDocumentDescribeServicesOutput(&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_deserializeOpErrorDescribeServices(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeSeverityLevels struct {
}
func (*awsAwsjson11_deserializeOpDescribeSeverityLevels) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeSeverityLevels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeSeverityLevels(response, &metadata)
}
output := &DescribeSeverityLevelsOutput{}
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_deserializeOpDocumentDescribeSeverityLevelsOutput(&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_deserializeOpErrorDescribeSeverityLevels(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeSupportedLanguages struct {
}
func (*awsAwsjson11_deserializeOpDescribeSupportedLanguages) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeSupportedLanguages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeSupportedLanguages(response, &metadata)
}
output := &DescribeSupportedLanguagesOutput{}
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_deserializeOpDocumentDescribeSupportedLanguagesOutput(&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_deserializeOpErrorDescribeSupportedLanguages(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckRefreshStatuses struct {
}
func (*awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckRefreshStatuses) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckRefreshStatuses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeTrustedAdvisorCheckRefreshStatuses(response, &metadata)
}
output := &DescribeTrustedAdvisorCheckRefreshStatusesOutput{}
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_deserializeOpDocumentDescribeTrustedAdvisorCheckRefreshStatusesOutput(&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_deserializeOpErrorDescribeTrustedAdvisorCheckRefreshStatuses(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckResult struct {
}
func (*awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckResult) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckResult) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeTrustedAdvisorCheckResult(response, &metadata)
}
output := &DescribeTrustedAdvisorCheckResultOutput{}
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_deserializeOpDocumentDescribeTrustedAdvisorCheckResultOutput(&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_deserializeOpErrorDescribeTrustedAdvisorCheckResult(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeTrustedAdvisorChecks struct {
}
func (*awsAwsjson11_deserializeOpDescribeTrustedAdvisorChecks) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeTrustedAdvisorChecks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeTrustedAdvisorChecks(response, &metadata)
}
output := &DescribeTrustedAdvisorChecksOutput{}
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_deserializeOpDocumentDescribeTrustedAdvisorChecksOutput(&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_deserializeOpErrorDescribeTrustedAdvisorChecks(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckSummaries struct {
}
func (*awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckSummaries) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeTrustedAdvisorCheckSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeTrustedAdvisorCheckSummaries(response, &metadata)
}
output := &DescribeTrustedAdvisorCheckSummariesOutput{}
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_deserializeOpDocumentDescribeTrustedAdvisorCheckSummariesOutput(&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_deserializeOpErrorDescribeTrustedAdvisorCheckSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpRefreshTrustedAdvisorCheck struct {
}
func (*awsAwsjson11_deserializeOpRefreshTrustedAdvisorCheck) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRefreshTrustedAdvisorCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorRefreshTrustedAdvisorCheck(response, &metadata)
}
output := &RefreshTrustedAdvisorCheckOutput{}
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_deserializeOpDocumentRefreshTrustedAdvisorCheckOutput(&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_deserializeOpErrorRefreshTrustedAdvisorCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpResolveCase struct {
}
func (*awsAwsjson11_deserializeOpResolveCase) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpResolveCase) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorResolveCase(response, &metadata)
}
output := &ResolveCaseOutput{}
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_deserializeOpDocumentResolveCaseOutput(&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_deserializeOpErrorResolveCase(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("CaseIdNotFound", errorCode):
return awsAwsjson11_deserializeErrorCaseIdNotFound(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorAttachmentIdNotFound(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.AttachmentIdNotFound{}
err := awsAwsjson11_deserializeDocumentAttachmentIdNotFound(&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_deserializeErrorAttachmentLimitExceeded(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.AttachmentLimitExceeded{}
err := awsAwsjson11_deserializeDocumentAttachmentLimitExceeded(&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_deserializeErrorAttachmentSetExpired(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.AttachmentSetExpired{}
err := awsAwsjson11_deserializeDocumentAttachmentSetExpired(&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_deserializeErrorAttachmentSetIdNotFound(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.AttachmentSetIdNotFound{}
err := awsAwsjson11_deserializeDocumentAttachmentSetIdNotFound(&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_deserializeErrorAttachmentSetSizeLimitExceeded(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.AttachmentSetSizeLimitExceeded{}
err := awsAwsjson11_deserializeDocumentAttachmentSetSizeLimitExceeded(&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_deserializeErrorCaseCreationLimitExceeded(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.CaseCreationLimitExceeded{}
err := awsAwsjson11_deserializeDocumentCaseCreationLimitExceeded(&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_deserializeErrorCaseIdNotFound(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.CaseIdNotFound{}
err := awsAwsjson11_deserializeDocumentCaseIdNotFound(&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_deserializeErrorDescribeAttachmentLimitExceeded(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.DescribeAttachmentLimitExceeded{}
err := awsAwsjson11_deserializeDocumentDescribeAttachmentLimitExceeded(&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_deserializeErrorInternalServerError(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.InternalServerError{}
err := awsAwsjson11_deserializeDocumentInternalServerError(&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_deserializeErrorThrottlingException(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.ThrottlingException{}
err := awsAwsjson11_deserializeDocumentThrottlingException(&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_deserializeDocumentAttachment(v **types.Attachment, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Attachment
if *v == nil {
sv = &types.Attachment{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "data":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Data to be []byte, got %T instead", value)
}
dv, err := base64.StdEncoding.DecodeString(jtv)
if err != nil {
return fmt.Errorf("failed to base64 decode Data, %w", err)
}
sv.Data = dv
}
case "fileName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FileName to be of type string, got %T instead", value)
}
sv.FileName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttachmentDetails(v **types.AttachmentDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttachmentDetails
if *v == nil {
sv = &types.AttachmentDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "attachmentId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttachmentId to be of type string, got %T instead", value)
}
sv.AttachmentId = ptr.String(jtv)
}
case "fileName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FileName to be of type string, got %T instead", value)
}
sv.FileName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAttachmentIdNotFound(v **types.AttachmentIdNotFound, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttachmentIdNotFound
if *v == nil {
sv = &types.AttachmentIdNotFound{}
} 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_deserializeDocumentAttachmentLimitExceeded(v **types.AttachmentLimitExceeded, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttachmentLimitExceeded
if *v == nil {
sv = &types.AttachmentLimitExceeded{}
} 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_deserializeDocumentAttachmentSet(v *[]types.AttachmentDetails, 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.AttachmentDetails
if *v == nil {
cv = []types.AttachmentDetails{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AttachmentDetails
destAddr := &col
if err := awsAwsjson11_deserializeDocumentAttachmentDetails(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAttachmentSetExpired(v **types.AttachmentSetExpired, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttachmentSetExpired
if *v == nil {
sv = &types.AttachmentSetExpired{}
} 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_deserializeDocumentAttachmentSetIdNotFound(v **types.AttachmentSetIdNotFound, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttachmentSetIdNotFound
if *v == nil {
sv = &types.AttachmentSetIdNotFound{}
} 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_deserializeDocumentAttachmentSetSizeLimitExceeded(v **types.AttachmentSetSizeLimitExceeded, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AttachmentSetSizeLimitExceeded
if *v == nil {
sv = &types.AttachmentSetSizeLimitExceeded{}
} 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_deserializeDocumentCaseCreationLimitExceeded(v **types.CaseCreationLimitExceeded, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CaseCreationLimitExceeded
if *v == nil {
sv = &types.CaseCreationLimitExceeded{}
} 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_deserializeDocumentCaseDetails(v **types.CaseDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CaseDetails
if *v == nil {
sv = &types.CaseDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "caseId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CaseId to be of type string, got %T instead", value)
}
sv.CaseId = ptr.String(jtv)
}
case "categoryCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CategoryCode to be of type string, got %T instead", value)
}
sv.CategoryCode = ptr.String(jtv)
}
case "ccEmailAddresses":
if err := awsAwsjson11_deserializeDocumentCcEmailAddressList(&sv.CcEmailAddresses, value); err != nil {
return err
}
case "displayId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DisplayId to be of type string, got %T instead", value)
}
sv.DisplayId = ptr.String(jtv)
}
case "language":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Language to be of type string, got %T instead", value)
}
sv.Language = ptr.String(jtv)
}
case "recentCommunications":
if err := awsAwsjson11_deserializeDocumentRecentCaseCommunications(&sv.RecentCommunications, value); err != nil {
return err
}
case "serviceCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value)
}
sv.ServiceCode = ptr.String(jtv)
}
case "severityCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SeverityCode to be of type string, got %T instead", value)
}
sv.SeverityCode = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Status to be of type string, got %T instead", value)
}
sv.Status = ptr.String(jtv)
}
case "subject":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Subject to be of type string, got %T instead", value)
}
sv.Subject = ptr.String(jtv)
}
case "submittedBy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubmittedBy to be of type string, got %T instead", value)
}
sv.SubmittedBy = ptr.String(jtv)
}
case "timeCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TimeCreated to be of type string, got %T instead", value)
}
sv.TimeCreated = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCaseIdNotFound(v **types.CaseIdNotFound, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CaseIdNotFound
if *v == nil {
sv = &types.CaseIdNotFound{}
} 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_deserializeDocumentCaseList(v *[]types.CaseDetails, 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.CaseDetails
if *v == nil {
cv = []types.CaseDetails{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CaseDetails
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCaseDetails(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCategory(v **types.Category, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Category
if *v == nil {
sv = &types.Category{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CategoryCode to be of type string, got %T instead", value)
}
sv.Code = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CategoryName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCategoryList(v *[]types.Category, 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.Category
if *v == nil {
cv = []types.Category{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Category
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCategory(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCcEmailAddressList(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 CcEmailAddress to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCommunication(v **types.Communication, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Communication
if *v == nil {
sv = &types.Communication{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "attachmentSet":
if err := awsAwsjson11_deserializeDocumentAttachmentSet(&sv.AttachmentSet, value); err != nil {
return err
}
case "body":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ValidatedCommunicationBody to be of type string, got %T instead", value)
}
sv.Body = ptr.String(jtv)
}
case "caseId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CaseId to be of type string, got %T instead", value)
}
sv.CaseId = ptr.String(jtv)
}
case "submittedBy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubmittedBy to be of type string, got %T instead", value)
}
sv.SubmittedBy = ptr.String(jtv)
}
case "timeCreated":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TimeCreated to be of type string, got %T instead", value)
}
sv.TimeCreated = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCommunicationList(v *[]types.Communication, 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.Communication
if *v == nil {
cv = []types.Communication{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Communication
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCommunication(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCommunicationTypeOptions(v **types.CommunicationTypeOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CommunicationTypeOptions
if *v == nil {
sv = &types.CommunicationTypeOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "datesWithoutSupport":
if err := awsAwsjson11_deserializeDocumentDatesWithoutSupportList(&sv.DatesWithoutSupport, value); err != nil {
return err
}
case "supportedHours":
if err := awsAwsjson11_deserializeDocumentSupportedHoursList(&sv.SupportedHours, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Type to be of type string, got %T instead", value)
}
sv.Type = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCommunicationTypeOptionsList(v *[]types.CommunicationTypeOptions, 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.CommunicationTypeOptions
if *v == nil {
cv = []types.CommunicationTypeOptions{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CommunicationTypeOptions
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCommunicationTypeOptions(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentDateInterval(v **types.DateInterval, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DateInterval
if *v == nil {
sv = &types.DateInterval{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "endDateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ValidatedDateTime to be of type string, got %T instead", value)
}
sv.EndDateTime = ptr.String(jtv)
}
case "startDateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ValidatedDateTime to be of type string, got %T instead", value)
}
sv.StartDateTime = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDatesWithoutSupportList(v *[]types.DateInterval, 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.DateInterval
if *v == nil {
cv = []types.DateInterval{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DateInterval
destAddr := &col
if err := awsAwsjson11_deserializeDocumentDateInterval(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentDescribeAttachmentLimitExceeded(v **types.DescribeAttachmentLimitExceeded, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DescribeAttachmentLimitExceeded
if *v == nil {
sv = &types.DescribeAttachmentLimitExceeded{}
} 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_deserializeDocumentInternalServerError(v **types.InternalServerError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerError
if *v == nil {
sv = &types.InternalServerError{}
} 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_deserializeDocumentRecentCaseCommunications(v **types.RecentCaseCommunications, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RecentCaseCommunications
if *v == nil {
sv = &types.RecentCaseCommunications{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "communications":
if err := awsAwsjson11_deserializeDocumentCommunicationList(&sv.Communications, 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_deserializeDocumentService(v **types.Service, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Service
if *v == nil {
sv = &types.Service{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "categories":
if err := awsAwsjson11_deserializeDocumentCategoryList(&sv.Categories, value); err != nil {
return err
}
case "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value)
}
sv.Code = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ServiceName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentServiceList(v *[]types.Service, 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.Service
if *v == nil {
cv = []types.Service{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Service
destAddr := &col
if err := awsAwsjson11_deserializeDocumentService(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSeverityLevel(v **types.SeverityLevel, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SeverityLevel
if *v == nil {
sv = &types.SeverityLevel{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SeverityLevelCode to be of type string, got %T instead", value)
}
sv.Code = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SeverityLevelName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSeverityLevelsList(v *[]types.SeverityLevel, 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.SeverityLevel
if *v == nil {
cv = []types.SeverityLevel{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SeverityLevel
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSeverityLevel(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentStringList(v *[]*string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []*string
if *v == nil {
cv = []*string{}
} else {
cv = *v
}
for _, value := range shape {
var col *string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
col = ptr.String(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSupportedHour(v **types.SupportedHour, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SupportedHour
if *v == nil {
sv = &types.SupportedHour{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "endTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EndTime to be of type string, got %T instead", value)
}
sv.EndTime = ptr.String(jtv)
}
case "startTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StartTime to be of type string, got %T instead", value)
}
sv.StartTime = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSupportedHoursList(v *[]types.SupportedHour, 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.SupportedHour
if *v == nil {
cv = []types.SupportedHour{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SupportedHour
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSupportedHour(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSupportedLanguage(v **types.SupportedLanguage, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SupportedLanguage
if *v == nil {
sv = &types.SupportedLanguage{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Code to be of type string, got %T instead", value)
}
sv.Code = ptr.String(jtv)
}
case "display":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Display to be of type string, got %T instead", value)
}
sv.Display = ptr.String(jtv)
}
case "language":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Language to be of type string, got %T instead", value)
}
sv.Language = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSupportedLanguagesList(v *[]types.SupportedLanguage, 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.SupportedLanguage
if *v == nil {
cv = []types.SupportedLanguage{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SupportedLanguage
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSupportedLanguage(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ThrottlingException
if *v == nil {
sv = &types.ThrottlingException{}
} 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 AvailabilityErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorCategorySpecificSummary(v **types.TrustedAdvisorCategorySpecificSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TrustedAdvisorCategorySpecificSummary
if *v == nil {
sv = &types.TrustedAdvisorCategorySpecificSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "costOptimizing":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCostOptimizingSummary(&sv.CostOptimizing, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorCheckDescription(v **types.TrustedAdvisorCheckDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TrustedAdvisorCheckDescription
if *v == nil {
sv = &types.TrustedAdvisorCheckDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "category":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Category = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "metadata":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.Metadata, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorCheckList(v *[]types.TrustedAdvisorCheckDescription, 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.TrustedAdvisorCheckDescription
if *v == nil {
cv = []types.TrustedAdvisorCheckDescription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TrustedAdvisorCheckDescription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCheckDescription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorCheckRefreshStatus(v **types.TrustedAdvisorCheckRefreshStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TrustedAdvisorCheckRefreshStatus
if *v == nil {
sv = &types.TrustedAdvisorCheckRefreshStatus{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "checkId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.CheckId = ptr.String(jtv)
}
case "millisUntilNextRefreshable":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MillisUntilNextRefreshable = i64
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Status = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorCheckRefreshStatusList(v *[]types.TrustedAdvisorCheckRefreshStatus, 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.TrustedAdvisorCheckRefreshStatus
if *v == nil {
cv = []types.TrustedAdvisorCheckRefreshStatus{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TrustedAdvisorCheckRefreshStatus
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCheckRefreshStatus(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorCheckResult(v **types.TrustedAdvisorCheckResult, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TrustedAdvisorCheckResult
if *v == nil {
sv = &types.TrustedAdvisorCheckResult{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "categorySpecificSummary":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCategorySpecificSummary(&sv.CategorySpecificSummary, value); err != nil {
return err
}
case "checkId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.CheckId = ptr.String(jtv)
}
case "flaggedResources":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorResourceDetailList(&sv.FlaggedResources, value); err != nil {
return err
}
case "resourcesSummary":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorResourcesSummary(&sv.ResourcesSummary, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Status = ptr.String(jtv)
}
case "timestamp":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Timestamp = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorCheckSummary(v **types.TrustedAdvisorCheckSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TrustedAdvisorCheckSummary
if *v == nil {
sv = &types.TrustedAdvisorCheckSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "categorySpecificSummary":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCategorySpecificSummary(&sv.CategorySpecificSummary, value); err != nil {
return err
}
case "checkId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.CheckId = ptr.String(jtv)
}
case "hasFlaggedResources":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.HasFlaggedResources = jtv
}
case "resourcesSummary":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorResourcesSummary(&sv.ResourcesSummary, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Status = ptr.String(jtv)
}
case "timestamp":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Timestamp = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorCheckSummaryList(v *[]types.TrustedAdvisorCheckSummary, 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.TrustedAdvisorCheckSummary
if *v == nil {
cv = []types.TrustedAdvisorCheckSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TrustedAdvisorCheckSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCheckSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorCostOptimizingSummary(v **types.TrustedAdvisorCostOptimizingSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TrustedAdvisorCostOptimizingSummary
if *v == nil {
sv = &types.TrustedAdvisorCostOptimizingSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "estimatedMonthlySavings":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EstimatedMonthlySavings = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.EstimatedMonthlySavings = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "estimatedPercentMonthlySavings":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EstimatedPercentMonthlySavings = f64
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.EstimatedPercentMonthlySavings = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorResourceDetail(v **types.TrustedAdvisorResourceDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TrustedAdvisorResourceDetail
if *v == nil {
sv = &types.TrustedAdvisorResourceDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "isSuppressed":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.IsSuppressed = jtv
}
case "metadata":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.Metadata, value); err != nil {
return err
}
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
case "resourceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceId = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Status = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorResourceDetailList(v *[]types.TrustedAdvisorResourceDetail, 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.TrustedAdvisorResourceDetail
if *v == nil {
cv = []types.TrustedAdvisorResourceDetail{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TrustedAdvisorResourceDetail
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorResourceDetail(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTrustedAdvisorResourcesSummary(v **types.TrustedAdvisorResourcesSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TrustedAdvisorResourcesSummary
if *v == nil {
sv = &types.TrustedAdvisorResourcesSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "resourcesFlagged":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResourcesFlagged = i64
}
case "resourcesIgnored":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResourcesIgnored = i64
}
case "resourcesProcessed":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResourcesProcessed = i64
}
case "resourcesSuppressed":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ResourcesSuppressed = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddAttachmentsToSetOutput(v **AddAttachmentsToSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddAttachmentsToSetOutput
if *v == nil {
sv = &AddAttachmentsToSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "attachmentSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttachmentSetId to be of type string, got %T instead", value)
}
sv.AttachmentSetId = ptr.String(jtv)
}
case "expiryTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExpiryTime to be of type string, got %T instead", value)
}
sv.ExpiryTime = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddCommunicationToCaseOutput(v **AddCommunicationToCaseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddCommunicationToCaseOutput
if *v == nil {
sv = &AddCommunicationToCaseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "result":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Result to be of type *bool, got %T instead", value)
}
sv.Result = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateCaseOutput(v **CreateCaseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateCaseOutput
if *v == nil {
sv = &CreateCaseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "caseId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CaseId to be of type string, got %T instead", value)
}
sv.CaseId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeAttachmentOutput(v **DescribeAttachmentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeAttachmentOutput
if *v == nil {
sv = &DescribeAttachmentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "attachment":
if err := awsAwsjson11_deserializeDocumentAttachment(&sv.Attachment, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeCasesOutput(v **DescribeCasesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeCasesOutput
if *v == nil {
sv = &DescribeCasesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "cases":
if err := awsAwsjson11_deserializeDocumentCaseList(&sv.Cases, 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_deserializeOpDocumentDescribeCommunicationsOutput(v **DescribeCommunicationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeCommunicationsOutput
if *v == nil {
sv = &DescribeCommunicationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "communications":
if err := awsAwsjson11_deserializeDocumentCommunicationList(&sv.Communications, 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_deserializeOpDocumentDescribeCreateCaseOptionsOutput(v **DescribeCreateCaseOptionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeCreateCaseOptionsOutput
if *v == nil {
sv = &DescribeCreateCaseOptionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "communicationTypes":
if err := awsAwsjson11_deserializeDocumentCommunicationTypeOptionsList(&sv.CommunicationTypes, value); err != nil {
return err
}
case "languageAvailability":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ValidatedLanguageAvailability to be of type string, got %T instead", value)
}
sv.LanguageAvailability = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeServicesOutput(v **DescribeServicesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeServicesOutput
if *v == nil {
sv = &DescribeServicesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "services":
if err := awsAwsjson11_deserializeDocumentServiceList(&sv.Services, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeSeverityLevelsOutput(v **DescribeSeverityLevelsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeSeverityLevelsOutput
if *v == nil {
sv = &DescribeSeverityLevelsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "severityLevels":
if err := awsAwsjson11_deserializeDocumentSeverityLevelsList(&sv.SeverityLevels, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeSupportedLanguagesOutput(v **DescribeSupportedLanguagesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeSupportedLanguagesOutput
if *v == nil {
sv = &DescribeSupportedLanguagesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "supportedLanguages":
if err := awsAwsjson11_deserializeDocumentSupportedLanguagesList(&sv.SupportedLanguages, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeTrustedAdvisorCheckRefreshStatusesOutput(v **DescribeTrustedAdvisorCheckRefreshStatusesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeTrustedAdvisorCheckRefreshStatusesOutput
if *v == nil {
sv = &DescribeTrustedAdvisorCheckRefreshStatusesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "statuses":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCheckRefreshStatusList(&sv.Statuses, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeTrustedAdvisorCheckResultOutput(v **DescribeTrustedAdvisorCheckResultOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeTrustedAdvisorCheckResultOutput
if *v == nil {
sv = &DescribeTrustedAdvisorCheckResultOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "result":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCheckResult(&sv.Result, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeTrustedAdvisorChecksOutput(v **DescribeTrustedAdvisorChecksOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeTrustedAdvisorChecksOutput
if *v == nil {
sv = &DescribeTrustedAdvisorChecksOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "checks":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCheckList(&sv.Checks, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeTrustedAdvisorCheckSummariesOutput(v **DescribeTrustedAdvisorCheckSummariesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeTrustedAdvisorCheckSummariesOutput
if *v == nil {
sv = &DescribeTrustedAdvisorCheckSummariesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "summaries":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCheckSummaryList(&sv.Summaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentRefreshTrustedAdvisorCheckOutput(v **RefreshTrustedAdvisorCheckOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RefreshTrustedAdvisorCheckOutput
if *v == nil {
sv = &RefreshTrustedAdvisorCheckOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "status":
if err := awsAwsjson11_deserializeDocumentTrustedAdvisorCheckRefreshStatus(&sv.Status, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentResolveCaseOutput(v **ResolveCaseOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ResolveCaseOutput
if *v == nil {
sv = &ResolveCaseOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "finalCaseStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CaseStatus to be of type string, got %T instead", value)
}
sv.FinalCaseStatus = ptr.String(jtv)
}
case "initialCaseStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CaseStatus to be of type string, got %T instead", value)
}
sv.InitialCaseStatus = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 5,078 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package support provides the API client, operations, and parameter types for
// AWS Support.
//
// Amazon Web Services Support The Amazon Web Services Support API Reference is
// intended for programmers who need detailed information about the Amazon Web
// Services Support operations and data types. You can use the API to manage your
// support cases programmatically. The Amazon Web Services Support API uses HTTP
// methods that return results in JSON format.
// - You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to
// use the Amazon Web Services Support API.
// - If you call the Amazon Web Services Support API from an account that
// doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the
// SubscriptionRequiredException error message appears. For information about
// changing your support plan, see Amazon Web Services Support (http://aws.amazon.com/premiumsupport/)
// .
//
// You can also use the Amazon Web Services Support API to access features for
// Trusted Advisor (http://aws.amazon.com/premiumsupport/trustedadvisor/) . You can
// return a list of checks and their descriptions, get check results, specify
// checks to refresh, and get the refresh status of checks. You can manage your
// support cases with the following Amazon Web Services Support API operations:
// - The CreateCase , DescribeCases , DescribeAttachment , and ResolveCase
// operations create Amazon Web Services Support cases, retrieve information about
// cases, and resolve cases.
// - The DescribeCommunications , AddCommunicationToCase , and
// AddAttachmentsToSet operations retrieve and add communications and attachments
// to Amazon Web Services Support cases.
// - The DescribeServices and DescribeSeverityLevels operations return Amazon Web
// Service names, service codes, service categories, and problem severity levels.
// You use these values when you call the CreateCase operation.
//
// You can also use the Amazon Web Services Support API to call the Trusted
// Advisor operations. For more information, see Trusted Advisor (https://docs.aws.amazon.com/)
// in the Amazon Web Services Support User Guide. For authentication of requests,
// Amazon Web Services Support uses Signature Version 4 Signing Process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)
// . For more information about this service and the endpoints to use, see About
// the Amazon Web Services Support API (https://docs.aws.amazon.com/awssupport/latest/user/about-support-api.html)
// in the Amazon Web Services Support User Guide.
package support
| 42 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
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/support/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 = "support"
}
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 support
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.15.2"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/support/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"
"path"
)
type awsAwsjson11_serializeOpAddAttachmentsToSet struct {
}
func (*awsAwsjson11_serializeOpAddAttachmentsToSet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddAttachmentsToSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddAttachmentsToSetInput)
_ = 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("AWSSupport_20130415.AddAttachmentsToSet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddAttachmentsToSetInput(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_serializeOpAddCommunicationToCase struct {
}
func (*awsAwsjson11_serializeOpAddCommunicationToCase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddCommunicationToCase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddCommunicationToCaseInput)
_ = 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("AWSSupport_20130415.AddCommunicationToCase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddCommunicationToCaseInput(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_serializeOpCreateCase struct {
}
func (*awsAwsjson11_serializeOpCreateCase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateCase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateCaseInput)
_ = 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("AWSSupport_20130415.CreateCase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateCaseInput(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_serializeOpDescribeAttachment struct {
}
func (*awsAwsjson11_serializeOpDescribeAttachment) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeAttachment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAttachmentInput)
_ = 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("AWSSupport_20130415.DescribeAttachment")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeAttachmentInput(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_serializeOpDescribeCases struct {
}
func (*awsAwsjson11_serializeOpDescribeCases) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeCases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeCasesInput)
_ = 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("AWSSupport_20130415.DescribeCases")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeCasesInput(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_serializeOpDescribeCommunications struct {
}
func (*awsAwsjson11_serializeOpDescribeCommunications) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeCommunications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeCommunicationsInput)
_ = 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("AWSSupport_20130415.DescribeCommunications")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeCommunicationsInput(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_serializeOpDescribeCreateCaseOptions struct {
}
func (*awsAwsjson11_serializeOpDescribeCreateCaseOptions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeCreateCaseOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeCreateCaseOptionsInput)
_ = 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("AWSSupport_20130415.DescribeCreateCaseOptions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeCreateCaseOptionsInput(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_serializeOpDescribeServices struct {
}
func (*awsAwsjson11_serializeOpDescribeServices) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeServices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeServicesInput)
_ = 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("AWSSupport_20130415.DescribeServices")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeServicesInput(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_serializeOpDescribeSeverityLevels struct {
}
func (*awsAwsjson11_serializeOpDescribeSeverityLevels) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeSeverityLevels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSeverityLevelsInput)
_ = 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("AWSSupport_20130415.DescribeSeverityLevels")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeSeverityLevelsInput(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_serializeOpDescribeSupportedLanguages struct {
}
func (*awsAwsjson11_serializeOpDescribeSupportedLanguages) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeSupportedLanguages) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSupportedLanguagesInput)
_ = 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("AWSSupport_20130415.DescribeSupportedLanguages")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeSupportedLanguagesInput(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_serializeOpDescribeTrustedAdvisorCheckRefreshStatuses struct {
}
func (*awsAwsjson11_serializeOpDescribeTrustedAdvisorCheckRefreshStatuses) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeTrustedAdvisorCheckRefreshStatuses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTrustedAdvisorCheckRefreshStatusesInput)
_ = 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("AWSSupport_20130415.DescribeTrustedAdvisorCheckRefreshStatuses")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeTrustedAdvisorCheckRefreshStatusesInput(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_serializeOpDescribeTrustedAdvisorCheckResult struct {
}
func (*awsAwsjson11_serializeOpDescribeTrustedAdvisorCheckResult) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeTrustedAdvisorCheckResult) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTrustedAdvisorCheckResultInput)
_ = 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("AWSSupport_20130415.DescribeTrustedAdvisorCheckResult")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeTrustedAdvisorCheckResultInput(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_serializeOpDescribeTrustedAdvisorChecks struct {
}
func (*awsAwsjson11_serializeOpDescribeTrustedAdvisorChecks) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeTrustedAdvisorChecks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTrustedAdvisorChecksInput)
_ = 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("AWSSupport_20130415.DescribeTrustedAdvisorChecks")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeTrustedAdvisorChecksInput(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_serializeOpDescribeTrustedAdvisorCheckSummaries struct {
}
func (*awsAwsjson11_serializeOpDescribeTrustedAdvisorCheckSummaries) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeTrustedAdvisorCheckSummaries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTrustedAdvisorCheckSummariesInput)
_ = 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("AWSSupport_20130415.DescribeTrustedAdvisorCheckSummaries")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeTrustedAdvisorCheckSummariesInput(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_serializeOpRefreshTrustedAdvisorCheck struct {
}
func (*awsAwsjson11_serializeOpRefreshTrustedAdvisorCheck) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRefreshTrustedAdvisorCheck) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RefreshTrustedAdvisorCheckInput)
_ = 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("AWSSupport_20130415.RefreshTrustedAdvisorCheck")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRefreshTrustedAdvisorCheckInput(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_serializeOpResolveCase struct {
}
func (*awsAwsjson11_serializeOpResolveCase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpResolveCase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ResolveCaseInput)
_ = 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("AWSSupport_20130415.ResolveCase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentResolveCaseInput(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_serializeDocumentAttachment(v *types.Attachment, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("data")
ok.Base64EncodeBytes(v.Data)
}
if v.FileName != nil {
ok := object.Key("fileName")
ok.String(*v.FileName)
}
return nil
}
func awsAwsjson11_serializeDocumentAttachments(v []types.Attachment, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentAttachment(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCaseIdList(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_serializeDocumentCcEmailAddressList(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_serializeDocumentServiceCodeList(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_serializeDocumentStringList(v []*string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
av.Null()
continue
}
av.String(*v[i])
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddAttachmentsToSetInput(v *AddAttachmentsToSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Attachments != nil {
ok := object.Key("attachments")
if err := awsAwsjson11_serializeDocumentAttachments(v.Attachments, ok); err != nil {
return err
}
}
if v.AttachmentSetId != nil {
ok := object.Key("attachmentSetId")
ok.String(*v.AttachmentSetId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddCommunicationToCaseInput(v *AddCommunicationToCaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AttachmentSetId != nil {
ok := object.Key("attachmentSetId")
ok.String(*v.AttachmentSetId)
}
if v.CaseId != nil {
ok := object.Key("caseId")
ok.String(*v.CaseId)
}
if v.CcEmailAddresses != nil {
ok := object.Key("ccEmailAddresses")
if err := awsAwsjson11_serializeDocumentCcEmailAddressList(v.CcEmailAddresses, ok); err != nil {
return err
}
}
if v.CommunicationBody != nil {
ok := object.Key("communicationBody")
ok.String(*v.CommunicationBody)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateCaseInput(v *CreateCaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AttachmentSetId != nil {
ok := object.Key("attachmentSetId")
ok.String(*v.AttachmentSetId)
}
if v.CategoryCode != nil {
ok := object.Key("categoryCode")
ok.String(*v.CategoryCode)
}
if v.CcEmailAddresses != nil {
ok := object.Key("ccEmailAddresses")
if err := awsAwsjson11_serializeDocumentCcEmailAddressList(v.CcEmailAddresses, ok); err != nil {
return err
}
}
if v.CommunicationBody != nil {
ok := object.Key("communicationBody")
ok.String(*v.CommunicationBody)
}
if v.IssueType != nil {
ok := object.Key("issueType")
ok.String(*v.IssueType)
}
if v.Language != nil {
ok := object.Key("language")
ok.String(*v.Language)
}
if v.ServiceCode != nil {
ok := object.Key("serviceCode")
ok.String(*v.ServiceCode)
}
if v.SeverityCode != nil {
ok := object.Key("severityCode")
ok.String(*v.SeverityCode)
}
if v.Subject != nil {
ok := object.Key("subject")
ok.String(*v.Subject)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeAttachmentInput(v *DescribeAttachmentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AttachmentId != nil {
ok := object.Key("attachmentId")
ok.String(*v.AttachmentId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeCasesInput(v *DescribeCasesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AfterTime != nil {
ok := object.Key("afterTime")
ok.String(*v.AfterTime)
}
if v.BeforeTime != nil {
ok := object.Key("beforeTime")
ok.String(*v.BeforeTime)
}
if v.CaseIdList != nil {
ok := object.Key("caseIdList")
if err := awsAwsjson11_serializeDocumentCaseIdList(v.CaseIdList, ok); err != nil {
return err
}
}
if v.DisplayId != nil {
ok := object.Key("displayId")
ok.String(*v.DisplayId)
}
if v.IncludeCommunications != nil {
ok := object.Key("includeCommunications")
ok.Boolean(*v.IncludeCommunications)
}
if v.IncludeResolvedCases {
ok := object.Key("includeResolvedCases")
ok.Boolean(v.IncludeResolvedCases)
}
if v.Language != nil {
ok := object.Key("language")
ok.String(*v.Language)
}
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_serializeOpDocumentDescribeCommunicationsInput(v *DescribeCommunicationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AfterTime != nil {
ok := object.Key("afterTime")
ok.String(*v.AfterTime)
}
if v.BeforeTime != nil {
ok := object.Key("beforeTime")
ok.String(*v.BeforeTime)
}
if v.CaseId != nil {
ok := object.Key("caseId")
ok.String(*v.CaseId)
}
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_serializeOpDocumentDescribeCreateCaseOptionsInput(v *DescribeCreateCaseOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CategoryCode != nil {
ok := object.Key("categoryCode")
ok.String(*v.CategoryCode)
}
if v.IssueType != nil {
ok := object.Key("issueType")
ok.String(*v.IssueType)
}
if v.Language != nil {
ok := object.Key("language")
ok.String(*v.Language)
}
if v.ServiceCode != nil {
ok := object.Key("serviceCode")
ok.String(*v.ServiceCode)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeServicesInput(v *DescribeServicesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Language != nil {
ok := object.Key("language")
ok.String(*v.Language)
}
if v.ServiceCodeList != nil {
ok := object.Key("serviceCodeList")
if err := awsAwsjson11_serializeDocumentServiceCodeList(v.ServiceCodeList, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeSeverityLevelsInput(v *DescribeSeverityLevelsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Language != nil {
ok := object.Key("language")
ok.String(*v.Language)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeSupportedLanguagesInput(v *DescribeSupportedLanguagesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CategoryCode != nil {
ok := object.Key("categoryCode")
ok.String(*v.CategoryCode)
}
if v.IssueType != nil {
ok := object.Key("issueType")
ok.String(*v.IssueType)
}
if v.ServiceCode != nil {
ok := object.Key("serviceCode")
ok.String(*v.ServiceCode)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeTrustedAdvisorCheckRefreshStatusesInput(v *DescribeTrustedAdvisorCheckRefreshStatusesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CheckIds != nil {
ok := object.Key("checkIds")
if err := awsAwsjson11_serializeDocumentStringList(v.CheckIds, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeTrustedAdvisorCheckResultInput(v *DescribeTrustedAdvisorCheckResultInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CheckId != nil {
ok := object.Key("checkId")
ok.String(*v.CheckId)
}
if v.Language != nil {
ok := object.Key("language")
ok.String(*v.Language)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeTrustedAdvisorChecksInput(v *DescribeTrustedAdvisorChecksInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Language != nil {
ok := object.Key("language")
ok.String(*v.Language)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeTrustedAdvisorCheckSummariesInput(v *DescribeTrustedAdvisorCheckSummariesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CheckIds != nil {
ok := object.Key("checkIds")
if err := awsAwsjson11_serializeDocumentStringList(v.CheckIds, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentRefreshTrustedAdvisorCheckInput(v *RefreshTrustedAdvisorCheckInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CheckId != nil {
ok := object.Key("checkId")
ok.String(*v.CheckId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentResolveCaseInput(v *ResolveCaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CaseId != nil {
ok := object.Key("caseId")
ok.String(*v.CaseId)
}
return nil
}
| 1,335 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"context"
"fmt"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAddAttachmentsToSet struct {
}
func (*validateOpAddAttachmentsToSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddAttachmentsToSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddAttachmentsToSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddAttachmentsToSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddCommunicationToCase struct {
}
func (*validateOpAddCommunicationToCase) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddCommunicationToCase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddCommunicationToCaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddCommunicationToCaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCase struct {
}
func (*validateOpCreateCase) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAttachment struct {
}
func (*validateOpDescribeAttachment) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAttachmentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAttachmentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeCommunications struct {
}
func (*validateOpDescribeCommunications) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeCommunications) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeCommunicationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeCommunicationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeCreateCaseOptions struct {
}
func (*validateOpDescribeCreateCaseOptions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeCreateCaseOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeCreateCaseOptionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeCreateCaseOptionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeSupportedLanguages struct {
}
func (*validateOpDescribeSupportedLanguages) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeSupportedLanguages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeSupportedLanguagesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeSupportedLanguagesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTrustedAdvisorCheckRefreshStatuses struct {
}
func (*validateOpDescribeTrustedAdvisorCheckRefreshStatuses) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTrustedAdvisorCheckRefreshStatuses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTrustedAdvisorCheckRefreshStatusesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTrustedAdvisorCheckRefreshStatusesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTrustedAdvisorCheckResult struct {
}
func (*validateOpDescribeTrustedAdvisorCheckResult) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTrustedAdvisorCheckResult) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTrustedAdvisorCheckResultInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTrustedAdvisorCheckResultInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTrustedAdvisorChecks struct {
}
func (*validateOpDescribeTrustedAdvisorChecks) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTrustedAdvisorChecks) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTrustedAdvisorChecksInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTrustedAdvisorChecksInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTrustedAdvisorCheckSummaries struct {
}
func (*validateOpDescribeTrustedAdvisorCheckSummaries) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTrustedAdvisorCheckSummaries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTrustedAdvisorCheckSummariesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTrustedAdvisorCheckSummariesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRefreshTrustedAdvisorCheck struct {
}
func (*validateOpRefreshTrustedAdvisorCheck) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRefreshTrustedAdvisorCheck) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RefreshTrustedAdvisorCheckInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRefreshTrustedAdvisorCheckInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAddAttachmentsToSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddAttachmentsToSet{}, middleware.After)
}
func addOpAddCommunicationToCaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddCommunicationToCase{}, middleware.After)
}
func addOpCreateCaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCase{}, middleware.After)
}
func addOpDescribeAttachmentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAttachment{}, middleware.After)
}
func addOpDescribeCommunicationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeCommunications{}, middleware.After)
}
func addOpDescribeCreateCaseOptionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeCreateCaseOptions{}, middleware.After)
}
func addOpDescribeSupportedLanguagesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeSupportedLanguages{}, middleware.After)
}
func addOpDescribeTrustedAdvisorCheckRefreshStatusesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTrustedAdvisorCheckRefreshStatuses{}, middleware.After)
}
func addOpDescribeTrustedAdvisorCheckResultValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTrustedAdvisorCheckResult{}, middleware.After)
}
func addOpDescribeTrustedAdvisorChecksValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTrustedAdvisorChecks{}, middleware.After)
}
func addOpDescribeTrustedAdvisorCheckSummariesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTrustedAdvisorCheckSummaries{}, middleware.After)
}
func addOpRefreshTrustedAdvisorCheckValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRefreshTrustedAdvisorCheck{}, middleware.After)
}
func validateOpAddAttachmentsToSetInput(v *AddAttachmentsToSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddAttachmentsToSetInput"}
if v.Attachments == nil {
invalidParams.Add(smithy.NewErrParamRequired("Attachments"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddCommunicationToCaseInput(v *AddCommunicationToCaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddCommunicationToCaseInput"}
if v.CommunicationBody == nil {
invalidParams.Add(smithy.NewErrParamRequired("CommunicationBody"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCaseInput(v *CreateCaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCaseInput"}
if v.Subject == nil {
invalidParams.Add(smithy.NewErrParamRequired("Subject"))
}
if v.CommunicationBody == nil {
invalidParams.Add(smithy.NewErrParamRequired("CommunicationBody"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAttachmentInput(v *DescribeAttachmentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAttachmentInput"}
if v.AttachmentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AttachmentId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeCommunicationsInput(v *DescribeCommunicationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeCommunicationsInput"}
if v.CaseId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CaseId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeCreateCaseOptionsInput(v *DescribeCreateCaseOptionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeCreateCaseOptionsInput"}
if v.IssueType == nil {
invalidParams.Add(smithy.NewErrParamRequired("IssueType"))
}
if v.ServiceCode == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceCode"))
}
if v.Language == nil {
invalidParams.Add(smithy.NewErrParamRequired("Language"))
}
if v.CategoryCode == nil {
invalidParams.Add(smithy.NewErrParamRequired("CategoryCode"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeSupportedLanguagesInput(v *DescribeSupportedLanguagesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeSupportedLanguagesInput"}
if v.IssueType == nil {
invalidParams.Add(smithy.NewErrParamRequired("IssueType"))
}
if v.ServiceCode == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceCode"))
}
if v.CategoryCode == nil {
invalidParams.Add(smithy.NewErrParamRequired("CategoryCode"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTrustedAdvisorCheckRefreshStatusesInput(v *DescribeTrustedAdvisorCheckRefreshStatusesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTrustedAdvisorCheckRefreshStatusesInput"}
if v.CheckIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("CheckIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTrustedAdvisorCheckResultInput(v *DescribeTrustedAdvisorCheckResultInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTrustedAdvisorCheckResultInput"}
if v.CheckId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CheckId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTrustedAdvisorChecksInput(v *DescribeTrustedAdvisorChecksInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTrustedAdvisorChecksInput"}
if v.Language == nil {
invalidParams.Add(smithy.NewErrParamRequired("Language"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTrustedAdvisorCheckSummariesInput(v *DescribeTrustedAdvisorCheckSummariesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTrustedAdvisorCheckSummariesInput"}
if v.CheckIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("CheckIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRefreshTrustedAdvisorCheckInput(v *RefreshTrustedAdvisorCheckInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RefreshTrustedAdvisorCheckInput"}
if v.CheckId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CheckId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 497 |
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 Support 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: "support.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "support-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "support-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "support.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "aws-global",
}: endpoints.Endpoint{
Hostname: "support.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "support.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "support-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "support-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "support.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "aws-cn-global",
}: endpoints.Endpoint{
Hostname: "support.cn-north-1.amazonaws.com.cn",
CredentialScope: endpoints.CredentialScope{
Region: "cn-north-1",
},
},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "support-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "support.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "aws-iso-global",
}: endpoints.Endpoint{
Hostname: "support.us-iso-east-1.c2s.ic.gov",
CredentialScope: endpoints.CredentialScope{
Region: "us-iso-east-1",
},
},
},
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "support-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "support.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "aws-iso-b-global",
}: endpoints.Endpoint{
Hostname: "support.us-isob-east-1.sc2s.sgov.gov",
CredentialScope: endpoints.CredentialScope{
Region: "us-isob-east-1",
},
},
},
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "support-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "support.{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: "support-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "support.{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: "support.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "support-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "support-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "support.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "aws-us-gov-global",
}: endpoints.Endpoint{
Hostname: "support.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "support.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "support.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
},
},
}
| 374 |
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
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// An attachment with the specified ID could not be found.
type AttachmentIdNotFound struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AttachmentIdNotFound) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AttachmentIdNotFound) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AttachmentIdNotFound) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AttachmentIdNotFound"
}
return *e.ErrorCodeOverride
}
func (e *AttachmentIdNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The limit for the number of attachment sets created in a short period of time
// has been exceeded.
type AttachmentLimitExceeded struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AttachmentLimitExceeded) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AttachmentLimitExceeded) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AttachmentLimitExceeded) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AttachmentLimitExceeded"
}
return *e.ErrorCodeOverride
}
func (e *AttachmentLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The expiration time of the attachment set has passed. The set expires 1 hour
// after it is created.
type AttachmentSetExpired struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AttachmentSetExpired) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AttachmentSetExpired) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AttachmentSetExpired) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AttachmentSetExpired"
}
return *e.ErrorCodeOverride
}
func (e *AttachmentSetExpired) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// An attachment set with the specified ID could not be found.
type AttachmentSetIdNotFound struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AttachmentSetIdNotFound) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AttachmentSetIdNotFound) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AttachmentSetIdNotFound) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AttachmentSetIdNotFound"
}
return *e.ErrorCodeOverride
}
func (e *AttachmentSetIdNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// A limit for the size of an attachment set has been exceeded. The limits are
// three attachments and 5 MB per attachment.
type AttachmentSetSizeLimitExceeded struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AttachmentSetSizeLimitExceeded) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AttachmentSetSizeLimitExceeded) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AttachmentSetSizeLimitExceeded) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AttachmentSetSizeLimitExceeded"
}
return *e.ErrorCodeOverride
}
func (e *AttachmentSetSizeLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The case creation limit for the account has been exceeded.
type CaseCreationLimitExceeded struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *CaseCreationLimitExceeded) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *CaseCreationLimitExceeded) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *CaseCreationLimitExceeded) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "CaseCreationLimitExceeded"
}
return *e.ErrorCodeOverride
}
func (e *CaseCreationLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The requested caseId couldn't be located.
type CaseIdNotFound struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *CaseIdNotFound) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *CaseIdNotFound) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *CaseIdNotFound) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "CaseIdNotFound"
}
return *e.ErrorCodeOverride
}
func (e *CaseIdNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The limit for the number of DescribeAttachment requests in a short period of
// time has been exceeded.
type DescribeAttachmentLimitExceeded struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *DescribeAttachmentLimitExceeded) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *DescribeAttachmentLimitExceeded) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *DescribeAttachmentLimitExceeded) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "DescribeAttachmentLimitExceeded"
}
return *e.ErrorCodeOverride
}
func (e *DescribeAttachmentLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// An internal server error occurred.
type InternalServerError struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerError) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerError) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerError) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerError"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// You have exceeded the maximum allowed TPS (Transactions Per Second) for the
// operations.
type ThrottlingException struct {
Message *string
ErrorCodeOverride *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 }
| 274 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
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 = "Support App"
const ServiceAPIVersion = "2021-08-20"
// Client provides the API client to make operations call for AWS Support App.
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, "supportapp", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
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 supportapp
import (
"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/supportapp/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a Slack channel configuration for your Amazon Web Services account.
// - You can add up to 5 Slack workspaces for your account.
// - You can add up to 20 Slack channels for your account.
//
// A Slack channel can have up to 100 Amazon Web Services accounts. This means
// that only 100 accounts can add the same Slack channel to the Amazon Web Services
// Support App. We recommend that you only add the accounts that you need to manage
// support cases for your organization. This can reduce the notifications about
// case updates that you receive in the Slack channel. We recommend that you choose
// a private Slack channel so that only members in that channel have read and write
// access to your support cases. Anyone in your Slack channel can create, update,
// or resolve support cases for your account. Users require an invitation to join
// private channels.
func (c *Client) CreateSlackChannelConfiguration(ctx context.Context, params *CreateSlackChannelConfigurationInput, optFns ...func(*Options)) (*CreateSlackChannelConfigurationOutput, error) {
if params == nil {
params = &CreateSlackChannelConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSlackChannelConfiguration", params, optFns, c.addOperationCreateSlackChannelConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSlackChannelConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSlackChannelConfigurationInput struct {
// The channel ID in Slack. This ID identifies a channel within a Slack workspace.
//
// This member is required.
ChannelId *string
// The Amazon Resource Name (ARN) of an IAM role that you want to use to perform
// operations on Amazon Web Services. For more information, see Managing access to
// the Amazon Web Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html)
// in the Amazon Web Services Support User Guide.
//
// This member is required.
ChannelRoleArn *string
// The case severity for a support case that you want to receive notifications. If
// you specify high or all , you must specify true for at least one of the
// following parameters:
// - notifyOnAddCorrespondenceToCase
// - notifyOnCreateOrReopenCase
// - notifyOnResolveCase
// If you specify none , the following parameters must be null or false :
// - notifyOnAddCorrespondenceToCase
// - notifyOnCreateOrReopenCase
// - notifyOnResolveCase
// If you don't specify these parameters in your request, they default to false .
//
// This member is required.
NotifyOnCaseSeverity types.NotificationSeverityLevel
// The team ID in Slack. This ID uniquely identifies a Slack workspace, such as
// T012ABCDEFG .
//
// This member is required.
TeamId *string
// The name of the Slack channel that you configure for the Amazon Web Services
// Support App.
ChannelName *string
// Whether you want to get notified when a support case has a new correspondence.
NotifyOnAddCorrespondenceToCase *bool
// Whether you want to get notified when a support case is created or reopened.
NotifyOnCreateOrReopenCase *bool
// Whether you want to get notified when a support case is resolved.
NotifyOnResolveCase *bool
noSmithyDocumentSerde
}
type CreateSlackChannelConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSlackChannelConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSlackChannelConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSlackChannelConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSlackChannelConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSlackChannelConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateSlackChannelConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "CreateSlackChannelConfiguration",
}
}
| 175 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes an alias for an Amazon Web Services account ID. The alias appears in
// the Amazon Web Services Support App page of the Amazon Web Services Support
// Center. The alias also appears in Slack messages from the Amazon Web Services
// Support App.
func (c *Client) DeleteAccountAlias(ctx context.Context, params *DeleteAccountAliasInput, optFns ...func(*Options)) (*DeleteAccountAliasOutput, error) {
if params == nil {
params = &DeleteAccountAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAccountAlias", params, optFns, c.addOperationDeleteAccountAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAccountAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAccountAliasInput struct {
noSmithyDocumentSerde
}
type DeleteAccountAliasOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAccountAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAccountAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAccountAlias{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDeleteAccountAlias(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteAccountAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "DeleteAccountAlias",
}
}
| 114 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a Slack channel configuration from your Amazon Web Services account.
// This operation doesn't delete your Slack channel.
func (c *Client) DeleteSlackChannelConfiguration(ctx context.Context, params *DeleteSlackChannelConfigurationInput, optFns ...func(*Options)) (*DeleteSlackChannelConfigurationOutput, error) {
if params == nil {
params = &DeleteSlackChannelConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSlackChannelConfiguration", params, optFns, c.addOperationDeleteSlackChannelConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSlackChannelConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSlackChannelConfigurationInput struct {
// The channel ID in Slack. This ID identifies a channel within a Slack workspace.
//
// This member is required.
ChannelId *string
// The team ID in Slack. This ID uniquely identifies a Slack workspace, such as
// T012ABCDEFG .
//
// This member is required.
TeamId *string
noSmithyDocumentSerde
}
type DeleteSlackChannelConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSlackChannelConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSlackChannelConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSlackChannelConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSlackChannelConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSlackChannelConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSlackChannelConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "DeleteSlackChannelConfiguration",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a Slack workspace configuration from your Amazon Web Services account.
// This operation doesn't delete your Slack workspace.
func (c *Client) DeleteSlackWorkspaceConfiguration(ctx context.Context, params *DeleteSlackWorkspaceConfigurationInput, optFns ...func(*Options)) (*DeleteSlackWorkspaceConfigurationOutput, error) {
if params == nil {
params = &DeleteSlackWorkspaceConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSlackWorkspaceConfiguration", params, optFns, c.addOperationDeleteSlackWorkspaceConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSlackWorkspaceConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSlackWorkspaceConfigurationInput struct {
// The team ID in Slack. This ID uniquely identifies a Slack workspace, such as
// T012ABCDEFG .
//
// This member is required.
TeamId *string
noSmithyDocumentSerde
}
type DeleteSlackWorkspaceConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSlackWorkspaceConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSlackWorkspaceConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSlackWorkspaceConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSlackWorkspaceConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSlackWorkspaceConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSlackWorkspaceConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "DeleteSlackWorkspaceConfiguration",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"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"
)
// Retrieves the alias from an Amazon Web Services account ID. The alias appears
// in the Amazon Web Services Support App page of the Amazon Web Services Support
// Center. The alias also appears in Slack messages from the Amazon Web Services
// Support App.
func (c *Client) GetAccountAlias(ctx context.Context, params *GetAccountAliasInput, optFns ...func(*Options)) (*GetAccountAliasOutput, error) {
if params == nil {
params = &GetAccountAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetAccountAlias", params, optFns, c.addOperationGetAccountAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetAccountAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetAccountAliasInput struct {
noSmithyDocumentSerde
}
type GetAccountAliasOutput struct {
// An alias or short name for an Amazon Web Services account.
AccountAlias *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetAccountAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAccountAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAccountAlias{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opGetAccountAlias(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetAccountAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "GetAccountAlias",
}
}
| 118 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
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/supportapp/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the Slack channel configurations for an Amazon Web Services account.
func (c *Client) ListSlackChannelConfigurations(ctx context.Context, params *ListSlackChannelConfigurationsInput, optFns ...func(*Options)) (*ListSlackChannelConfigurationsOutput, error) {
if params == nil {
params = &ListSlackChannelConfigurationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSlackChannelConfigurations", params, optFns, c.addOperationListSlackChannelConfigurationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSlackChannelConfigurationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSlackChannelConfigurationsInput struct {
// If the results of a search are large, the API only returns a portion of the
// results and includes a nextToken pagination token in the response. To retrieve
// the next batch of results, reissue the search request and include the returned
// token. When the API returns the last set of results, the response doesn't
// include a pagination token value.
NextToken *string
noSmithyDocumentSerde
}
type ListSlackChannelConfigurationsOutput struct {
// The configurations for a Slack channel.
//
// This member is required.
SlackChannelConfigurations []types.SlackChannelConfiguration
// The point where pagination should resume when the response returns only partial
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSlackChannelConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSlackChannelConfigurations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSlackChannelConfigurations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListSlackChannelConfigurations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSlackChannelConfigurationsAPIClient is a client that implements the
// ListSlackChannelConfigurations operation.
type ListSlackChannelConfigurationsAPIClient interface {
ListSlackChannelConfigurations(context.Context, *ListSlackChannelConfigurationsInput, ...func(*Options)) (*ListSlackChannelConfigurationsOutput, error)
}
var _ ListSlackChannelConfigurationsAPIClient = (*Client)(nil)
// ListSlackChannelConfigurationsPaginatorOptions is the paginator options for
// ListSlackChannelConfigurations
type ListSlackChannelConfigurationsPaginatorOptions struct {
// 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
}
// ListSlackChannelConfigurationsPaginator is a paginator for
// ListSlackChannelConfigurations
type ListSlackChannelConfigurationsPaginator struct {
options ListSlackChannelConfigurationsPaginatorOptions
client ListSlackChannelConfigurationsAPIClient
params *ListSlackChannelConfigurationsInput
nextToken *string
firstPage bool
}
// NewListSlackChannelConfigurationsPaginator returns a new
// ListSlackChannelConfigurationsPaginator
func NewListSlackChannelConfigurationsPaginator(client ListSlackChannelConfigurationsAPIClient, params *ListSlackChannelConfigurationsInput, optFns ...func(*ListSlackChannelConfigurationsPaginatorOptions)) *ListSlackChannelConfigurationsPaginator {
if params == nil {
params = &ListSlackChannelConfigurationsInput{}
}
options := ListSlackChannelConfigurationsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListSlackChannelConfigurationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSlackChannelConfigurationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSlackChannelConfigurations page.
func (p *ListSlackChannelConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSlackChannelConfigurationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
result, err := p.client.ListSlackChannelConfigurations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSlackChannelConfigurations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "ListSlackChannelConfigurations",
}
}
| 212 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
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/supportapp/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the Slack workspace configurations for an Amazon Web Services account.
func (c *Client) ListSlackWorkspaceConfigurations(ctx context.Context, params *ListSlackWorkspaceConfigurationsInput, optFns ...func(*Options)) (*ListSlackWorkspaceConfigurationsOutput, error) {
if params == nil {
params = &ListSlackWorkspaceConfigurationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSlackWorkspaceConfigurations", params, optFns, c.addOperationListSlackWorkspaceConfigurationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSlackWorkspaceConfigurationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSlackWorkspaceConfigurationsInput struct {
// If the results of a search are large, the API only returns a portion of the
// results and includes a nextToken pagination token in the response. To retrieve
// the next batch of results, reissue the search request and include the returned
// token. When the API returns the last set of results, the response doesn't
// include a pagination token value.
NextToken *string
noSmithyDocumentSerde
}
type ListSlackWorkspaceConfigurationsOutput struct {
// The point where pagination should resume when the response returns only partial
// results.
NextToken *string
// The configurations for a Slack workspace.
SlackWorkspaceConfigurations []types.SlackWorkspaceConfiguration
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSlackWorkspaceConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSlackWorkspaceConfigurations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSlackWorkspaceConfigurations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListSlackWorkspaceConfigurations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSlackWorkspaceConfigurationsAPIClient is a client that implements the
// ListSlackWorkspaceConfigurations operation.
type ListSlackWorkspaceConfigurationsAPIClient interface {
ListSlackWorkspaceConfigurations(context.Context, *ListSlackWorkspaceConfigurationsInput, ...func(*Options)) (*ListSlackWorkspaceConfigurationsOutput, error)
}
var _ ListSlackWorkspaceConfigurationsAPIClient = (*Client)(nil)
// ListSlackWorkspaceConfigurationsPaginatorOptions is the paginator options for
// ListSlackWorkspaceConfigurations
type ListSlackWorkspaceConfigurationsPaginatorOptions struct {
// 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
}
// ListSlackWorkspaceConfigurationsPaginator is a paginator for
// ListSlackWorkspaceConfigurations
type ListSlackWorkspaceConfigurationsPaginator struct {
options ListSlackWorkspaceConfigurationsPaginatorOptions
client ListSlackWorkspaceConfigurationsAPIClient
params *ListSlackWorkspaceConfigurationsInput
nextToken *string
firstPage bool
}
// NewListSlackWorkspaceConfigurationsPaginator returns a new
// ListSlackWorkspaceConfigurationsPaginator
func NewListSlackWorkspaceConfigurationsPaginator(client ListSlackWorkspaceConfigurationsAPIClient, params *ListSlackWorkspaceConfigurationsInput, optFns ...func(*ListSlackWorkspaceConfigurationsPaginatorOptions)) *ListSlackWorkspaceConfigurationsPaginator {
if params == nil {
params = &ListSlackWorkspaceConfigurationsInput{}
}
options := ListSlackWorkspaceConfigurationsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListSlackWorkspaceConfigurationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSlackWorkspaceConfigurationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSlackWorkspaceConfigurations page.
func (p *ListSlackWorkspaceConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSlackWorkspaceConfigurationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
result, err := p.client.ListSlackWorkspaceConfigurations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSlackWorkspaceConfigurations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "ListSlackWorkspaceConfigurations",
}
}
| 210 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates or updates an individual alias for each Amazon Web Services account ID.
// The alias appears in the Amazon Web Services Support App page of the Amazon Web
// Services Support Center. The alias also appears in Slack messages from the
// Amazon Web Services Support App.
func (c *Client) PutAccountAlias(ctx context.Context, params *PutAccountAliasInput, optFns ...func(*Options)) (*PutAccountAliasOutput, error) {
if params == nil {
params = &PutAccountAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAccountAlias", params, optFns, c.addOperationPutAccountAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAccountAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutAccountAliasInput struct {
// An alias or short name for an Amazon Web Services account.
//
// This member is required.
AccountAlias *string
noSmithyDocumentSerde
}
type PutAccountAliasOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAccountAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutAccountAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutAccountAlias{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutAccountAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAccountAlias(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPutAccountAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "PutAccountAlias",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"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/supportapp/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Registers a Slack workspace for your Amazon Web Services account. To call this
// API, your account must be part of an organization in Organizations. If you're
// the management account and you want to register Slack workspaces for your
// organization, you must complete the following tasks:
// - Sign in to the Amazon Web Services Support Center (https://console.aws.amazon.com/support/app)
// and authorize the Slack workspaces where you want your organization to have
// access to. See Authorize a Slack workspace (https://docs.aws.amazon.com/awssupport/latest/user/authorize-slack-workspace.html)
// in the Amazon Web Services Support User Guide.
// - Call the RegisterSlackWorkspaceForOrganization API to authorize each Slack
// workspace for the organization.
//
// After the management account authorizes the Slack workspace, member accounts
// can call this API to authorize the same Slack workspace for their individual
// accounts. Member accounts don't need to authorize the Slack workspace manually
// through the Amazon Web Services Support Center (https://console.aws.amazon.com/support/app)
// . To use the Amazon Web Services Support App, each account must then complete
// the following tasks:
// - Create an Identity and Access Management (IAM) role with the required
// permission. For more information, see Managing access to the Amazon Web
// Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html)
// .
// - Configure a Slack channel to use the Amazon Web Services Support App for
// support cases for that account. For more information, see Configuring a Slack
// channel (https://docs.aws.amazon.com/awssupport/latest/user/add-your-slack-channel.html)
// .
func (c *Client) RegisterSlackWorkspaceForOrganization(ctx context.Context, params *RegisterSlackWorkspaceForOrganizationInput, optFns ...func(*Options)) (*RegisterSlackWorkspaceForOrganizationOutput, error) {
if params == nil {
params = &RegisterSlackWorkspaceForOrganizationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RegisterSlackWorkspaceForOrganization", params, optFns, c.addOperationRegisterSlackWorkspaceForOrganizationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RegisterSlackWorkspaceForOrganizationOutput)
out.ResultMetadata = metadata
return out, nil
}
type RegisterSlackWorkspaceForOrganizationInput struct {
// The team ID in Slack. This ID uniquely identifies a Slack workspace, such as
// T012ABCDEFG . Specify the Slack workspace that you want to use for your
// organization.
//
// This member is required.
TeamId *string
noSmithyDocumentSerde
}
type RegisterSlackWorkspaceForOrganizationOutput struct {
// Whether the Amazon Web Services account is a management or member account
// that's part of an organization in Organizations.
AccountType types.AccountType
// The team ID in Slack. This ID uniquely identifies a Slack workspace, such as
// T012ABCDEFG .
TeamId *string
// The name of the Slack workspace.
TeamName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRegisterSlackWorkspaceForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterSlackWorkspaceForOrganization{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterSlackWorkspaceForOrganization{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRegisterSlackWorkspaceForOrganizationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterSlackWorkspaceForOrganization(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRegisterSlackWorkspaceForOrganization(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "RegisterSlackWorkspaceForOrganization",
}
}
| 159 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"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/supportapp/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the configuration for a Slack channel, such as case update
// notifications.
func (c *Client) UpdateSlackChannelConfiguration(ctx context.Context, params *UpdateSlackChannelConfigurationInput, optFns ...func(*Options)) (*UpdateSlackChannelConfigurationOutput, error) {
if params == nil {
params = &UpdateSlackChannelConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSlackChannelConfiguration", params, optFns, c.addOperationUpdateSlackChannelConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSlackChannelConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSlackChannelConfigurationInput struct {
// The channel ID in Slack. This ID identifies a channel within a Slack workspace.
//
// This member is required.
ChannelId *string
// The team ID in Slack. This ID uniquely identifies a Slack workspace, such as
// T012ABCDEFG .
//
// This member is required.
TeamId *string
// The Slack channel name that you want to update.
ChannelName *string
// The Amazon Resource Name (ARN) of an IAM role that you want to use to perform
// operations on Amazon Web Services. For more information, see Managing access to
// the Amazon Web Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html)
// in the Amazon Web Services Support User Guide.
ChannelRoleArn *string
// Whether you want to get notified when a support case has a new correspondence.
NotifyOnAddCorrespondenceToCase *bool
// The case severity for a support case that you want to receive notifications. If
// you specify high or all , at least one of the following parameters must be true
// :
// - notifyOnAddCorrespondenceToCase
// - notifyOnCreateOrReopenCase
// - notifyOnResolveCase
// If you specify none , any of the following parameters that you specify in your
// request must be false :
// - notifyOnAddCorrespondenceToCase
// - notifyOnCreateOrReopenCase
// - notifyOnResolveCase
// If you don't specify these parameters in your request, the Amazon Web Services
// Support App uses the current values by default.
NotifyOnCaseSeverity types.NotificationSeverityLevel
// Whether you want to get notified when a support case is created or reopened.
NotifyOnCreateOrReopenCase *bool
// Whether you want to get notified when a support case is resolved.
NotifyOnResolveCase *bool
noSmithyDocumentSerde
}
type UpdateSlackChannelConfigurationOutput struct {
// The channel ID in Slack. This ID identifies a channel within a Slack workspace.
ChannelId *string
// The name of the Slack channel that you configure for the Amazon Web Services
// Support App.
ChannelName *string
// The Amazon Resource Name (ARN) of an IAM role that you want to use to perform
// operations on Amazon Web Services. For more information, see Managing access to
// the Amazon Web Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html)
// in the Amazon Web Services Support User Guide.
ChannelRoleArn *string
// Whether you want to get notified when a support case has a new correspondence.
NotifyOnAddCorrespondenceToCase *bool
// The case severity for a support case that you want to receive notifications.
NotifyOnCaseSeverity types.NotificationSeverityLevel
// Whether you want to get notified when a support case is created or reopened.
NotifyOnCreateOrReopenCase *bool
// Whether you want to get notified when a support case is resolved.
NotifyOnResolveCase *bool
// The team ID in Slack. This ID uniquely identifies a Slack workspace, such as
// T012ABCDEFG .
TeamId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSlackChannelConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSlackChannelConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSlackChannelConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSlackChannelConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSlackChannelConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSlackChannelConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "supportapp",
OperationName: "UpdateSlackChannelConfiguration",
}
}
| 191 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/supportapp/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"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsRestjson1_deserializeOpCreateSlackChannelConfiguration struct {
}
func (*awsRestjson1_deserializeOpCreateSlackChannelConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateSlackChannelConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateSlackChannelConfiguration(response, &metadata)
}
output := &CreateSlackChannelConfigurationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateSlackChannelConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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
}
}
type awsRestjson1_deserializeOpDeleteAccountAlias struct {
}
func (*awsRestjson1_deserializeOpDeleteAccountAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteAccountAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteAccountAlias(response, &metadata)
}
output := &DeleteAccountAliasOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteAccountAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteSlackChannelConfiguration struct {
}
func (*awsRestjson1_deserializeOpDeleteSlackChannelConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteSlackChannelConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteSlackChannelConfiguration(response, &metadata)
}
output := &DeleteSlackChannelConfigurationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteSlackChannelConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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_deserializeOpDeleteSlackWorkspaceConfiguration struct {
}
func (*awsRestjson1_deserializeOpDeleteSlackWorkspaceConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteSlackWorkspaceConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteSlackWorkspaceConfiguration(response, &metadata)
}
output := &DeleteSlackWorkspaceConfigurationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteSlackWorkspaceConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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_deserializeOpGetAccountAlias struct {
}
func (*awsRestjson1_deserializeOpGetAccountAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetAccountAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetAccountAlias(response, &metadata)
}
output := &GetAccountAliasOutput{}
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_deserializeOpDocumentGetAccountAliasOutput(&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_deserializeOpErrorGetAccountAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetAccountAliasOutput(v **GetAccountAliasOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetAccountAliasOutput
if *v == nil {
sv = &GetAccountAliasOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "accountAlias":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected awsAccountAlias to be of type string, got %T instead", value)
}
sv.AccountAlias = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSlackChannelConfigurations struct {
}
func (*awsRestjson1_deserializeOpListSlackChannelConfigurations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSlackChannelConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListSlackChannelConfigurations(response, &metadata)
}
output := &ListSlackChannelConfigurationsOutput{}
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_deserializeOpDocumentListSlackChannelConfigurationsOutput(&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_deserializeOpErrorListSlackChannelConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSlackChannelConfigurationsOutput(v **ListSlackChannelConfigurationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSlackChannelConfigurationsOutput
if *v == nil {
sv = &ListSlackChannelConfigurationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected paginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "slackChannelConfigurations":
if err := awsRestjson1_deserializeDocumentSlackChannelConfigurationList(&sv.SlackChannelConfigurations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSlackWorkspaceConfigurations struct {
}
func (*awsRestjson1_deserializeOpListSlackWorkspaceConfigurations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSlackWorkspaceConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListSlackWorkspaceConfigurations(response, &metadata)
}
output := &ListSlackWorkspaceConfigurationsOutput{}
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_deserializeOpDocumentListSlackWorkspaceConfigurationsOutput(&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_deserializeOpErrorListSlackWorkspaceConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSlackWorkspaceConfigurationsOutput(v **ListSlackWorkspaceConfigurationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSlackWorkspaceConfigurationsOutput
if *v == nil {
sv = &ListSlackWorkspaceConfigurationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected paginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "slackWorkspaceConfigurations":
if err := awsRestjson1_deserializeDocumentSlackWorkspaceConfigurationList(&sv.SlackWorkspaceConfigurations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutAccountAlias struct {
}
func (*awsRestjson1_deserializeOpPutAccountAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutAccountAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutAccountAlias(response, &metadata)
}
output := &PutAccountAliasOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutAccountAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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
}
}
type awsRestjson1_deserializeOpRegisterSlackWorkspaceForOrganization struct {
}
func (*awsRestjson1_deserializeOpRegisterSlackWorkspaceForOrganization) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpRegisterSlackWorkspaceForOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorRegisterSlackWorkspaceForOrganization(response, &metadata)
}
output := &RegisterSlackWorkspaceForOrganizationOutput{}
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_deserializeOpDocumentRegisterSlackWorkspaceForOrganizationOutput(&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_deserializeOpErrorRegisterSlackWorkspaceForOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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
}
}
func awsRestjson1_deserializeOpDocumentRegisterSlackWorkspaceForOrganizationOutput(v **RegisterSlackWorkspaceForOrganizationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RegisterSlackWorkspaceForOrganizationOutput
if *v == nil {
sv = &RegisterSlackWorkspaceForOrganizationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "accountType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccountType to be of type string, got %T instead", value)
}
sv.AccountType = types.AccountType(jtv)
}
case "teamId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected teamId to be of type string, got %T instead", value)
}
sv.TeamId = ptr.String(jtv)
}
case "teamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected teamName to be of type string, got %T instead", value)
}
sv.TeamName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateSlackChannelConfiguration struct {
}
func (*awsRestjson1_deserializeOpUpdateSlackChannelConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateSlackChannelConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateSlackChannelConfiguration(response, &metadata)
}
output := &UpdateSlackChannelConfigurationOutput{}
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_deserializeOpDocumentUpdateSlackChannelConfigurationOutput(&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_deserializeOpErrorUpdateSlackChannelConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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
}
}
func awsRestjson1_deserializeOpDocumentUpdateSlackChannelConfigurationOutput(v **UpdateSlackChannelConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateSlackChannelConfigurationOutput
if *v == nil {
sv = &UpdateSlackChannelConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "channelId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected channelId to be of type string, got %T instead", value)
}
sv.ChannelId = ptr.String(jtv)
}
case "channelName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected channelName to be of type string, got %T instead", value)
}
sv.ChannelName = ptr.String(jtv)
}
case "channelRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected roleArn to be of type string, got %T instead", value)
}
sv.ChannelRoleArn = ptr.String(jtv)
}
case "notifyOnAddCorrespondenceToCase":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected booleanValue to be of type *bool, got %T instead", value)
}
sv.NotifyOnAddCorrespondenceToCase = ptr.Bool(jtv)
}
case "notifyOnCaseSeverity":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NotificationSeverityLevel to be of type string, got %T instead", value)
}
sv.NotifyOnCaseSeverity = types.NotificationSeverityLevel(jtv)
}
case "notifyOnCreateOrReopenCase":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected booleanValue to be of type *bool, got %T instead", value)
}
sv.NotifyOnCreateOrReopenCase = ptr.Bool(jtv)
}
case "notifyOnResolveCase":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected booleanValue to be of type *bool, got %T instead", value)
}
sv.NotifyOnResolveCase = ptr.Bool(jtv)
}
case "teamId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected teamId to be of type string, got %T instead", value)
}
sv.TeamId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AccessDeniedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_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_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 errorMessage to be of type string, got %T instead", value)
}
sv.Message = 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 errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
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 errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
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 errorMessage to be of type string, got %T instead", value)
}
sv.Message = 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 errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlackChannelConfiguration(v **types.SlackChannelConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SlackChannelConfiguration
if *v == nil {
sv = &types.SlackChannelConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "channelId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected channelId to be of type string, got %T instead", value)
}
sv.ChannelId = ptr.String(jtv)
}
case "channelName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected channelName to be of type string, got %T instead", value)
}
sv.ChannelName = ptr.String(jtv)
}
case "channelRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected roleArn to be of type string, got %T instead", value)
}
sv.ChannelRoleArn = ptr.String(jtv)
}
case "notifyOnAddCorrespondenceToCase":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected booleanValue to be of type *bool, got %T instead", value)
}
sv.NotifyOnAddCorrespondenceToCase = ptr.Bool(jtv)
}
case "notifyOnCaseSeverity":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NotificationSeverityLevel to be of type string, got %T instead", value)
}
sv.NotifyOnCaseSeverity = types.NotificationSeverityLevel(jtv)
}
case "notifyOnCreateOrReopenCase":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected booleanValue to be of type *bool, got %T instead", value)
}
sv.NotifyOnCreateOrReopenCase = ptr.Bool(jtv)
}
case "notifyOnResolveCase":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected booleanValue to be of type *bool, got %T instead", value)
}
sv.NotifyOnResolveCase = ptr.Bool(jtv)
}
case "teamId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected teamId to be of type string, got %T instead", value)
}
sv.TeamId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlackChannelConfigurationList(v *[]types.SlackChannelConfiguration, 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.SlackChannelConfiguration
if *v == nil {
cv = []types.SlackChannelConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SlackChannelConfiguration
destAddr := &col
if err := awsRestjson1_deserializeDocumentSlackChannelConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSlackWorkspaceConfiguration(v **types.SlackWorkspaceConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SlackWorkspaceConfiguration
if *v == nil {
sv = &types.SlackWorkspaceConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "allowOrganizationMemberAccount":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected booleanValue to be of type *bool, got %T instead", value)
}
sv.AllowOrganizationMemberAccount = ptr.Bool(jtv)
}
case "teamId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected teamId to be of type string, got %T instead", value)
}
sv.TeamId = ptr.String(jtv)
}
case "teamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected teamName to be of type string, got %T instead", value)
}
sv.TeamName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlackWorkspaceConfigurationList(v *[]types.SlackWorkspaceConfiguration, 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.SlackWorkspaceConfiguration
if *v == nil {
cv = []types.SlackWorkspaceConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SlackWorkspaceConfiguration
destAddr := &col
if err := awsRestjson1_deserializeDocumentSlackWorkspaceConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
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 errorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 2,044 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package supportapp provides the API client, operations, and parameter types for
// AWS Support App.
//
// Amazon Web Services Support App in Slack You can use the Amazon Web Services
// Support App in Slack API to manage your support cases in Slack for your Amazon
// Web Services account. After you configure your Slack workspace and channel with
// the Amazon Web Services Support App, you can perform the following tasks
// directly in your Slack channel:
// - Create, search, update, and resolve your support cases
// - Request service quota increases for your account
// - Invite Amazon Web Services Support agents to your channel so that you can
// chat directly about your support cases
//
// For more information about how to perform these actions in Slack, see the
// following documentation in the Amazon Web Services Support User Guide:
// - Amazon Web Services Support App in Slack (https://docs.aws.amazon.com/awssupport/latest/user/aws-support-app-for-slack.html)
// - Joining a live chat session with Amazon Web Services Support (https://docs.aws.amazon.com/awssupport/latest/user/joining-a-live-chat-session.html)
// - Requesting service quota increases (https://docs.aws.amazon.com/awssupport/latest/user/service-quota-increase.html)
// - Amazon Web Services Support App commands in Slack (https://docs.aws.amazon.com/awssupport/latest/user/support-app-commands.html)
//
// You can also use the Amazon Web Services Management Console instead of the
// Amazon Web Services Support App API to manage your Slack configurations. For
// more information, see Authorize a Slack workspace to enable the Amazon Web
// Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/authorize-slack-workspace.html)
// .
// - You must have a Business or Enterprise Support plan to use the Amazon Web
// Services Support App API.
// - For more information about the Amazon Web Services Support App endpoints,
// see the Amazon Web Services Support App in Slack endpoints (https://docs.aws.amazon.com/general/latest/gr/awssupport.html#awssupport_app_region)
// in the Amazon Web Services General Reference.
package supportapp
| 34 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
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/supportapp/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 = "supportapp"
}
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 supportapp
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.2.12"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"bytes"
"context"
"fmt"
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_serializeOpCreateSlackChannelConfiguration struct {
}
func (*awsRestjson1_serializeOpCreateSlackChannelConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateSlackChannelConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSlackChannelConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/create-slack-channel-configuration")
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_serializeOpDocumentCreateSlackChannelConfigurationInput(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_serializeOpHttpBindingsCreateSlackChannelConfigurationInput(v *CreateSlackChannelConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateSlackChannelConfigurationInput(v *CreateSlackChannelConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChannelId != nil {
ok := object.Key("channelId")
ok.String(*v.ChannelId)
}
if v.ChannelName != nil {
ok := object.Key("channelName")
ok.String(*v.ChannelName)
}
if v.ChannelRoleArn != nil {
ok := object.Key("channelRoleArn")
ok.String(*v.ChannelRoleArn)
}
if v.NotifyOnAddCorrespondenceToCase != nil {
ok := object.Key("notifyOnAddCorrespondenceToCase")
ok.Boolean(*v.NotifyOnAddCorrespondenceToCase)
}
if len(v.NotifyOnCaseSeverity) > 0 {
ok := object.Key("notifyOnCaseSeverity")
ok.String(string(v.NotifyOnCaseSeverity))
}
if v.NotifyOnCreateOrReopenCase != nil {
ok := object.Key("notifyOnCreateOrReopenCase")
ok.Boolean(*v.NotifyOnCreateOrReopenCase)
}
if v.NotifyOnResolveCase != nil {
ok := object.Key("notifyOnResolveCase")
ok.Boolean(*v.NotifyOnResolveCase)
}
if v.TeamId != nil {
ok := object.Key("teamId")
ok.String(*v.TeamId)
}
return nil
}
type awsRestjson1_serializeOpDeleteAccountAlias struct {
}
func (*awsRestjson1_serializeOpDeleteAccountAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAccountAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAccountAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/delete-account-alias")
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 request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteAccountAliasInput(v *DeleteAccountAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDeleteSlackChannelConfiguration struct {
}
func (*awsRestjson1_serializeOpDeleteSlackChannelConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSlackChannelConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSlackChannelConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/delete-slack-channel-configuration")
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_serializeOpDocumentDeleteSlackChannelConfigurationInput(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_serializeOpHttpBindingsDeleteSlackChannelConfigurationInput(v *DeleteSlackChannelConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteSlackChannelConfigurationInput(v *DeleteSlackChannelConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChannelId != nil {
ok := object.Key("channelId")
ok.String(*v.ChannelId)
}
if v.TeamId != nil {
ok := object.Key("teamId")
ok.String(*v.TeamId)
}
return nil
}
type awsRestjson1_serializeOpDeleteSlackWorkspaceConfiguration struct {
}
func (*awsRestjson1_serializeOpDeleteSlackWorkspaceConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSlackWorkspaceConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSlackWorkspaceConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/delete-slack-workspace-configuration")
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_serializeOpDocumentDeleteSlackWorkspaceConfigurationInput(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_serializeOpHttpBindingsDeleteSlackWorkspaceConfigurationInput(v *DeleteSlackWorkspaceConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteSlackWorkspaceConfigurationInput(v *DeleteSlackWorkspaceConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TeamId != nil {
ok := object.Key("teamId")
ok.String(*v.TeamId)
}
return nil
}
type awsRestjson1_serializeOpGetAccountAlias struct {
}
func (*awsRestjson1_serializeOpGetAccountAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAccountAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetAccountAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/get-account-alias")
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 request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetAccountAliasInput(v *GetAccountAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpListSlackChannelConfigurations struct {
}
func (*awsRestjson1_serializeOpListSlackChannelConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSlackChannelConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSlackChannelConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/list-slack-channel-configurations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListSlackChannelConfigurationsInput(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_serializeOpHttpBindingsListSlackChannelConfigurationsInput(v *ListSlackChannelConfigurationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListSlackChannelConfigurationsInput(v *ListSlackChannelConfigurationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListSlackWorkspaceConfigurations struct {
}
func (*awsRestjson1_serializeOpListSlackWorkspaceConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSlackWorkspaceConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSlackWorkspaceConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/list-slack-workspace-configurations")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListSlackWorkspaceConfigurationsInput(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_serializeOpHttpBindingsListSlackWorkspaceConfigurationsInput(v *ListSlackWorkspaceConfigurationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListSlackWorkspaceConfigurationsInput(v *ListSlackWorkspaceConfigurationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpPutAccountAlias struct {
}
func (*awsRestjson1_serializeOpPutAccountAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutAccountAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutAccountAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/put-account-alias")
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_serializeOpDocumentPutAccountAliasInput(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_serializeOpHttpBindingsPutAccountAliasInput(v *PutAccountAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutAccountAliasInput(v *PutAccountAliasInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccountAlias != nil {
ok := object.Key("accountAlias")
ok.String(*v.AccountAlias)
}
return nil
}
type awsRestjson1_serializeOpRegisterSlackWorkspaceForOrganization struct {
}
func (*awsRestjson1_serializeOpRegisterSlackWorkspaceForOrganization) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRegisterSlackWorkspaceForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RegisterSlackWorkspaceForOrganizationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/register-slack-workspace-for-organization")
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_serializeOpDocumentRegisterSlackWorkspaceForOrganizationInput(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_serializeOpHttpBindingsRegisterSlackWorkspaceForOrganizationInput(v *RegisterSlackWorkspaceForOrganizationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentRegisterSlackWorkspaceForOrganizationInput(v *RegisterSlackWorkspaceForOrganizationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TeamId != nil {
ok := object.Key("teamId")
ok.String(*v.TeamId)
}
return nil
}
type awsRestjson1_serializeOpUpdateSlackChannelConfiguration struct {
}
func (*awsRestjson1_serializeOpUpdateSlackChannelConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateSlackChannelConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSlackChannelConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/control/update-slack-channel-configuration")
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_serializeOpDocumentUpdateSlackChannelConfigurationInput(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_serializeOpHttpBindingsUpdateSlackChannelConfigurationInput(v *UpdateSlackChannelConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateSlackChannelConfigurationInput(v *UpdateSlackChannelConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChannelId != nil {
ok := object.Key("channelId")
ok.String(*v.ChannelId)
}
if v.ChannelName != nil {
ok := object.Key("channelName")
ok.String(*v.ChannelName)
}
if v.ChannelRoleArn != nil {
ok := object.Key("channelRoleArn")
ok.String(*v.ChannelRoleArn)
}
if v.NotifyOnAddCorrespondenceToCase != nil {
ok := object.Key("notifyOnAddCorrespondenceToCase")
ok.Boolean(*v.NotifyOnAddCorrespondenceToCase)
}
if len(v.NotifyOnCaseSeverity) > 0 {
ok := object.Key("notifyOnCaseSeverity")
ok.String(string(v.NotifyOnCaseSeverity))
}
if v.NotifyOnCreateOrReopenCase != nil {
ok := object.Key("notifyOnCreateOrReopenCase")
ok.Boolean(*v.NotifyOnCreateOrReopenCase)
}
if v.NotifyOnResolveCase != nil {
ok := object.Key("notifyOnResolveCase")
ok.Boolean(*v.NotifyOnResolveCase)
}
if v.TeamId != nil {
ok := object.Key("teamId")
ok.String(*v.TeamId)
}
return nil
}
| 724 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package supportapp
import (
"context"
"fmt"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateSlackChannelConfiguration struct {
}
func (*validateOpCreateSlackChannelConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSlackChannelConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSlackChannelConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSlackChannelConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSlackChannelConfiguration struct {
}
func (*validateOpDeleteSlackChannelConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSlackChannelConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSlackChannelConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSlackChannelConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSlackWorkspaceConfiguration struct {
}
func (*validateOpDeleteSlackWorkspaceConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSlackWorkspaceConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSlackWorkspaceConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSlackWorkspaceConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutAccountAlias struct {
}
func (*validateOpPutAccountAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutAccountAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutAccountAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutAccountAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRegisterSlackWorkspaceForOrganization struct {
}
func (*validateOpRegisterSlackWorkspaceForOrganization) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRegisterSlackWorkspaceForOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RegisterSlackWorkspaceForOrganizationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRegisterSlackWorkspaceForOrganizationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSlackChannelConfiguration struct {
}
func (*validateOpUpdateSlackChannelConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSlackChannelConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSlackChannelConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSlackChannelConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateSlackChannelConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSlackChannelConfiguration{}, middleware.After)
}
func addOpDeleteSlackChannelConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSlackChannelConfiguration{}, middleware.After)
}
func addOpDeleteSlackWorkspaceConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSlackWorkspaceConfiguration{}, middleware.After)
}
func addOpPutAccountAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutAccountAlias{}, middleware.After)
}
func addOpRegisterSlackWorkspaceForOrganizationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRegisterSlackWorkspaceForOrganization{}, middleware.After)
}
func addOpUpdateSlackChannelConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSlackChannelConfiguration{}, middleware.After)
}
func validateOpCreateSlackChannelConfigurationInput(v *CreateSlackChannelConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSlackChannelConfigurationInput"}
if v.TeamId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TeamId"))
}
if v.ChannelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChannelId"))
}
if len(v.NotifyOnCaseSeverity) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("NotifyOnCaseSeverity"))
}
if v.ChannelRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChannelRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSlackChannelConfigurationInput(v *DeleteSlackChannelConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSlackChannelConfigurationInput"}
if v.TeamId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TeamId"))
}
if v.ChannelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChannelId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSlackWorkspaceConfigurationInput(v *DeleteSlackWorkspaceConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSlackWorkspaceConfigurationInput"}
if v.TeamId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TeamId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutAccountAliasInput(v *PutAccountAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAccountAliasInput"}
if v.AccountAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountAlias"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRegisterSlackWorkspaceForOrganizationInput(v *RegisterSlackWorkspaceForOrganizationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegisterSlackWorkspaceForOrganizationInput"}
if v.TeamId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TeamId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSlackChannelConfigurationInput(v *UpdateSlackChannelConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSlackChannelConfigurationInput"}
if v.TeamId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TeamId"))
}
if v.ChannelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChannelId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 260 |
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 Support App 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: "supportapp.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "supportapp-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "supportapp-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "supportapp.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "supportapp.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "supportapp-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "supportapp-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "supportapp.{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: "supportapp-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "supportapp.{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: "supportapp-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "supportapp.{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: "supportapp-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "supportapp.{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: "supportapp-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "supportapp.{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: "supportapp.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "supportapp-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "supportapp-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "supportapp.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 308 |
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 AccountType string
// Enum values for AccountType
const (
AccountTypeManagement AccountType = "management"
AccountTypeMember AccountType = "member"
)
// Values returns all known values for AccountType. 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 (AccountType) Values() []AccountType {
return []AccountType{
"management",
"member",
}
}
type NotificationSeverityLevel string
// Enum values for NotificationSeverityLevel
const (
NotificationSeverityLevelNone NotificationSeverityLevel = "none"
NotificationSeverityLevelAll NotificationSeverityLevel = "all"
NotificationSeverityLevelHigh NotificationSeverityLevel = "high"
)
// Values returns all known values for NotificationSeverityLevel. 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 (NotificationSeverityLevel) Values() []NotificationSeverityLevel {
return []NotificationSeverityLevel{
"none",
"all",
"high",
}
}
| 42 |
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 don't have sufficient permission to perform this action.
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 }
// Your request has a conflict. For example, you might receive this error if you
// try the following:
// - Add, update, or delete a Slack channel configuration before you add a Slack
// workspace to your Amazon Web Services account.
// - Add a Slack channel configuration that already exists in your Amazon Web
// Services account.
// - Delete a Slack channel configuration for a live chat channel.
// - Delete a Slack workspace from your Amazon Web Services account that has an
// active live chat channel.
// - Call the RegisterSlackWorkspaceForOrganization API from an Amazon Web
// Services account that doesn't belong to an organization.
// - Call the RegisterSlackWorkspaceForOrganization API from a member account,
// but the management account hasn't registered that workspace yet for the
// organization.
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 }
// We can’t process your request right now because of a server issue. Try again
// later.
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 }
// The specified resource is missing or doesn't exist, such as an account alias,
// Slack channel configuration, or Slack workspace configuration.
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 }
// Your Service Quotas request exceeds the quota for the service. For example,
// your Service Quotas request to Amazon Web Services Support App might exceed the
// maximum number of workspaces or channels per account, or the maximum number of
// accounts per Slack channel.
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 }
// Your request input doesn't meet the constraints that the Amazon Web Services
// Support App specifies.
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"
)
// The configuration for a Slack channel that you added for your Amazon Web
// Services account.
type SlackChannelConfiguration struct {
// The channel ID in Slack. This ID identifies a channel within a Slack workspace.
//
// This member is required.
ChannelId *string
// The team ID in Slack. This ID uniquely identifies a Slack workspace, such as
// T012ABCDEFG .
//
// This member is required.
TeamId *string
// The name of the Slack channel that you configured with the Amazon Web Services
// Support App for your Amazon Web Services account.
ChannelName *string
// The Amazon Resource Name (ARN) of an IAM role that you want to use to perform
// operations on Amazon Web Services. For more information, see Managing access to
// the Amazon Web Services Support App (https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html)
// in the Amazon Web Services Support User Guide.
ChannelRoleArn *string
// Whether you want to get notified when a support case has a new correspondence.
NotifyOnAddCorrespondenceToCase *bool
// The case severity for a support case that you want to receive notifications.
NotifyOnCaseSeverity NotificationSeverityLevel
// Whether you want to get notified when a support case is created or reopened.
NotifyOnCreateOrReopenCase *bool
// Whether you want to get notified when a support case is resolved.
NotifyOnResolveCase *bool
noSmithyDocumentSerde
}
// The configuration for a Slack workspace that you added to an Amazon Web
// Services account.
type SlackWorkspaceConfiguration struct {
// The team ID in Slack. This ID uniquely identifies a Slack workspace, such as
// T012ABCDEFG .
//
// This member is required.
TeamId *string
// Whether to allow member accounts to authorize Slack workspaces. Member accounts
// must be part of an organization in Organizations.
AllowOrganizationMemberAccount *bool
// The name of the Slack workspace.
TeamName *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 70 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
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 = "SWF"
const ServiceAPIVersion = "2012-01-25"
// Client provides the API client to make operations call for Amazon Simple
// Workflow 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, "swf", 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 swf
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 swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the number of closed workflow executions within the given domain that
// meet the specified filtering criteria. This operation is eventually consistent.
// The results are best effort and may not exactly reflect recent updates and
// changes. Access Control You can use IAM policies to control this action's access
// to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the following parameters by using a Condition element with the
// appropriate keys.
// - tagFilter.tag : String constraint. The key is swf:tagFilter.tag .
// - typeFilter.name : String constraint. The key is swf:typeFilter.name .
// - typeFilter.version : String constraint. The key is swf:typeFilter.version .
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) CountClosedWorkflowExecutions(ctx context.Context, params *CountClosedWorkflowExecutionsInput, optFns ...func(*Options)) (*CountClosedWorkflowExecutionsOutput, error) {
if params == nil {
params = &CountClosedWorkflowExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CountClosedWorkflowExecutions", params, optFns, c.addOperationCountClosedWorkflowExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CountClosedWorkflowExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type CountClosedWorkflowExecutionsInput struct {
// The name of the domain containing the workflow executions to count.
//
// This member is required.
Domain *string
// If specified, only workflow executions that match this close status are
// counted. This filter has an affect only if executionStatus is specified as
// CLOSED . closeStatusFilter , executionFilter , typeFilter and tagFilter are
// mutually exclusive. You can specify at most one of these in a request.
CloseStatusFilter *types.CloseStatusFilter
// If specified, only workflow executions that meet the close time criteria of the
// filter are counted. startTimeFilter and closeTimeFilter are mutually exclusive.
// You must specify one of these in a request but not both.
CloseTimeFilter *types.ExecutionTimeFilter
// If specified, only workflow executions matching the WorkflowId in the filter
// are counted. closeStatusFilter , executionFilter , typeFilter and tagFilter are
// mutually exclusive. You can specify at most one of these in a request.
ExecutionFilter *types.WorkflowExecutionFilter
// If specified, only workflow executions that meet the start time criteria of the
// filter are counted. startTimeFilter and closeTimeFilter are mutually exclusive.
// You must specify one of these in a request but not both.
StartTimeFilter *types.ExecutionTimeFilter
// If specified, only executions that have a tag that matches the filter are
// counted. closeStatusFilter , executionFilter , typeFilter and tagFilter are
// mutually exclusive. You can specify at most one of these in a request.
TagFilter *types.TagFilter
// If specified, indicates the type of the workflow executions to be counted.
// closeStatusFilter , executionFilter , typeFilter and tagFilter are mutually
// exclusive. You can specify at most one of these in a request.
TypeFilter *types.WorkflowTypeFilter
noSmithyDocumentSerde
}
// Contains the count of workflow executions returned from
// CountOpenWorkflowExecutions or CountClosedWorkflowExecutions
type CountClosedWorkflowExecutionsOutput struct {
// The number of workflow executions.
//
// This member is required.
Count int32
// If set to true, indicates that the actual count was more than the maximum
// supported by this API and the count returned is the truncated value.
Truncated bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCountClosedWorkflowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCountClosedWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCountClosedWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCountClosedWorkflowExecutionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCountClosedWorkflowExecutions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCountClosedWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "CountClosedWorkflowExecutions",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the number of open workflow executions within the given domain that
// meet the specified filtering criteria. This operation is eventually consistent.
// The results are best effort and may not exactly reflect recent updates and
// changes. Access Control You can use IAM policies to control this action's access
// to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the following parameters by using a Condition element with the
// appropriate keys.
// - tagFilter.tag : String constraint. The key is swf:tagFilter.tag .
// - typeFilter.name : String constraint. The key is swf:typeFilter.name .
// - typeFilter.version : String constraint. The key is swf:typeFilter.version .
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) CountOpenWorkflowExecutions(ctx context.Context, params *CountOpenWorkflowExecutionsInput, optFns ...func(*Options)) (*CountOpenWorkflowExecutionsOutput, error) {
if params == nil {
params = &CountOpenWorkflowExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CountOpenWorkflowExecutions", params, optFns, c.addOperationCountOpenWorkflowExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CountOpenWorkflowExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type CountOpenWorkflowExecutionsInput struct {
// The name of the domain containing the workflow executions to count.
//
// This member is required.
Domain *string
// Specifies the start time criteria that workflow executions must meet in order
// to be counted.
//
// This member is required.
StartTimeFilter *types.ExecutionTimeFilter
// If specified, only workflow executions matching the WorkflowId in the filter
// are counted. executionFilter , typeFilter and tagFilter are mutually exclusive.
// You can specify at most one of these in a request.
ExecutionFilter *types.WorkflowExecutionFilter
// If specified, only executions that have a tag that matches the filter are
// counted. executionFilter , typeFilter and tagFilter are mutually exclusive. You
// can specify at most one of these in a request.
TagFilter *types.TagFilter
// Specifies the type of the workflow executions to be counted. executionFilter ,
// typeFilter and tagFilter are mutually exclusive. You can specify at most one of
// these in a request.
TypeFilter *types.WorkflowTypeFilter
noSmithyDocumentSerde
}
// Contains the count of workflow executions returned from
// CountOpenWorkflowExecutions or CountClosedWorkflowExecutions
type CountOpenWorkflowExecutionsOutput struct {
// The number of workflow executions.
//
// This member is required.
Count int32
// If set to true, indicates that the actual count was more than the maximum
// supported by this API and the count returned is the truncated value.
Truncated bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCountOpenWorkflowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCountOpenWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCountOpenWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCountOpenWorkflowExecutionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCountOpenWorkflowExecutions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCountOpenWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "CountOpenWorkflowExecutions",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the estimated number of activity tasks in the specified task list. The
// count returned is an approximation and isn't guaranteed to be exact. If you
// specify a task list that no activity task was ever scheduled in then 0 is
// returned. Access Control You can use IAM policies to control this action's
// access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the taskList.name parameter by using a Condition element with the
// swf:taskList.name key to allow the action to access only certain task lists.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) CountPendingActivityTasks(ctx context.Context, params *CountPendingActivityTasksInput, optFns ...func(*Options)) (*CountPendingActivityTasksOutput, error) {
if params == nil {
params = &CountPendingActivityTasksInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CountPendingActivityTasks", params, optFns, c.addOperationCountPendingActivityTasksMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CountPendingActivityTasksOutput)
out.ResultMetadata = metadata
return out, nil
}
type CountPendingActivityTasksInput struct {
// The name of the domain that contains the task list.
//
// This member is required.
Domain *string
// The name of the task list.
//
// This member is required.
TaskList *types.TaskList
noSmithyDocumentSerde
}
// Contains the count of tasks in a task list.
type CountPendingActivityTasksOutput struct {
// The number of tasks in the task list.
//
// This member is required.
Count int32
// If set to true, indicates that the actual count was more than the maximum
// supported by this API and the count returned is the truncated value.
Truncated bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCountPendingActivityTasksMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCountPendingActivityTasks{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCountPendingActivityTasks{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCountPendingActivityTasksValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCountPendingActivityTasks(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCountPendingActivityTasks(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "CountPendingActivityTasks",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the estimated number of decision tasks in the specified task list. The
// count returned is an approximation and isn't guaranteed to be exact. If you
// specify a task list that no decision task was ever scheduled in then 0 is
// returned. Access Control You can use IAM policies to control this action's
// access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the taskList.name parameter by using a Condition element with the
// swf:taskList.name key to allow the action to access only certain task lists.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) CountPendingDecisionTasks(ctx context.Context, params *CountPendingDecisionTasksInput, optFns ...func(*Options)) (*CountPendingDecisionTasksOutput, error) {
if params == nil {
params = &CountPendingDecisionTasksInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CountPendingDecisionTasks", params, optFns, c.addOperationCountPendingDecisionTasksMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CountPendingDecisionTasksOutput)
out.ResultMetadata = metadata
return out, nil
}
type CountPendingDecisionTasksInput struct {
// The name of the domain that contains the task list.
//
// This member is required.
Domain *string
// The name of the task list.
//
// This member is required.
TaskList *types.TaskList
noSmithyDocumentSerde
}
// Contains the count of tasks in a task list.
type CountPendingDecisionTasksOutput struct {
// The number of tasks in the task list.
//
// This member is required.
Count int32
// If set to true, indicates that the actual count was more than the maximum
// supported by this API and the count returned is the truncated value.
Truncated bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCountPendingDecisionTasksMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCountPendingDecisionTasks{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCountPendingDecisionTasks{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCountPendingDecisionTasksValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCountPendingDecisionTasks(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCountPendingDecisionTasks(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "CountPendingDecisionTasks",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deprecates the specified activity type. After an activity type has been
// deprecated, you cannot create new tasks of that activity type. Tasks of this
// type that were scheduled before the type was deprecated continue to run. This
// operation is eventually consistent. The results are best effort and may not
// exactly reflect recent updates and changes. Access Control You can use IAM
// policies to control this action's access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the following parameters by using a Condition element with the
// appropriate keys.
// - activityType.name : String constraint. The key is swf:activityType.name .
// - activityType.version : String constraint. The key is
// swf:activityType.version .
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) DeprecateActivityType(ctx context.Context, params *DeprecateActivityTypeInput, optFns ...func(*Options)) (*DeprecateActivityTypeOutput, error) {
if params == nil {
params = &DeprecateActivityTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeprecateActivityType", params, optFns, c.addOperationDeprecateActivityTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeprecateActivityTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeprecateActivityTypeInput struct {
// The activity type to deprecate.
//
// This member is required.
ActivityType *types.ActivityType
// The name of the domain in which the activity type is registered.
//
// This member is required.
Domain *string
noSmithyDocumentSerde
}
type DeprecateActivityTypeOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeprecateActivityTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeprecateActivityType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeprecateActivityType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeprecateActivityTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprecateActivityType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeprecateActivityType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "DeprecateActivityType",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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"
)
// Deprecates the specified domain. After a domain has been deprecated it cannot
// be used to create new workflow executions or register new types. However, you
// can still use visibility actions on this domain. Deprecating a domain also
// deprecates all activity and workflow types registered in the domain. Executions
// that were started before the domain was deprecated continues to run. This
// operation is eventually consistent. The results are best effort and may not
// exactly reflect recent updates and changes. Access Control You can use IAM
// policies to control this action's access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - You cannot use an IAM policy to constrain this action's parameters.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) DeprecateDomain(ctx context.Context, params *DeprecateDomainInput, optFns ...func(*Options)) (*DeprecateDomainOutput, error) {
if params == nil {
params = &DeprecateDomainInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeprecateDomain", params, optFns, c.addOperationDeprecateDomainMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeprecateDomainOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeprecateDomainInput struct {
// The name of the domain to deprecate.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type DeprecateDomainOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeprecateDomainMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeprecateDomain{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeprecateDomain{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeprecateDomainValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprecateDomain(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeprecateDomain(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "DeprecateDomain",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deprecates the specified workflow type. After a workflow type has been
// deprecated, you cannot create new executions of that type. Executions that were
// started before the type was deprecated continues to run. A deprecated workflow
// type may still be used when calling visibility actions. This operation is
// eventually consistent. The results are best effort and may not exactly reflect
// recent updates and changes. Access Control You can use IAM policies to control
// this action's access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the following parameters by using a Condition element with the
// appropriate keys.
// - workflowType.name : String constraint. The key is swf:workflowType.name .
// - workflowType.version : String constraint. The key is
// swf:workflowType.version .
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) DeprecateWorkflowType(ctx context.Context, params *DeprecateWorkflowTypeInput, optFns ...func(*Options)) (*DeprecateWorkflowTypeOutput, error) {
if params == nil {
params = &DeprecateWorkflowTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeprecateWorkflowType", params, optFns, c.addOperationDeprecateWorkflowTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeprecateWorkflowTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeprecateWorkflowTypeInput struct {
// The name of the domain in which the workflow type is registered.
//
// This member is required.
Domain *string
// The workflow type to deprecate.
//
// This member is required.
WorkflowType *types.WorkflowType
noSmithyDocumentSerde
}
type DeprecateWorkflowTypeOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeprecateWorkflowTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeprecateWorkflowType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeprecateWorkflowType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeprecateWorkflowTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprecateWorkflowType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeprecateWorkflowType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "DeprecateWorkflowType",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about the specified activity type. This includes
// configuration settings provided when the type was registered and other general
// information about the type. Access Control You can use IAM policies to control
// this action's access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the following parameters by using a Condition element with the
// appropriate keys.
// - activityType.name : String constraint. The key is swf:activityType.name .
// - activityType.version : String constraint. The key is
// swf:activityType.version .
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) DescribeActivityType(ctx context.Context, params *DescribeActivityTypeInput, optFns ...func(*Options)) (*DescribeActivityTypeOutput, error) {
if params == nil {
params = &DescribeActivityTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeActivityType", params, optFns, c.addOperationDescribeActivityTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeActivityTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeActivityTypeInput struct {
// The activity type to get information about. Activity types are identified by
// the name and version that were supplied when the activity was registered.
//
// This member is required.
ActivityType *types.ActivityType
// The name of the domain in which the activity type is registered.
//
// This member is required.
Domain *string
noSmithyDocumentSerde
}
// Detailed information about an activity type.
type DescribeActivityTypeOutput struct {
// The configuration settings registered with the activity type.
//
// This member is required.
Configuration *types.ActivityTypeConfiguration
// General information about the activity type. The status of activity type
// (returned in the ActivityTypeInfo structure) can be one of the following.
// - REGISTERED – The type is registered and available. Workers supporting this
// type should be running.
// - DEPRECATED – The type was deprecated using DeprecateActivityType , but is
// still in use. You should keep workers supporting this type running. You cannot
// create new tasks of this type.
//
// This member is required.
TypeInfo *types.ActivityTypeInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeActivityTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeActivityType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeActivityType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeActivityTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeActivityType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeActivityType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "DescribeActivityType",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about the specified domain, including description and
// status. Access Control You can use IAM policies to control this action's access
// to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - You cannot use an IAM policy to constrain this action's parameters.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) DescribeDomain(ctx context.Context, params *DescribeDomainInput, optFns ...func(*Options)) (*DescribeDomainOutput, error) {
if params == nil {
params = &DescribeDomainInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeDomain", params, optFns, c.addOperationDescribeDomainMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeDomainOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeDomainInput struct {
// The name of the domain to describe.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// Contains details of a domain.
type DescribeDomainOutput struct {
// The domain configuration. Currently, this includes only the domain's retention
// period.
//
// This member is required.
Configuration *types.DomainConfiguration
// The basic information about a domain, such as its name, status, and description.
//
// This member is required.
DomainInfo *types.DomainInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeDomainMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeDomain{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeDomain{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeDomainValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDomain(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeDomain(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "DescribeDomain",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns information about the specified workflow execution including its type
// and some statistics. This operation is eventually consistent. The results are
// best effort and may not exactly reflect recent updates and changes. Access
// Control You can use IAM policies to control this action's access to Amazon SWF
// resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - You cannot use an IAM policy to constrain this action's parameters.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) DescribeWorkflowExecution(ctx context.Context, params *DescribeWorkflowExecutionInput, optFns ...func(*Options)) (*DescribeWorkflowExecutionOutput, error) {
if params == nil {
params = &DescribeWorkflowExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeWorkflowExecution", params, optFns, c.addOperationDescribeWorkflowExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeWorkflowExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeWorkflowExecutionInput struct {
// The name of the domain containing the workflow execution.
//
// This member is required.
Domain *string
// The workflow execution to describe.
//
// This member is required.
Execution *types.WorkflowExecution
noSmithyDocumentSerde
}
// Contains details about a workflow execution.
type DescribeWorkflowExecutionOutput struct {
// The configuration settings for this workflow execution including timeout
// values, tasklist etc.
//
// This member is required.
ExecutionConfiguration *types.WorkflowExecutionConfiguration
// Information about the workflow execution.
//
// This member is required.
ExecutionInfo *types.WorkflowExecutionInfo
// The number of tasks for this workflow execution. This includes open and closed
// tasks of all types.
//
// This member is required.
OpenCounts *types.WorkflowExecutionOpenCounts
// The time when the last activity task was scheduled for this workflow execution.
// You can use this information to determine if the workflow has not made progress
// for an unusually long period of time and might require a corrective action.
LatestActivityTaskTimestamp *time.Time
// The latest executionContext provided by the decider for this workflow
// execution. A decider can provide an executionContext (a free-form string) when
// closing a decision task using RespondDecisionTaskCompleted .
LatestExecutionContext *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeWorkflowExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeWorkflowExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeWorkflowExecution{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeWorkflowExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorkflowExecution(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeWorkflowExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "DescribeWorkflowExecution",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about the specified workflow type. This includes
// configuration settings specified when the type was registered and other
// information such as creation date, current status, etc. Access Control You can
// use IAM policies to control this action's access to Amazon SWF resources as
// follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the following parameters by using a Condition element with the
// appropriate keys.
// - workflowType.name : String constraint. The key is swf:workflowType.name .
// - workflowType.version : String constraint. The key is
// swf:workflowType.version .
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) DescribeWorkflowType(ctx context.Context, params *DescribeWorkflowTypeInput, optFns ...func(*Options)) (*DescribeWorkflowTypeOutput, error) {
if params == nil {
params = &DescribeWorkflowTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeWorkflowType", params, optFns, c.addOperationDescribeWorkflowTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeWorkflowTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeWorkflowTypeInput struct {
// The name of the domain in which this workflow type is registered.
//
// This member is required.
Domain *string
// The workflow type to describe.
//
// This member is required.
WorkflowType *types.WorkflowType
noSmithyDocumentSerde
}
// Contains details about a workflow type.
type DescribeWorkflowTypeOutput struct {
// Configuration settings of the workflow type registered through
// RegisterWorkflowType
//
// This member is required.
Configuration *types.WorkflowTypeConfiguration
// General information about the workflow type. The status of the workflow type
// (returned in the WorkflowTypeInfo structure) can be one of the following.
// - REGISTERED – The type is registered and available. Workers supporting this
// type should be running.
// - DEPRECATED – The type was deprecated using DeprecateWorkflowType , but is
// still in use. You should keep workers supporting this type running. You cannot
// create new workflow executions of this type.
//
// This member is required.
TypeInfo *types.WorkflowTypeInfo
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeWorkflowTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeWorkflowType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeWorkflowType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeWorkflowTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorkflowType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeWorkflowType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "DescribeWorkflowType",
}
}
| 164 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the history of the specified workflow execution. The results may be
// split into multiple pages. To retrieve subsequent pages, make the call again
// using the nextPageToken returned by the initial call. This operation is
// eventually consistent. The results are best effort and may not exactly reflect
// recent updates and changes. Access Control You can use IAM policies to control
// this action's access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - You cannot use an IAM policy to constrain this action's parameters.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) GetWorkflowExecutionHistory(ctx context.Context, params *GetWorkflowExecutionHistoryInput, optFns ...func(*Options)) (*GetWorkflowExecutionHistoryOutput, error) {
if params == nil {
params = &GetWorkflowExecutionHistoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetWorkflowExecutionHistory", params, optFns, c.addOperationGetWorkflowExecutionHistoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetWorkflowExecutionHistoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetWorkflowExecutionHistoryInput struct {
// The name of the domain containing the workflow execution.
//
// This member is required.
Domain *string
// Specifies the workflow execution for which to return the history.
//
// This member is required.
Execution *types.WorkflowExecution
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
MaximumPageSize int32
// If NextPageToken is returned there are more results available. The value of
// NextPageToken is a unique pagination token for each page. Make the call again
// using the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return a 400 error: " Specified token has exceeded its
// maximum lifetime ". The configured maximumPageSize determines how many results
// can be returned in a single call.
NextPageToken *string
// When set to true , returns the events in reverse order. By default the results
// are returned in ascending order of the eventTimeStamp of the events.
ReverseOrder bool
noSmithyDocumentSerde
}
// Paginated representation of a workflow history for a workflow execution. This
// is the up to date, complete and authoritative record of the events related to
// all tasks and events in the life of the workflow execution.
type GetWorkflowExecutionHistoryOutput struct {
// The list of history events.
//
// This member is required.
Events []types.HistoryEvent
// If a NextPageToken was returned by a previous call, there are more results
// available. To retrieve the next page of results, make the call again using the
// returned token in nextPageToken . Keep all other arguments unchanged. The
// configured maximumPageSize determines how many results can be returned in a
// single call.
NextPageToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetWorkflowExecutionHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetWorkflowExecutionHistory{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetWorkflowExecutionHistory{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetWorkflowExecutionHistoryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWorkflowExecutionHistory(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// GetWorkflowExecutionHistoryAPIClient is a client that implements the
// GetWorkflowExecutionHistory operation.
type GetWorkflowExecutionHistoryAPIClient interface {
GetWorkflowExecutionHistory(context.Context, *GetWorkflowExecutionHistoryInput, ...func(*Options)) (*GetWorkflowExecutionHistoryOutput, error)
}
var _ GetWorkflowExecutionHistoryAPIClient = (*Client)(nil)
// GetWorkflowExecutionHistoryPaginatorOptions is the paginator options for
// GetWorkflowExecutionHistory
type GetWorkflowExecutionHistoryPaginatorOptions struct {
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// GetWorkflowExecutionHistoryPaginator is a paginator for
// GetWorkflowExecutionHistory
type GetWorkflowExecutionHistoryPaginator struct {
options GetWorkflowExecutionHistoryPaginatorOptions
client GetWorkflowExecutionHistoryAPIClient
params *GetWorkflowExecutionHistoryInput
nextToken *string
firstPage bool
}
// NewGetWorkflowExecutionHistoryPaginator returns a new
// GetWorkflowExecutionHistoryPaginator
func NewGetWorkflowExecutionHistoryPaginator(client GetWorkflowExecutionHistoryAPIClient, params *GetWorkflowExecutionHistoryInput, optFns ...func(*GetWorkflowExecutionHistoryPaginatorOptions)) *GetWorkflowExecutionHistoryPaginator {
if params == nil {
params = &GetWorkflowExecutionHistoryInput{}
}
options := GetWorkflowExecutionHistoryPaginatorOptions{}
if params.MaximumPageSize != 0 {
options.Limit = params.MaximumPageSize
}
for _, fn := range optFns {
fn(&options)
}
return &GetWorkflowExecutionHistoryPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextPageToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetWorkflowExecutionHistoryPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetWorkflowExecutionHistory page.
func (p *GetWorkflowExecutionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetWorkflowExecutionHistoryOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextPageToken = p.nextToken
params.MaximumPageSize = p.options.Limit
result, err := p.client.GetWorkflowExecutionHistory(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextPageToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetWorkflowExecutionHistory(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "GetWorkflowExecutionHistory",
}
}
| 266 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about all activities registered in the specified domain
// that match the specified name and registration status. The result includes
// information like creation date, current status of the activity, etc. The results
// may be split into multiple pages. To retrieve subsequent pages, make the call
// again using the nextPageToken returned by the initial call. Access Control You
// can use IAM policies to control this action's access to Amazon SWF resources as
// follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - You cannot use an IAM policy to constrain this action's parameters.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) ListActivityTypes(ctx context.Context, params *ListActivityTypesInput, optFns ...func(*Options)) (*ListActivityTypesOutput, error) {
if params == nil {
params = &ListActivityTypesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListActivityTypes", params, optFns, c.addOperationListActivityTypesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListActivityTypesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListActivityTypesInput struct {
// The name of the domain in which the activity types have been registered.
//
// This member is required.
Domain *string
// Specifies the registration status of the activity types to list.
//
// This member is required.
RegistrationStatus types.RegistrationStatus
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
MaximumPageSize int32
// If specified, only lists the activity types that have this name.
Name *string
// If NextPageToken is returned there are more results available. The value of
// NextPageToken is a unique pagination token for each page. Make the call again
// using the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return a 400 error: " Specified token has exceeded its
// maximum lifetime ". The configured maximumPageSize determines how many results
// can be returned in a single call.
NextPageToken *string
// When set to true , returns the results in reverse order. By default, the results
// are returned in ascending alphabetical order by name of the activity types.
ReverseOrder bool
noSmithyDocumentSerde
}
// Contains a paginated list of activity type information structures.
type ListActivityTypesOutput struct {
// List of activity type information.
//
// This member is required.
TypeInfos []types.ActivityTypeInfo
// If a NextPageToken was returned by a previous call, there are more results
// available. To retrieve the next page of results, make the call again using the
// returned token in nextPageToken . Keep all other arguments unchanged. The
// configured maximumPageSize determines how many results can be returned in a
// single call.
NextPageToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListActivityTypesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListActivityTypes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListActivityTypes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListActivityTypesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListActivityTypes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListActivityTypesAPIClient is a client that implements the ListActivityTypes
// operation.
type ListActivityTypesAPIClient interface {
ListActivityTypes(context.Context, *ListActivityTypesInput, ...func(*Options)) (*ListActivityTypesOutput, error)
}
var _ ListActivityTypesAPIClient = (*Client)(nil)
// ListActivityTypesPaginatorOptions is the paginator options for ListActivityTypes
type ListActivityTypesPaginatorOptions struct {
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListActivityTypesPaginator is a paginator for ListActivityTypes
type ListActivityTypesPaginator struct {
options ListActivityTypesPaginatorOptions
client ListActivityTypesAPIClient
params *ListActivityTypesInput
nextToken *string
firstPage bool
}
// NewListActivityTypesPaginator returns a new ListActivityTypesPaginator
func NewListActivityTypesPaginator(client ListActivityTypesAPIClient, params *ListActivityTypesInput, optFns ...func(*ListActivityTypesPaginatorOptions)) *ListActivityTypesPaginator {
if params == nil {
params = &ListActivityTypesInput{}
}
options := ListActivityTypesPaginatorOptions{}
if params.MaximumPageSize != 0 {
options.Limit = params.MaximumPageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListActivityTypesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextPageToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListActivityTypesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListActivityTypes page.
func (p *ListActivityTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActivityTypesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextPageToken = p.nextToken
params.MaximumPageSize = p.options.Limit
result, err := p.client.ListActivityTypes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextPageToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListActivityTypes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "ListActivityTypes",
}
}
| 265 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of closed workflow executions in the specified domain that meet
// the filtering criteria. The results may be split into multiple pages. To
// retrieve subsequent pages, make the call again using the nextPageToken returned
// by the initial call. This operation is eventually consistent. The results are
// best effort and may not exactly reflect recent updates and changes. Access
// Control You can use IAM policies to control this action's access to Amazon SWF
// resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the following parameters by using a Condition element with the
// appropriate keys.
// - tagFilter.tag : String constraint. The key is swf:tagFilter.tag .
// - typeFilter.name : String constraint. The key is swf:typeFilter.name .
// - typeFilter.version : String constraint. The key is swf:typeFilter.version .
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) ListClosedWorkflowExecutions(ctx context.Context, params *ListClosedWorkflowExecutionsInput, optFns ...func(*Options)) (*ListClosedWorkflowExecutionsOutput, error) {
if params == nil {
params = &ListClosedWorkflowExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListClosedWorkflowExecutions", params, optFns, c.addOperationListClosedWorkflowExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListClosedWorkflowExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListClosedWorkflowExecutionsInput struct {
// The name of the domain that contains the workflow executions to list.
//
// This member is required.
Domain *string
// If specified, only workflow executions that match this close status are listed.
// For example, if TERMINATED is specified, then only TERMINATED workflow
// executions are listed. closeStatusFilter , executionFilter , typeFilter and
// tagFilter are mutually exclusive. You can specify at most one of these in a
// request.
CloseStatusFilter *types.CloseStatusFilter
// If specified, the workflow executions are included in the returned results
// based on whether their close times are within the range specified by this
// filter. Also, if this parameter is specified, the returned results are ordered
// by their close times. startTimeFilter and closeTimeFilter are mutually
// exclusive. You must specify one of these in a request but not both.
CloseTimeFilter *types.ExecutionTimeFilter
// If specified, only workflow executions matching the workflow ID specified in
// the filter are returned. closeStatusFilter , executionFilter , typeFilter and
// tagFilter are mutually exclusive. You can specify at most one of these in a
// request.
ExecutionFilter *types.WorkflowExecutionFilter
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
MaximumPageSize int32
// If NextPageToken is returned there are more results available. The value of
// NextPageToken is a unique pagination token for each page. Make the call again
// using the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return a 400 error: " Specified token has exceeded its
// maximum lifetime ". The configured maximumPageSize determines how many results
// can be returned in a single call.
NextPageToken *string
// When set to true , returns the results in reverse order. By default the results
// are returned in descending order of the start or the close time of the
// executions.
ReverseOrder bool
// If specified, the workflow executions are included in the returned results
// based on whether their start times are within the range specified by this
// filter. Also, if this parameter is specified, the returned results are ordered
// by their start times. startTimeFilter and closeTimeFilter are mutually
// exclusive. You must specify one of these in a request but not both.
StartTimeFilter *types.ExecutionTimeFilter
// If specified, only executions that have the matching tag are listed.
// closeStatusFilter , executionFilter , typeFilter and tagFilter are mutually
// exclusive. You can specify at most one of these in a request.
TagFilter *types.TagFilter
// If specified, only executions of the type specified in the filter are returned.
// closeStatusFilter , executionFilter , typeFilter and tagFilter are mutually
// exclusive. You can specify at most one of these in a request.
TypeFilter *types.WorkflowTypeFilter
noSmithyDocumentSerde
}
// Contains a paginated list of information about workflow executions.
type ListClosedWorkflowExecutionsOutput struct {
// The list of workflow information structures.
//
// This member is required.
ExecutionInfos []types.WorkflowExecutionInfo
// If a NextPageToken was returned by a previous call, there are more results
// available. To retrieve the next page of results, make the call again using the
// returned token in nextPageToken . Keep all other arguments unchanged. The
// configured maximumPageSize determines how many results can be returned in a
// single call.
NextPageToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListClosedWorkflowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListClosedWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListClosedWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListClosedWorkflowExecutionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListClosedWorkflowExecutions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListClosedWorkflowExecutionsAPIClient is a client that implements the
// ListClosedWorkflowExecutions operation.
type ListClosedWorkflowExecutionsAPIClient interface {
ListClosedWorkflowExecutions(context.Context, *ListClosedWorkflowExecutionsInput, ...func(*Options)) (*ListClosedWorkflowExecutionsOutput, error)
}
var _ ListClosedWorkflowExecutionsAPIClient = (*Client)(nil)
// ListClosedWorkflowExecutionsPaginatorOptions is the paginator options for
// ListClosedWorkflowExecutions
type ListClosedWorkflowExecutionsPaginatorOptions struct {
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListClosedWorkflowExecutionsPaginator is a paginator for
// ListClosedWorkflowExecutions
type ListClosedWorkflowExecutionsPaginator struct {
options ListClosedWorkflowExecutionsPaginatorOptions
client ListClosedWorkflowExecutionsAPIClient
params *ListClosedWorkflowExecutionsInput
nextToken *string
firstPage bool
}
// NewListClosedWorkflowExecutionsPaginator returns a new
// ListClosedWorkflowExecutionsPaginator
func NewListClosedWorkflowExecutionsPaginator(client ListClosedWorkflowExecutionsAPIClient, params *ListClosedWorkflowExecutionsInput, optFns ...func(*ListClosedWorkflowExecutionsPaginatorOptions)) *ListClosedWorkflowExecutionsPaginator {
if params == nil {
params = &ListClosedWorkflowExecutionsInput{}
}
options := ListClosedWorkflowExecutionsPaginatorOptions{}
if params.MaximumPageSize != 0 {
options.Limit = params.MaximumPageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListClosedWorkflowExecutionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextPageToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListClosedWorkflowExecutionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListClosedWorkflowExecutions page.
func (p *ListClosedWorkflowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClosedWorkflowExecutionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextPageToken = p.nextToken
params.MaximumPageSize = p.options.Limit
result, err := p.client.ListClosedWorkflowExecutions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextPageToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListClosedWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "ListClosedWorkflowExecutions",
}
}
| 302 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the list of domains registered in the account. The results may be split
// into multiple pages. To retrieve subsequent pages, make the call again using the
// nextPageToken returned by the initial call. This operation is eventually
// consistent. The results are best effort and may not exactly reflect recent
// updates and changes. Access Control You can use IAM policies to control this
// action's access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains. The element must be set to arn:aws:swf::AccountID:domain/*
// , where AccountID is the account ID, with no dashes.
// - Use an Action element to allow or deny permission to call this action.
// - You cannot use an IAM policy to constrain this action's parameters.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) ListDomains(ctx context.Context, params *ListDomainsInput, optFns ...func(*Options)) (*ListDomainsOutput, error) {
if params == nil {
params = &ListDomainsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDomains", params, optFns, c.addOperationListDomainsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDomainsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListDomainsInput struct {
// Specifies the registration status of the domains to list.
//
// This member is required.
RegistrationStatus types.RegistrationStatus
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
MaximumPageSize int32
// If NextPageToken is returned there are more results available. The value of
// NextPageToken is a unique pagination token for each page. Make the call again
// using the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return a 400 error: " Specified token has exceeded its
// maximum lifetime ". The configured maximumPageSize determines how many results
// can be returned in a single call.
NextPageToken *string
// When set to true , returns the results in reverse order. By default, the results
// are returned in ascending alphabetical order by name of the domains.
ReverseOrder bool
noSmithyDocumentSerde
}
// Contains a paginated collection of DomainInfo structures.
type ListDomainsOutput struct {
// A list of DomainInfo structures.
//
// This member is required.
DomainInfos []types.DomainInfo
// If a NextPageToken was returned by a previous call, there are more results
// available. To retrieve the next page of results, make the call again using the
// returned token in nextPageToken . Keep all other arguments unchanged. The
// configured maximumPageSize determines how many results can be returned in a
// single call.
NextPageToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListDomains{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListDomains{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListDomainsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDomains(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListDomainsAPIClient is a client that implements the ListDomains operation.
type ListDomainsAPIClient interface {
ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error)
}
var _ ListDomainsAPIClient = (*Client)(nil)
// ListDomainsPaginatorOptions is the paginator options for ListDomains
type ListDomainsPaginatorOptions struct {
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListDomainsPaginator is a paginator for ListDomains
type ListDomainsPaginator struct {
options ListDomainsPaginatorOptions
client ListDomainsAPIClient
params *ListDomainsInput
nextToken *string
firstPage bool
}
// NewListDomainsPaginator returns a new ListDomainsPaginator
func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator {
if params == nil {
params = &ListDomainsInput{}
}
options := ListDomainsPaginatorOptions{}
if params.MaximumPageSize != 0 {
options.Limit = params.MaximumPageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListDomainsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextPageToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListDomainsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListDomains page.
func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextPageToken = p.nextToken
params.MaximumPageSize = p.options.Limit
result, err := p.client.ListDomains(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextPageToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "ListDomains",
}
}
| 256 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of open workflow executions in the specified domain that meet
// the filtering criteria. The results may be split into multiple pages. To
// retrieve subsequent pages, make the call again using the nextPageToken returned
// by the initial call. This operation is eventually consistent. The results are
// best effort and may not exactly reflect recent updates and changes. Access
// Control You can use IAM policies to control this action's access to Amazon SWF
// resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the following parameters by using a Condition element with the
// appropriate keys.
// - tagFilter.tag : String constraint. The key is swf:tagFilter.tag .
// - typeFilter.name : String constraint. The key is swf:typeFilter.name .
// - typeFilter.version : String constraint. The key is swf:typeFilter.version .
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) ListOpenWorkflowExecutions(ctx context.Context, params *ListOpenWorkflowExecutionsInput, optFns ...func(*Options)) (*ListOpenWorkflowExecutionsOutput, error) {
if params == nil {
params = &ListOpenWorkflowExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListOpenWorkflowExecutions", params, optFns, c.addOperationListOpenWorkflowExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListOpenWorkflowExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListOpenWorkflowExecutionsInput struct {
// The name of the domain that contains the workflow executions to list.
//
// This member is required.
Domain *string
// Workflow executions are included in the returned results based on whether their
// start times are within the range specified by this filter.
//
// This member is required.
StartTimeFilter *types.ExecutionTimeFilter
// If specified, only workflow executions matching the workflow ID specified in
// the filter are returned. executionFilter , typeFilter and tagFilter are
// mutually exclusive. You can specify at most one of these in a request.
ExecutionFilter *types.WorkflowExecutionFilter
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
MaximumPageSize int32
// If NextPageToken is returned there are more results available. The value of
// NextPageToken is a unique pagination token for each page. Make the call again
// using the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return a 400 error: " Specified token has exceeded its
// maximum lifetime ". The configured maximumPageSize determines how many results
// can be returned in a single call.
NextPageToken *string
// When set to true , returns the results in reverse order. By default the results
// are returned in descending order of the start time of the executions.
ReverseOrder bool
// If specified, only executions that have the matching tag are listed.
// executionFilter , typeFilter and tagFilter are mutually exclusive. You can
// specify at most one of these in a request.
TagFilter *types.TagFilter
// If specified, only executions of the type specified in the filter are returned.
// executionFilter , typeFilter and tagFilter are mutually exclusive. You can
// specify at most one of these in a request.
TypeFilter *types.WorkflowTypeFilter
noSmithyDocumentSerde
}
// Contains a paginated list of information about workflow executions.
type ListOpenWorkflowExecutionsOutput struct {
// The list of workflow information structures.
//
// This member is required.
ExecutionInfos []types.WorkflowExecutionInfo
// If a NextPageToken was returned by a previous call, there are more results
// available. To retrieve the next page of results, make the call again using the
// returned token in nextPageToken . Keep all other arguments unchanged. The
// configured maximumPageSize determines how many results can be returned in a
// single call.
NextPageToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListOpenWorkflowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListOpenWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListOpenWorkflowExecutions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListOpenWorkflowExecutionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOpenWorkflowExecutions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListOpenWorkflowExecutionsAPIClient is a client that implements the
// ListOpenWorkflowExecutions operation.
type ListOpenWorkflowExecutionsAPIClient interface {
ListOpenWorkflowExecutions(context.Context, *ListOpenWorkflowExecutionsInput, ...func(*Options)) (*ListOpenWorkflowExecutionsOutput, error)
}
var _ ListOpenWorkflowExecutionsAPIClient = (*Client)(nil)
// ListOpenWorkflowExecutionsPaginatorOptions is the paginator options for
// ListOpenWorkflowExecutions
type ListOpenWorkflowExecutionsPaginatorOptions struct {
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListOpenWorkflowExecutionsPaginator is a paginator for
// ListOpenWorkflowExecutions
type ListOpenWorkflowExecutionsPaginator struct {
options ListOpenWorkflowExecutionsPaginatorOptions
client ListOpenWorkflowExecutionsAPIClient
params *ListOpenWorkflowExecutionsInput
nextToken *string
firstPage bool
}
// NewListOpenWorkflowExecutionsPaginator returns a new
// ListOpenWorkflowExecutionsPaginator
func NewListOpenWorkflowExecutionsPaginator(client ListOpenWorkflowExecutionsAPIClient, params *ListOpenWorkflowExecutionsInput, optFns ...func(*ListOpenWorkflowExecutionsPaginatorOptions)) *ListOpenWorkflowExecutionsPaginator {
if params == nil {
params = &ListOpenWorkflowExecutionsInput{}
}
options := ListOpenWorkflowExecutionsPaginatorOptions{}
if params.MaximumPageSize != 0 {
options.Limit = params.MaximumPageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListOpenWorkflowExecutionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextPageToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListOpenWorkflowExecutionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListOpenWorkflowExecutions page.
func (p *ListOpenWorkflowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpenWorkflowExecutionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextPageToken = p.nextToken
params.MaximumPageSize = p.options.Limit
result, err := p.client.ListOpenWorkflowExecutions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextPageToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListOpenWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "ListOpenWorkflowExecutions",
}
}
| 285 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// List tags for a given domain.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) for the Amazon SWF domain.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// An array of tags associated with the domain.
Tags []types.ResourceTag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "ListTagsForResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about workflow types in the specified domain. The results
// may be split into multiple pages that can be retrieved by making the call
// repeatedly. Access Control You can use IAM policies to control this action's
// access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - You cannot use an IAM policy to constrain this action's parameters.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) ListWorkflowTypes(ctx context.Context, params *ListWorkflowTypesInput, optFns ...func(*Options)) (*ListWorkflowTypesOutput, error) {
if params == nil {
params = &ListWorkflowTypesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListWorkflowTypes", params, optFns, c.addOperationListWorkflowTypesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListWorkflowTypesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListWorkflowTypesInput struct {
// The name of the domain in which the workflow types have been registered.
//
// This member is required.
Domain *string
// Specifies the registration status of the workflow types to list.
//
// This member is required.
RegistrationStatus types.RegistrationStatus
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
MaximumPageSize int32
// If specified, lists the workflow type with this name.
Name *string
// If NextPageToken is returned there are more results available. The value of
// NextPageToken is a unique pagination token for each page. Make the call again
// using the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return a 400 error: " Specified token has exceeded its
// maximum lifetime ". The configured maximumPageSize determines how many results
// can be returned in a single call.
NextPageToken *string
// When set to true , returns the results in reverse order. By default the results
// are returned in ascending alphabetical order of the name of the workflow types.
ReverseOrder bool
noSmithyDocumentSerde
}
// Contains a paginated list of information structures about workflow types.
type ListWorkflowTypesOutput struct {
// The list of workflow type information.
//
// This member is required.
TypeInfos []types.WorkflowTypeInfo
// If a NextPageToken was returned by a previous call, there are more results
// available. To retrieve the next page of results, make the call again using the
// returned token in nextPageToken . Keep all other arguments unchanged. The
// configured maximumPageSize determines how many results can be returned in a
// single call.
NextPageToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListWorkflowTypesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListWorkflowTypes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListWorkflowTypes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListWorkflowTypesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkflowTypes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListWorkflowTypesAPIClient is a client that implements the ListWorkflowTypes
// operation.
type ListWorkflowTypesAPIClient interface {
ListWorkflowTypes(context.Context, *ListWorkflowTypesInput, ...func(*Options)) (*ListWorkflowTypesOutput, error)
}
var _ ListWorkflowTypesAPIClient = (*Client)(nil)
// ListWorkflowTypesPaginatorOptions is the paginator options for ListWorkflowTypes
type ListWorkflowTypesPaginatorOptions struct {
// The maximum number of results that are returned per call. Use nextPageToken to
// obtain further pages of results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListWorkflowTypesPaginator is a paginator for ListWorkflowTypes
type ListWorkflowTypesPaginator struct {
options ListWorkflowTypesPaginatorOptions
client ListWorkflowTypesAPIClient
params *ListWorkflowTypesInput
nextToken *string
firstPage bool
}
// NewListWorkflowTypesPaginator returns a new ListWorkflowTypesPaginator
func NewListWorkflowTypesPaginator(client ListWorkflowTypesAPIClient, params *ListWorkflowTypesInput, optFns ...func(*ListWorkflowTypesPaginatorOptions)) *ListWorkflowTypesPaginator {
if params == nil {
params = &ListWorkflowTypesInput{}
}
options := ListWorkflowTypesPaginatorOptions{}
if params.MaximumPageSize != 0 {
options.Limit = params.MaximumPageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListWorkflowTypesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextPageToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListWorkflowTypesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListWorkflowTypes page.
func (p *ListWorkflowTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowTypesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextPageToken = p.nextToken
params.MaximumPageSize = p.options.Limit
result, err := p.client.ListWorkflowTypes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextPageToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListWorkflowTypes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "ListWorkflowTypes",
}
}
| 262 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package swf
import (
"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/swf/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Used by workers to get an ActivityTask from the specified activity taskList .
// This initiates a long poll, where the service holds the HTTP connection open and
// responds as soon as a task becomes available. The maximum time the service holds
// on to the request before responding is 60 seconds. If no task is available
// within 60 seconds, the poll returns an empty result. An empty result, in this
// context, means that an ActivityTask is returned, but that the value of taskToken
// is an empty string. If a task is returned, the worker should use its type to
// identify and process it correctly. Workers should set their client side socket
// timeout to at least 70 seconds (10 seconds higher than the maximum time service
// may hold the poll request). Access Control You can use IAM policies to control
// this action's access to Amazon SWF resources as follows:
// - Use a Resource element with the domain name to limit the action to only
// specified domains.
// - Use an Action element to allow or deny permission to call this action.
// - Constrain the taskList.name parameter by using a Condition element with the
// swf:taskList.name key to allow the action to access only certain task lists.
//
// If the caller doesn't have sufficient permissions to invoke the action, or the
// parameter values fall outside the specified constraints, the action fails. The
// associated event attribute's cause parameter is set to OPERATION_NOT_PERMITTED .
// For details and example IAM policies, see Using IAM to Manage Access to Amazon
// SWF Workflows (https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html)
// in the Amazon SWF Developer Guide.
func (c *Client) PollForActivityTask(ctx context.Context, params *PollForActivityTaskInput, optFns ...func(*Options)) (*PollForActivityTaskOutput, error) {
if params == nil {
params = &PollForActivityTaskInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PollForActivityTask", params, optFns, c.addOperationPollForActivityTaskMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PollForActivityTaskOutput)
out.ResultMetadata = metadata
return out, nil
}
type PollForActivityTaskInput struct {
// The name of the domain that contains the task lists being polled.
//
// This member is required.
Domain *string
// Specifies the task list to poll for activity tasks. The specified string must
// not start or end with whitespace. It must not contain a : (colon), / (slash), |
// (vertical bar), or any control characters ( \u0000-\u001f | \u007f-\u009f ).
// Also, it must not be the literal string arn .
//
// This member is required.
TaskList *types.TaskList
// Identity of the worker making the request, recorded in the ActivityTaskStarted
// event in the workflow history. This enables diagnostic tracing when problems
// arise. The form of this identity is user defined.
Identity *string
noSmithyDocumentSerde
}
// Unit of work sent to an activity worker.
type PollForActivityTaskOutput struct {
// The unique ID of the task.
//
// This member is required.
ActivityId *string
// The type of this activity task.
//
// This member is required.
ActivityType *types.ActivityType
// The ID of the ActivityTaskStarted event recorded in the history.
//
// This member is required.
StartedEventId int64
// The opaque string used as a handle on the task. This token is used by workers
// to communicate progress and response information back to the system about the
// task.
//
// This member is required.
TaskToken *string
// The workflow execution that started this activity task.
//
// This member is required.
WorkflowExecution *types.WorkflowExecution
// The inputs provided when the activity task was scheduled. The form of the input
// is user defined and should be meaningful to the activity implementation.
Input *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPollForActivityTaskMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpPollForActivityTask{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPollForActivityTask{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPollForActivityTaskValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPollForActivityTask(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPollForActivityTask(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "swf",
OperationName: "PollForActivityTask",
}
}
| 189 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.