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 lightsail
import (
"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/lightsail/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified attribute for a load balancer. You can only update one
// attribute at a time. The update load balancer attribute operation supports
// tag-based access control via resource tags applied to the resource identified by
// load balancer name . For more information, see the Amazon Lightsail Developer
// Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-controlling-access-using-tags)
// .
func (c *Client) UpdateLoadBalancerAttribute(ctx context.Context, params *UpdateLoadBalancerAttributeInput, optFns ...func(*Options)) (*UpdateLoadBalancerAttributeOutput, error) {
if params == nil {
params = &UpdateLoadBalancerAttributeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateLoadBalancerAttribute", params, optFns, c.addOperationUpdateLoadBalancerAttributeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateLoadBalancerAttributeOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateLoadBalancerAttributeInput struct {
// The name of the attribute you want to update.
//
// This member is required.
AttributeName types.LoadBalancerAttributeName
// The value that you want to specify for the attribute name. The following values
// are supported depending on what you specify for the attributeName request
// parameter:
// - If you specify HealthCheckPath for the attributeName request parameter, then
// the attributeValue request parameter must be the path to ping on the target
// (for example, /weather/us/wa/seattle ).
// - If you specify SessionStickinessEnabled for the attributeName request
// parameter, then the attributeValue request parameter must be true to activate
// session stickiness or false to deactivate session stickiness.
// - If you specify SessionStickiness_LB_CookieDurationSeconds for the
// attributeName request parameter, then the attributeValue request parameter
// must be an interger that represents the cookie duration in seconds.
// - If you specify HttpsRedirectionEnabled for the attributeName request
// parameter, then the attributeValue request parameter must be true to activate
// HTTP to HTTPS redirection or false to deactivate HTTP to HTTPS redirection.
// - If you specify TlsPolicyName for the attributeName request parameter, then
// the attributeValue request parameter must be the name of the TLS policy. Use
// the GetLoadBalancerTlsPolicies (https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetLoadBalancerTlsPolicies.html)
// action to get a list of TLS policy names that you can specify.
//
// This member is required.
AttributeValue *string
// The name of the load balancer that you want to modify (e.g., my-load-balancer .
//
// This member is required.
LoadBalancerName *string
noSmithyDocumentSerde
}
type UpdateLoadBalancerAttributeOutput struct {
// An array of objects that describe the result of the action, such as the status
// of the request, the timestamp of the request, and the resources affected by the
// request.
Operations []types.Operation
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateLoadBalancerAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateLoadBalancerAttribute{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateLoadBalancerAttribute{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateLoadBalancerAttributeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLoadBalancerAttribute(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateLoadBalancerAttribute(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lightsail",
OperationName: "UpdateLoadBalancerAttribute",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lightsail
import (
"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/lightsail/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Allows the update of one or more attributes of a database in Amazon Lightsail.
// Updates are applied immediately, or in cases where the updates could result in
// an outage, are applied during the database's predefined maintenance window. The
// update relational database operation supports tag-based access control via
// resource tags applied to the resource identified by relationalDatabaseName. For
// more information, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-controlling-access-using-tags)
// .
func (c *Client) UpdateRelationalDatabase(ctx context.Context, params *UpdateRelationalDatabaseInput, optFns ...func(*Options)) (*UpdateRelationalDatabaseOutput, error) {
if params == nil {
params = &UpdateRelationalDatabaseInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateRelationalDatabase", params, optFns, c.addOperationUpdateRelationalDatabaseMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateRelationalDatabaseOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateRelationalDatabaseInput struct {
// The name of your Lightsail database resource to update.
//
// This member is required.
RelationalDatabaseName *string
// When true , applies changes immediately. When false , applies changes during the
// preferred maintenance window. Some changes may cause an outage. Default: false
ApplyImmediately *bool
// Indicates the certificate that needs to be associated with the database.
CaCertificateIdentifier *string
// When true , disables automated backup retention for your database. Disabling
// backup retention deletes all automated database backups. Before disabling this,
// you may want to create a snapshot of your database using the create relational
// database snapshot operation. Updates are applied during the next maintenance
// window because this can result in an outage.
DisableBackupRetention *bool
// When true , enables automated backup retention for your database. Updates are
// applied during the next maintenance window because this can result in an outage.
EnableBackupRetention *bool
// The password for the master user. The password can include any printable ASCII
// character except "/", """, or "@". MySQL Constraints: Must contain from 8 to 41
// characters. PostgreSQL Constraints: Must contain from 8 to 128 characters.
MasterUserPassword *string
// The daily time range during which automated backups are created for your
// database if automated backups are enabled. Constraints:
// - Must be in the hh24:mi-hh24:mi format. Example: 16:00-16:30
// - Specified in Coordinated Universal Time (UTC).
// - Must not conflict with the preferred maintenance window.
// - Must be at least 30 minutes.
PreferredBackupWindow *string
// The weekly time range during which system maintenance can occur on your
// database. The default is a 30-minute window selected at random from an 8-hour
// block of time for each Amazon Web Services Region, occurring on a random day of
// the week. Constraints:
// - Must be in the ddd:hh24:mi-ddd:hh24:mi format.
// - Valid days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
// - Must be at least 30 minutes.
// - Specified in Coordinated Universal Time (UTC).
// - Example: Tue:17:00-Tue:17:30
PreferredMaintenanceWindow *string
// Specifies the accessibility options for your database. A value of true
// specifies a database that is available to resources outside of your Lightsail
// account. A value of false specifies a database that is available only to your
// Lightsail resources in the same region as your database.
PubliclyAccessible *bool
// When true , the master user password is changed to a new strong password
// generated by Lightsail. Use the get relational database master user password
// operation to get the new password.
RotateMasterUserPassword *bool
noSmithyDocumentSerde
}
type UpdateRelationalDatabaseOutput struct {
// An array of objects that describe the result of the action, such as the status
// of the request, the timestamp of the request, and the resources affected by the
// request.
Operations []types.Operation
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateRelationalDatabaseMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateRelationalDatabase{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateRelationalDatabase{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateRelationalDatabaseValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRelationalDatabase(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateRelationalDatabase(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lightsail",
OperationName: "UpdateRelationalDatabase",
}
}
| 186 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lightsail
import (
"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/lightsail/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Allows the update of one or more parameters of a database in Amazon Lightsail.
// Parameter updates don't cause outages; therefore, their application is not
// subject to the preferred maintenance window. However, there are two ways in
// which parameter updates are applied: dynamic or pending-reboot . Parameters
// marked with a dynamic apply type are applied immediately. Parameters marked
// with a pending-reboot apply type are applied only after the database is
// rebooted using the reboot relational database operation. The update relational
// database parameters operation supports tag-based access control via resource
// tags applied to the resource identified by relationalDatabaseName. For more
// information, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-controlling-access-using-tags)
// .
func (c *Client) UpdateRelationalDatabaseParameters(ctx context.Context, params *UpdateRelationalDatabaseParametersInput, optFns ...func(*Options)) (*UpdateRelationalDatabaseParametersOutput, error) {
if params == nil {
params = &UpdateRelationalDatabaseParametersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateRelationalDatabaseParameters", params, optFns, c.addOperationUpdateRelationalDatabaseParametersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateRelationalDatabaseParametersOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateRelationalDatabaseParametersInput struct {
// The database parameters to update.
//
// This member is required.
Parameters []types.RelationalDatabaseParameter
// The name of your database for which to update parameters.
//
// This member is required.
RelationalDatabaseName *string
noSmithyDocumentSerde
}
type UpdateRelationalDatabaseParametersOutput struct {
// An array of objects that describe the result of the action, such as the status
// of the request, the timestamp of the request, and the resources affected by the
// request.
Operations []types.Operation
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateRelationalDatabaseParametersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateRelationalDatabaseParameters{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateRelationalDatabaseParameters{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateRelationalDatabaseParametersValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRelationalDatabaseParameters(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateRelationalDatabaseParameters(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lightsail",
OperationName: "UpdateRelationalDatabaseParameters",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package lightsail provides the API client, operations, and parameter types for
// Amazon Lightsail.
//
// Amazon Lightsail is the easiest way to get started with Amazon Web Services
// (Amazon Web Services) for developers who need to build websites or web
// applications. It includes everything you need to launch your project quickly -
// instances (virtual private servers), container services, storage buckets,
// managed databases, SSD-based block storage, static IP addresses, load balancers,
// content delivery network (CDN) distributions, DNS management of registered
// domains, and resource snapshots (backups) - for a low, predictable monthly
// price. You can manage your Lightsail resources using the Lightsail console,
// Lightsail API, Command Line Interface (CLI), or SDKs. For more information about
// Lightsail concepts and tasks, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-set-up-access-keys-to-use-sdk-api-cli)
// . This API Reference provides detailed information about the actions, data
// types, parameters, and errors of the Lightsail service. For more information
// about the supported Amazon Web Services Regions, endpoints, and service quotas
// of the Lightsail service, see Amazon Lightsail Endpoints and Quotas (https://docs.aws.amazon.com/general/latest/gr/lightsail.html)
// in the Amazon Web Services General Reference.
package lightsail
| 22 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lightsail
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/lightsail/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 = "lightsail"
}
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 lightsail
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.27.1"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lightsail
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lightsail
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lightsail/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"math"
"path"
)
type awsAwsjson11_serializeOpAllocateStaticIp struct {
}
func (*awsAwsjson11_serializeOpAllocateStaticIp) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAllocateStaticIp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AllocateStaticIpInput)
_ = 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("Lightsail_20161128.AllocateStaticIp")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAllocateStaticIpInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpAttachCertificateToDistribution struct {
}
func (*awsAwsjson11_serializeOpAttachCertificateToDistribution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAttachCertificateToDistribution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AttachCertificateToDistributionInput)
_ = 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("Lightsail_20161128.AttachCertificateToDistribution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAttachCertificateToDistributionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpAttachDisk struct {
}
func (*awsAwsjson11_serializeOpAttachDisk) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAttachDisk) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AttachDiskInput)
_ = 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("Lightsail_20161128.AttachDisk")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAttachDiskInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpAttachInstancesToLoadBalancer struct {
}
func (*awsAwsjson11_serializeOpAttachInstancesToLoadBalancer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAttachInstancesToLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AttachInstancesToLoadBalancerInput)
_ = 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("Lightsail_20161128.AttachInstancesToLoadBalancer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAttachInstancesToLoadBalancerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpAttachLoadBalancerTlsCertificate struct {
}
func (*awsAwsjson11_serializeOpAttachLoadBalancerTlsCertificate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAttachLoadBalancerTlsCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AttachLoadBalancerTlsCertificateInput)
_ = 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("Lightsail_20161128.AttachLoadBalancerTlsCertificate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAttachLoadBalancerTlsCertificateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpAttachStaticIp struct {
}
func (*awsAwsjson11_serializeOpAttachStaticIp) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAttachStaticIp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AttachStaticIpInput)
_ = 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("Lightsail_20161128.AttachStaticIp")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAttachStaticIpInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCloseInstancePublicPorts struct {
}
func (*awsAwsjson11_serializeOpCloseInstancePublicPorts) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCloseInstancePublicPorts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CloseInstancePublicPortsInput)
_ = 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("Lightsail_20161128.CloseInstancePublicPorts")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCloseInstancePublicPortsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCopySnapshot struct {
}
func (*awsAwsjson11_serializeOpCopySnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCopySnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CopySnapshotInput)
_ = 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("Lightsail_20161128.CopySnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCopySnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateBucket struct {
}
func (*awsAwsjson11_serializeOpCreateBucket) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateBucketInput)
_ = 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("Lightsail_20161128.CreateBucket")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateBucketInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateBucketAccessKey struct {
}
func (*awsAwsjson11_serializeOpCreateBucketAccessKey) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateBucketAccessKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateBucketAccessKeyInput)
_ = 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("Lightsail_20161128.CreateBucketAccessKey")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateBucketAccessKeyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateCertificate struct {
}
func (*awsAwsjson11_serializeOpCreateCertificate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateCertificateInput)
_ = 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("Lightsail_20161128.CreateCertificate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateCertificateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateCloudFormationStack struct {
}
func (*awsAwsjson11_serializeOpCreateCloudFormationStack) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateCloudFormationStack) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateCloudFormationStackInput)
_ = 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("Lightsail_20161128.CreateCloudFormationStack")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateCloudFormationStackInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateContactMethod struct {
}
func (*awsAwsjson11_serializeOpCreateContactMethod) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateContactMethod) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateContactMethodInput)
_ = 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("Lightsail_20161128.CreateContactMethod")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateContactMethodInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateContainerService struct {
}
func (*awsAwsjson11_serializeOpCreateContainerService) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateContainerService) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateContainerServiceInput)
_ = 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("Lightsail_20161128.CreateContainerService")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateContainerServiceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateContainerServiceDeployment struct {
}
func (*awsAwsjson11_serializeOpCreateContainerServiceDeployment) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateContainerServiceDeployment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateContainerServiceDeploymentInput)
_ = 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("Lightsail_20161128.CreateContainerServiceDeployment")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateContainerServiceDeploymentInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateContainerServiceRegistryLogin struct {
}
func (*awsAwsjson11_serializeOpCreateContainerServiceRegistryLogin) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateContainerServiceRegistryLogin) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateContainerServiceRegistryLoginInput)
_ = 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("Lightsail_20161128.CreateContainerServiceRegistryLogin")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateContainerServiceRegistryLoginInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateDisk struct {
}
func (*awsAwsjson11_serializeOpCreateDisk) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateDisk) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDiskInput)
_ = 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("Lightsail_20161128.CreateDisk")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateDiskInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateDiskFromSnapshot struct {
}
func (*awsAwsjson11_serializeOpCreateDiskFromSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateDiskFromSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDiskFromSnapshotInput)
_ = 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("Lightsail_20161128.CreateDiskFromSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateDiskFromSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateDiskSnapshot struct {
}
func (*awsAwsjson11_serializeOpCreateDiskSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateDiskSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDiskSnapshotInput)
_ = 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("Lightsail_20161128.CreateDiskSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateDiskSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateDistribution struct {
}
func (*awsAwsjson11_serializeOpCreateDistribution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateDistribution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDistributionInput)
_ = 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("Lightsail_20161128.CreateDistribution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateDistributionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateDomain struct {
}
func (*awsAwsjson11_serializeOpCreateDomain) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDomainInput)
_ = 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("Lightsail_20161128.CreateDomain")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateDomainInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateDomainEntry struct {
}
func (*awsAwsjson11_serializeOpCreateDomainEntry) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateDomainEntry) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDomainEntryInput)
_ = 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("Lightsail_20161128.CreateDomainEntry")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateDomainEntryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateGUISessionAccessDetails struct {
}
func (*awsAwsjson11_serializeOpCreateGUISessionAccessDetails) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateGUISessionAccessDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateGUISessionAccessDetailsInput)
_ = 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("Lightsail_20161128.CreateGUISessionAccessDetails")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateGUISessionAccessDetailsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateInstances struct {
}
func (*awsAwsjson11_serializeOpCreateInstances) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateInstances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateInstancesInput)
_ = 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("Lightsail_20161128.CreateInstances")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateInstancesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateInstancesFromSnapshot struct {
}
func (*awsAwsjson11_serializeOpCreateInstancesFromSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateInstancesFromSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateInstancesFromSnapshotInput)
_ = 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("Lightsail_20161128.CreateInstancesFromSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateInstancesFromSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateInstanceSnapshot struct {
}
func (*awsAwsjson11_serializeOpCreateInstanceSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateInstanceSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateInstanceSnapshotInput)
_ = 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("Lightsail_20161128.CreateInstanceSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateInstanceSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateKeyPair struct {
}
func (*awsAwsjson11_serializeOpCreateKeyPair) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateKeyPair) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateKeyPairInput)
_ = 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("Lightsail_20161128.CreateKeyPair")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateKeyPairInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateLoadBalancer struct {
}
func (*awsAwsjson11_serializeOpCreateLoadBalancer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateLoadBalancerInput)
_ = 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("Lightsail_20161128.CreateLoadBalancer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateLoadBalancerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateLoadBalancerTlsCertificate struct {
}
func (*awsAwsjson11_serializeOpCreateLoadBalancerTlsCertificate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateLoadBalancerTlsCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateLoadBalancerTlsCertificateInput)
_ = 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("Lightsail_20161128.CreateLoadBalancerTlsCertificate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateLoadBalancerTlsCertificateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateRelationalDatabase struct {
}
func (*awsAwsjson11_serializeOpCreateRelationalDatabase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRelationalDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRelationalDatabaseInput)
_ = 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("Lightsail_20161128.CreateRelationalDatabase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRelationalDatabaseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateRelationalDatabaseFromSnapshot struct {
}
func (*awsAwsjson11_serializeOpCreateRelationalDatabaseFromSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRelationalDatabaseFromSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRelationalDatabaseFromSnapshotInput)
_ = 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("Lightsail_20161128.CreateRelationalDatabaseFromSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRelationalDatabaseFromSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpCreateRelationalDatabaseSnapshot struct {
}
func (*awsAwsjson11_serializeOpCreateRelationalDatabaseSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateRelationalDatabaseSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRelationalDatabaseSnapshotInput)
_ = 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("Lightsail_20161128.CreateRelationalDatabaseSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateRelationalDatabaseSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteAlarm struct {
}
func (*awsAwsjson11_serializeOpDeleteAlarm) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteAlarm) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAlarmInput)
_ = 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("Lightsail_20161128.DeleteAlarm")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteAlarmInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteAutoSnapshot struct {
}
func (*awsAwsjson11_serializeOpDeleteAutoSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteAutoSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAutoSnapshotInput)
_ = 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("Lightsail_20161128.DeleteAutoSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteAutoSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteBucket struct {
}
func (*awsAwsjson11_serializeOpDeleteBucket) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteBucketInput)
_ = 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("Lightsail_20161128.DeleteBucket")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteBucketInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteBucketAccessKey struct {
}
func (*awsAwsjson11_serializeOpDeleteBucketAccessKey) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteBucketAccessKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteBucketAccessKeyInput)
_ = 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("Lightsail_20161128.DeleteBucketAccessKey")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteBucketAccessKeyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteCertificate struct {
}
func (*awsAwsjson11_serializeOpDeleteCertificate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteCertificateInput)
_ = 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("Lightsail_20161128.DeleteCertificate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteCertificateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteContactMethod struct {
}
func (*awsAwsjson11_serializeOpDeleteContactMethod) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteContactMethod) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteContactMethodInput)
_ = 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("Lightsail_20161128.DeleteContactMethod")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteContactMethodInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteContainerImage struct {
}
func (*awsAwsjson11_serializeOpDeleteContainerImage) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteContainerImage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteContainerImageInput)
_ = 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("Lightsail_20161128.DeleteContainerImage")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteContainerImageInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteContainerService struct {
}
func (*awsAwsjson11_serializeOpDeleteContainerService) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteContainerService) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteContainerServiceInput)
_ = 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("Lightsail_20161128.DeleteContainerService")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteContainerServiceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteDisk struct {
}
func (*awsAwsjson11_serializeOpDeleteDisk) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteDisk) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDiskInput)
_ = 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("Lightsail_20161128.DeleteDisk")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteDiskInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteDiskSnapshot struct {
}
func (*awsAwsjson11_serializeOpDeleteDiskSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteDiskSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDiskSnapshotInput)
_ = 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("Lightsail_20161128.DeleteDiskSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteDiskSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteDistribution struct {
}
func (*awsAwsjson11_serializeOpDeleteDistribution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteDistribution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDistributionInput)
_ = 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("Lightsail_20161128.DeleteDistribution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteDistributionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteDomain struct {
}
func (*awsAwsjson11_serializeOpDeleteDomain) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDomainInput)
_ = 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("Lightsail_20161128.DeleteDomain")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteDomainInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteDomainEntry struct {
}
func (*awsAwsjson11_serializeOpDeleteDomainEntry) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteDomainEntry) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDomainEntryInput)
_ = 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("Lightsail_20161128.DeleteDomainEntry")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteDomainEntryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteInstance struct {
}
func (*awsAwsjson11_serializeOpDeleteInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteInstanceInput)
_ = 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("Lightsail_20161128.DeleteInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteInstanceSnapshot struct {
}
func (*awsAwsjson11_serializeOpDeleteInstanceSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteInstanceSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteInstanceSnapshotInput)
_ = 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("Lightsail_20161128.DeleteInstanceSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteInstanceSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteKeyPair struct {
}
func (*awsAwsjson11_serializeOpDeleteKeyPair) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteKeyPair) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteKeyPairInput)
_ = 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("Lightsail_20161128.DeleteKeyPair")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteKeyPairInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteKnownHostKeys struct {
}
func (*awsAwsjson11_serializeOpDeleteKnownHostKeys) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteKnownHostKeys) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteKnownHostKeysInput)
_ = 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("Lightsail_20161128.DeleteKnownHostKeys")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteKnownHostKeysInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteLoadBalancer struct {
}
func (*awsAwsjson11_serializeOpDeleteLoadBalancer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteLoadBalancerInput)
_ = 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("Lightsail_20161128.DeleteLoadBalancer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteLoadBalancerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteLoadBalancerTlsCertificate struct {
}
func (*awsAwsjson11_serializeOpDeleteLoadBalancerTlsCertificate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteLoadBalancerTlsCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteLoadBalancerTlsCertificateInput)
_ = 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("Lightsail_20161128.DeleteLoadBalancerTlsCertificate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteLoadBalancerTlsCertificateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteRelationalDatabase struct {
}
func (*awsAwsjson11_serializeOpDeleteRelationalDatabase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteRelationalDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRelationalDatabaseInput)
_ = 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("Lightsail_20161128.DeleteRelationalDatabase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteRelationalDatabaseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDeleteRelationalDatabaseSnapshot struct {
}
func (*awsAwsjson11_serializeOpDeleteRelationalDatabaseSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteRelationalDatabaseSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRelationalDatabaseSnapshotInput)
_ = 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("Lightsail_20161128.DeleteRelationalDatabaseSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteRelationalDatabaseSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDetachCertificateFromDistribution struct {
}
func (*awsAwsjson11_serializeOpDetachCertificateFromDistribution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetachCertificateFromDistribution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DetachCertificateFromDistributionInput)
_ = 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("Lightsail_20161128.DetachCertificateFromDistribution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetachCertificateFromDistributionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDetachDisk struct {
}
func (*awsAwsjson11_serializeOpDetachDisk) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetachDisk) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DetachDiskInput)
_ = 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("Lightsail_20161128.DetachDisk")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetachDiskInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDetachInstancesFromLoadBalancer struct {
}
func (*awsAwsjson11_serializeOpDetachInstancesFromLoadBalancer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetachInstancesFromLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DetachInstancesFromLoadBalancerInput)
_ = 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("Lightsail_20161128.DetachInstancesFromLoadBalancer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetachInstancesFromLoadBalancerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDetachStaticIp struct {
}
func (*awsAwsjson11_serializeOpDetachStaticIp) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDetachStaticIp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DetachStaticIpInput)
_ = 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("Lightsail_20161128.DetachStaticIp")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDetachStaticIpInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDisableAddOn struct {
}
func (*awsAwsjson11_serializeOpDisableAddOn) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisableAddOn) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisableAddOnInput)
_ = 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("Lightsail_20161128.DisableAddOn")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisableAddOnInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpDownloadDefaultKeyPair struct {
}
func (*awsAwsjson11_serializeOpDownloadDefaultKeyPair) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDownloadDefaultKeyPair) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DownloadDefaultKeyPairInput)
_ = 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("Lightsail_20161128.DownloadDefaultKeyPair")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDownloadDefaultKeyPairInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpEnableAddOn struct {
}
func (*awsAwsjson11_serializeOpEnableAddOn) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpEnableAddOn) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*EnableAddOnInput)
_ = 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("Lightsail_20161128.EnableAddOn")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentEnableAddOnInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpExportSnapshot struct {
}
func (*awsAwsjson11_serializeOpExportSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpExportSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ExportSnapshotInput)
_ = 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("Lightsail_20161128.ExportSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentExportSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetActiveNames struct {
}
func (*awsAwsjson11_serializeOpGetActiveNames) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetActiveNames) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetActiveNamesInput)
_ = 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("Lightsail_20161128.GetActiveNames")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetActiveNamesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetAlarms struct {
}
func (*awsAwsjson11_serializeOpGetAlarms) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetAlarms) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetAlarmsInput)
_ = 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("Lightsail_20161128.GetAlarms")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetAlarmsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetAutoSnapshots struct {
}
func (*awsAwsjson11_serializeOpGetAutoSnapshots) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetAutoSnapshots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetAutoSnapshotsInput)
_ = 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("Lightsail_20161128.GetAutoSnapshots")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetAutoSnapshotsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetBlueprints struct {
}
func (*awsAwsjson11_serializeOpGetBlueprints) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetBlueprints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetBlueprintsInput)
_ = 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("Lightsail_20161128.GetBlueprints")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetBlueprintsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetBucketAccessKeys struct {
}
func (*awsAwsjson11_serializeOpGetBucketAccessKeys) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetBucketAccessKeys) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetBucketAccessKeysInput)
_ = 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("Lightsail_20161128.GetBucketAccessKeys")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetBucketAccessKeysInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetBucketBundles struct {
}
func (*awsAwsjson11_serializeOpGetBucketBundles) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetBucketBundles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetBucketBundlesInput)
_ = 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("Lightsail_20161128.GetBucketBundles")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetBucketBundlesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetBucketMetricData struct {
}
func (*awsAwsjson11_serializeOpGetBucketMetricData) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetBucketMetricData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetBucketMetricDataInput)
_ = 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("Lightsail_20161128.GetBucketMetricData")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetBucketMetricDataInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetBuckets struct {
}
func (*awsAwsjson11_serializeOpGetBuckets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetBuckets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetBucketsInput)
_ = 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("Lightsail_20161128.GetBuckets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetBucketsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetBundles struct {
}
func (*awsAwsjson11_serializeOpGetBundles) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetBundles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetBundlesInput)
_ = 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("Lightsail_20161128.GetBundles")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetBundlesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetCertificates struct {
}
func (*awsAwsjson11_serializeOpGetCertificates) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetCertificates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetCertificatesInput)
_ = 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("Lightsail_20161128.GetCertificates")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetCertificatesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetCloudFormationStackRecords struct {
}
func (*awsAwsjson11_serializeOpGetCloudFormationStackRecords) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetCloudFormationStackRecords) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetCloudFormationStackRecordsInput)
_ = 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("Lightsail_20161128.GetCloudFormationStackRecords")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetCloudFormationStackRecordsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetContactMethods struct {
}
func (*awsAwsjson11_serializeOpGetContactMethods) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContactMethods) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetContactMethodsInput)
_ = 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("Lightsail_20161128.GetContactMethods")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContactMethodsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetContainerAPIMetadata struct {
}
func (*awsAwsjson11_serializeOpGetContainerAPIMetadata) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContainerAPIMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetContainerAPIMetadataInput)
_ = 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("Lightsail_20161128.GetContainerAPIMetadata")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContainerAPIMetadataInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetContainerImages struct {
}
func (*awsAwsjson11_serializeOpGetContainerImages) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContainerImages) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetContainerImagesInput)
_ = 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("Lightsail_20161128.GetContainerImages")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContainerImagesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetContainerLog struct {
}
func (*awsAwsjson11_serializeOpGetContainerLog) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContainerLog) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetContainerLogInput)
_ = 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("Lightsail_20161128.GetContainerLog")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContainerLogInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetContainerServiceDeployments struct {
}
func (*awsAwsjson11_serializeOpGetContainerServiceDeployments) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContainerServiceDeployments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetContainerServiceDeploymentsInput)
_ = 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("Lightsail_20161128.GetContainerServiceDeployments")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContainerServiceDeploymentsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetContainerServiceMetricData struct {
}
func (*awsAwsjson11_serializeOpGetContainerServiceMetricData) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContainerServiceMetricData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetContainerServiceMetricDataInput)
_ = 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("Lightsail_20161128.GetContainerServiceMetricData")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContainerServiceMetricDataInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetContainerServicePowers struct {
}
func (*awsAwsjson11_serializeOpGetContainerServicePowers) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContainerServicePowers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetContainerServicePowersInput)
_ = 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("Lightsail_20161128.GetContainerServicePowers")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContainerServicePowersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetContainerServices struct {
}
func (*awsAwsjson11_serializeOpGetContainerServices) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContainerServices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetContainerServicesInput)
_ = 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("Lightsail_20161128.GetContainerServices")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContainerServicesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetCostEstimate struct {
}
func (*awsAwsjson11_serializeOpGetCostEstimate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetCostEstimate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetCostEstimateInput)
_ = 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("Lightsail_20161128.GetCostEstimate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetCostEstimateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDisk struct {
}
func (*awsAwsjson11_serializeOpGetDisk) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDisk) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDiskInput)
_ = 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("Lightsail_20161128.GetDisk")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDiskInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDisks struct {
}
func (*awsAwsjson11_serializeOpGetDisks) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDisks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDisksInput)
_ = 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("Lightsail_20161128.GetDisks")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDisksInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDiskSnapshot struct {
}
func (*awsAwsjson11_serializeOpGetDiskSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDiskSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDiskSnapshotInput)
_ = 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("Lightsail_20161128.GetDiskSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDiskSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDiskSnapshots struct {
}
func (*awsAwsjson11_serializeOpGetDiskSnapshots) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDiskSnapshots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDiskSnapshotsInput)
_ = 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("Lightsail_20161128.GetDiskSnapshots")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDiskSnapshotsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDistributionBundles struct {
}
func (*awsAwsjson11_serializeOpGetDistributionBundles) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDistributionBundles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDistributionBundlesInput)
_ = 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("Lightsail_20161128.GetDistributionBundles")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDistributionBundlesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDistributionLatestCacheReset struct {
}
func (*awsAwsjson11_serializeOpGetDistributionLatestCacheReset) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDistributionLatestCacheReset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDistributionLatestCacheResetInput)
_ = 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("Lightsail_20161128.GetDistributionLatestCacheReset")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDistributionLatestCacheResetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDistributionMetricData struct {
}
func (*awsAwsjson11_serializeOpGetDistributionMetricData) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDistributionMetricData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDistributionMetricDataInput)
_ = 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("Lightsail_20161128.GetDistributionMetricData")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDistributionMetricDataInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDistributions struct {
}
func (*awsAwsjson11_serializeOpGetDistributions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDistributions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDistributionsInput)
_ = 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("Lightsail_20161128.GetDistributions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDistributionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDomain struct {
}
func (*awsAwsjson11_serializeOpGetDomain) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDomainInput)
_ = 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("Lightsail_20161128.GetDomain")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDomainInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetDomains struct {
}
func (*awsAwsjson11_serializeOpGetDomains) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetDomains) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDomainsInput)
_ = 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("Lightsail_20161128.GetDomains")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetDomainsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetExportSnapshotRecords struct {
}
func (*awsAwsjson11_serializeOpGetExportSnapshotRecords) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetExportSnapshotRecords) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetExportSnapshotRecordsInput)
_ = 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("Lightsail_20161128.GetExportSnapshotRecords")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetExportSnapshotRecordsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetInstance struct {
}
func (*awsAwsjson11_serializeOpGetInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetInstanceInput)
_ = 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("Lightsail_20161128.GetInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetInstanceAccessDetails struct {
}
func (*awsAwsjson11_serializeOpGetInstanceAccessDetails) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetInstanceAccessDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetInstanceAccessDetailsInput)
_ = 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("Lightsail_20161128.GetInstanceAccessDetails")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetInstanceAccessDetailsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetInstanceMetricData struct {
}
func (*awsAwsjson11_serializeOpGetInstanceMetricData) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetInstanceMetricData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetInstanceMetricDataInput)
_ = 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("Lightsail_20161128.GetInstanceMetricData")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetInstanceMetricDataInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetInstancePortStates struct {
}
func (*awsAwsjson11_serializeOpGetInstancePortStates) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetInstancePortStates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetInstancePortStatesInput)
_ = 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("Lightsail_20161128.GetInstancePortStates")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetInstancePortStatesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetInstances struct {
}
func (*awsAwsjson11_serializeOpGetInstances) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetInstances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetInstancesInput)
_ = 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("Lightsail_20161128.GetInstances")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetInstancesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetInstanceSnapshot struct {
}
func (*awsAwsjson11_serializeOpGetInstanceSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetInstanceSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetInstanceSnapshotInput)
_ = 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("Lightsail_20161128.GetInstanceSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetInstanceSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetInstanceSnapshots struct {
}
func (*awsAwsjson11_serializeOpGetInstanceSnapshots) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetInstanceSnapshots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetInstanceSnapshotsInput)
_ = 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("Lightsail_20161128.GetInstanceSnapshots")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetInstanceSnapshotsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetInstanceState struct {
}
func (*awsAwsjson11_serializeOpGetInstanceState) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetInstanceState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetInstanceStateInput)
_ = 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("Lightsail_20161128.GetInstanceState")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetInstanceStateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetKeyPair struct {
}
func (*awsAwsjson11_serializeOpGetKeyPair) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetKeyPair) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetKeyPairInput)
_ = 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("Lightsail_20161128.GetKeyPair")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetKeyPairInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetKeyPairs struct {
}
func (*awsAwsjson11_serializeOpGetKeyPairs) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetKeyPairs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetKeyPairsInput)
_ = 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("Lightsail_20161128.GetKeyPairs")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetKeyPairsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetLoadBalancer struct {
}
func (*awsAwsjson11_serializeOpGetLoadBalancer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLoadBalancer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetLoadBalancerInput)
_ = 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("Lightsail_20161128.GetLoadBalancer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLoadBalancerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetLoadBalancerMetricData struct {
}
func (*awsAwsjson11_serializeOpGetLoadBalancerMetricData) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLoadBalancerMetricData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetLoadBalancerMetricDataInput)
_ = 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("Lightsail_20161128.GetLoadBalancerMetricData")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLoadBalancerMetricDataInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetLoadBalancers struct {
}
func (*awsAwsjson11_serializeOpGetLoadBalancers) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLoadBalancers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetLoadBalancersInput)
_ = 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("Lightsail_20161128.GetLoadBalancers")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLoadBalancersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetLoadBalancerTlsCertificates struct {
}
func (*awsAwsjson11_serializeOpGetLoadBalancerTlsCertificates) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLoadBalancerTlsCertificates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetLoadBalancerTlsCertificatesInput)
_ = 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("Lightsail_20161128.GetLoadBalancerTlsCertificates")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLoadBalancerTlsCertificatesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetLoadBalancerTlsPolicies struct {
}
func (*awsAwsjson11_serializeOpGetLoadBalancerTlsPolicies) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLoadBalancerTlsPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetLoadBalancerTlsPoliciesInput)
_ = 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("Lightsail_20161128.GetLoadBalancerTlsPolicies")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLoadBalancerTlsPoliciesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetOperation struct {
}
func (*awsAwsjson11_serializeOpGetOperation) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetOperation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetOperationInput)
_ = 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("Lightsail_20161128.GetOperation")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetOperationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetOperations struct {
}
func (*awsAwsjson11_serializeOpGetOperations) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetOperations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetOperationsInput)
_ = 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("Lightsail_20161128.GetOperations")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetOperationsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetOperationsForResource struct {
}
func (*awsAwsjson11_serializeOpGetOperationsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetOperationsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetOperationsForResourceInput)
_ = 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("Lightsail_20161128.GetOperationsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetOperationsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRegions struct {
}
func (*awsAwsjson11_serializeOpGetRegions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRegions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRegionsInput)
_ = 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("Lightsail_20161128.GetRegions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRegionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabase struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseInput)
_ = 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("Lightsail_20161128.GetRelationalDatabase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseBlueprints struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseBlueprints) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseBlueprints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseBlueprintsInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseBlueprints")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseBlueprintsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseBundles struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseBundles) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseBundles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseBundlesInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseBundles")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseBundlesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseEvents struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseEvents) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseEventsInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseEvents")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseEventsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseLogEvents struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseLogEvents) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseLogEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseLogEventsInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseLogEvents")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseLogEventsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseLogStreams struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseLogStreams) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseLogStreams) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseLogStreamsInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseLogStreams")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseLogStreamsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseMasterUserPassword struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseMasterUserPassword) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseMasterUserPassword) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseMasterUserPasswordInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseMasterUserPassword")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseMasterUserPasswordInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseMetricData struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseMetricData) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseMetricData) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseMetricDataInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseMetricData")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseMetricDataInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseParameters struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseParameters) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseParametersInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseParameters")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseParametersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabases struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabases) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabasesInput)
_ = 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("Lightsail_20161128.GetRelationalDatabases")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabasesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseSnapshot struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseSnapshot) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseSnapshotInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseSnapshot")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseSnapshotInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetRelationalDatabaseSnapshots struct {
}
func (*awsAwsjson11_serializeOpGetRelationalDatabaseSnapshots) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRelationalDatabaseSnapshots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRelationalDatabaseSnapshotsInput)
_ = 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("Lightsail_20161128.GetRelationalDatabaseSnapshots")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRelationalDatabaseSnapshotsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetStaticIp struct {
}
func (*awsAwsjson11_serializeOpGetStaticIp) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetStaticIp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetStaticIpInput)
_ = 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("Lightsail_20161128.GetStaticIp")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetStaticIpInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpGetStaticIps struct {
}
func (*awsAwsjson11_serializeOpGetStaticIps) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetStaticIps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetStaticIpsInput)
_ = 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("Lightsail_20161128.GetStaticIps")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetStaticIpsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpImportKeyPair struct {
}
func (*awsAwsjson11_serializeOpImportKeyPair) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpImportKeyPair) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ImportKeyPairInput)
_ = 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("Lightsail_20161128.ImportKeyPair")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentImportKeyPairInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpIsVpcPeered struct {
}
func (*awsAwsjson11_serializeOpIsVpcPeered) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpIsVpcPeered) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*IsVpcPeeredInput)
_ = 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("Lightsail_20161128.IsVpcPeered")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentIsVpcPeeredInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpOpenInstancePublicPorts struct {
}
func (*awsAwsjson11_serializeOpOpenInstancePublicPorts) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpOpenInstancePublicPorts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*OpenInstancePublicPortsInput)
_ = 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("Lightsail_20161128.OpenInstancePublicPorts")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentOpenInstancePublicPortsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpPeerVpc struct {
}
func (*awsAwsjson11_serializeOpPeerVpc) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPeerVpc) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PeerVpcInput)
_ = 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("Lightsail_20161128.PeerVpc")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPeerVpcInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpPutAlarm struct {
}
func (*awsAwsjson11_serializeOpPutAlarm) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutAlarm) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutAlarmInput)
_ = 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("Lightsail_20161128.PutAlarm")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutAlarmInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpPutInstancePublicPorts struct {
}
func (*awsAwsjson11_serializeOpPutInstancePublicPorts) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutInstancePublicPorts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutInstancePublicPortsInput)
_ = 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("Lightsail_20161128.PutInstancePublicPorts")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutInstancePublicPortsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpRebootInstance struct {
}
func (*awsAwsjson11_serializeOpRebootInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRebootInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RebootInstanceInput)
_ = 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("Lightsail_20161128.RebootInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRebootInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpRebootRelationalDatabase struct {
}
func (*awsAwsjson11_serializeOpRebootRelationalDatabase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRebootRelationalDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RebootRelationalDatabaseInput)
_ = 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("Lightsail_20161128.RebootRelationalDatabase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRebootRelationalDatabaseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpRegisterContainerImage struct {
}
func (*awsAwsjson11_serializeOpRegisterContainerImage) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRegisterContainerImage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RegisterContainerImageInput)
_ = 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("Lightsail_20161128.RegisterContainerImage")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRegisterContainerImageInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpReleaseStaticIp struct {
}
func (*awsAwsjson11_serializeOpReleaseStaticIp) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpReleaseStaticIp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ReleaseStaticIpInput)
_ = 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("Lightsail_20161128.ReleaseStaticIp")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentReleaseStaticIpInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpResetDistributionCache struct {
}
func (*awsAwsjson11_serializeOpResetDistributionCache) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpResetDistributionCache) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ResetDistributionCacheInput)
_ = 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("Lightsail_20161128.ResetDistributionCache")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentResetDistributionCacheInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpSendContactMethodVerification struct {
}
func (*awsAwsjson11_serializeOpSendContactMethodVerification) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSendContactMethodVerification) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SendContactMethodVerificationInput)
_ = 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("Lightsail_20161128.SendContactMethodVerification")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSendContactMethodVerificationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpSetIpAddressType struct {
}
func (*awsAwsjson11_serializeOpSetIpAddressType) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSetIpAddressType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SetIpAddressTypeInput)
_ = 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("Lightsail_20161128.SetIpAddressType")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSetIpAddressTypeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpSetResourceAccessForBucket struct {
}
func (*awsAwsjson11_serializeOpSetResourceAccessForBucket) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSetResourceAccessForBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SetResourceAccessForBucketInput)
_ = 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("Lightsail_20161128.SetResourceAccessForBucket")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSetResourceAccessForBucketInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpStartGUISession struct {
}
func (*awsAwsjson11_serializeOpStartGUISession) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartGUISession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartGUISessionInput)
_ = 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("Lightsail_20161128.StartGUISession")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartGUISessionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpStartInstance struct {
}
func (*awsAwsjson11_serializeOpStartInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartInstanceInput)
_ = 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("Lightsail_20161128.StartInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpStartRelationalDatabase struct {
}
func (*awsAwsjson11_serializeOpStartRelationalDatabase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartRelationalDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartRelationalDatabaseInput)
_ = 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("Lightsail_20161128.StartRelationalDatabase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartRelationalDatabaseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpStopGUISession struct {
}
func (*awsAwsjson11_serializeOpStopGUISession) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopGUISession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopGUISessionInput)
_ = 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("Lightsail_20161128.StopGUISession")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopGUISessionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpStopInstance struct {
}
func (*awsAwsjson11_serializeOpStopInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopInstanceInput)
_ = 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("Lightsail_20161128.StopInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpStopRelationalDatabase struct {
}
func (*awsAwsjson11_serializeOpStopRelationalDatabase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopRelationalDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopRelationalDatabaseInput)
_ = 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("Lightsail_20161128.StopRelationalDatabase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopRelationalDatabaseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpTagResource struct {
}
func (*awsAwsjson11_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
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("Lightsail_20161128.TagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTestAlarm struct {
}
func (*awsAwsjson11_serializeOpTestAlarm) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTestAlarm) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TestAlarmInput)
_ = 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("Lightsail_20161128.TestAlarm")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTestAlarmInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUnpeerVpc struct {
}
func (*awsAwsjson11_serializeOpUnpeerVpc) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUnpeerVpc) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UnpeerVpcInput)
_ = 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("Lightsail_20161128.UnpeerVpc")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUnpeerVpcInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUntagResource struct {
}
func (*awsAwsjson11_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
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("Lightsail_20161128.UntagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateBucket struct {
}
func (*awsAwsjson11_serializeOpUpdateBucket) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateBucketInput)
_ = 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("Lightsail_20161128.UpdateBucket")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateBucketInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateBucketBundle struct {
}
func (*awsAwsjson11_serializeOpUpdateBucketBundle) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateBucketBundle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateBucketBundleInput)
_ = 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("Lightsail_20161128.UpdateBucketBundle")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateBucketBundleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateContainerService struct {
}
func (*awsAwsjson11_serializeOpUpdateContainerService) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateContainerService) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateContainerServiceInput)
_ = 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("Lightsail_20161128.UpdateContainerService")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateContainerServiceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateDistribution struct {
}
func (*awsAwsjson11_serializeOpUpdateDistribution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateDistribution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateDistributionInput)
_ = 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("Lightsail_20161128.UpdateDistribution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateDistributionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateDistributionBundle struct {
}
func (*awsAwsjson11_serializeOpUpdateDistributionBundle) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateDistributionBundle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateDistributionBundleInput)
_ = 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("Lightsail_20161128.UpdateDistributionBundle")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateDistributionBundleInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateDomainEntry struct {
}
func (*awsAwsjson11_serializeOpUpdateDomainEntry) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateDomainEntry) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateDomainEntryInput)
_ = 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("Lightsail_20161128.UpdateDomainEntry")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateDomainEntryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateInstanceMetadataOptions struct {
}
func (*awsAwsjson11_serializeOpUpdateInstanceMetadataOptions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateInstanceMetadataOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateInstanceMetadataOptionsInput)
_ = 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("Lightsail_20161128.UpdateInstanceMetadataOptions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateInstanceMetadataOptionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateLoadBalancerAttribute struct {
}
func (*awsAwsjson11_serializeOpUpdateLoadBalancerAttribute) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateLoadBalancerAttribute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateLoadBalancerAttributeInput)
_ = 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("Lightsail_20161128.UpdateLoadBalancerAttribute")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateLoadBalancerAttributeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateRelationalDatabase struct {
}
func (*awsAwsjson11_serializeOpUpdateRelationalDatabase) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateRelationalDatabase) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRelationalDatabaseInput)
_ = 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("Lightsail_20161128.UpdateRelationalDatabase")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateRelationalDatabaseInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpUpdateRelationalDatabaseParameters struct {
}
func (*awsAwsjson11_serializeOpUpdateRelationalDatabaseParameters) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateRelationalDatabaseParameters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRelationalDatabaseParametersInput)
_ = 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("Lightsail_20161128.UpdateRelationalDatabaseParameters")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateRelationalDatabaseParametersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeDocumentAccessRules(v *types.AccessRules, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowPublicOverrides != nil {
ok := object.Key("allowPublicOverrides")
ok.Boolean(*v.AllowPublicOverrides)
}
if len(v.GetObject) > 0 {
ok := object.Key("getObject")
ok.String(string(v.GetObject))
}
return nil
}
func awsAwsjson11_serializeDocumentAddOnRequest(v *types.AddOnRequest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AddOnType) > 0 {
ok := object.Key("addOnType")
ok.String(string(v.AddOnType))
}
if v.AutoSnapshotAddOnRequest != nil {
ok := object.Key("autoSnapshotAddOnRequest")
if err := awsAwsjson11_serializeDocumentAutoSnapshotAddOnRequest(v.AutoSnapshotAddOnRequest, ok); err != nil {
return err
}
}
if v.StopInstanceOnIdleRequest != nil {
ok := object.Key("stopInstanceOnIdleRequest")
if err := awsAwsjson11_serializeDocumentStopInstanceOnIdleRequest(v.StopInstanceOnIdleRequest, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAddOnRequestList(v []types.AddOnRequest, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentAddOnRequest(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAttachedDiskMap(v map[string][]types.DiskMap, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
continue
}
if err := awsAwsjson11_serializeDocumentDiskMapList(v[key], om); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAutoSnapshotAddOnRequest(v *types.AutoSnapshotAddOnRequest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SnapshotTimeOfDay != nil {
ok := object.Key("snapshotTimeOfDay")
ok.String(*v.SnapshotTimeOfDay)
}
return nil
}
func awsAwsjson11_serializeDocumentBucketAccessLogConfig(v *types.BucketAccessLogConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Destination != nil {
ok := object.Key("destination")
ok.String(*v.Destination)
}
if v.Enabled != nil {
ok := object.Key("enabled")
ok.Boolean(*v.Enabled)
}
if v.Prefix != nil {
ok := object.Key("prefix")
ok.String(*v.Prefix)
}
return nil
}
func awsAwsjson11_serializeDocumentCacheBehavior(v *types.CacheBehavior, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Behavior) > 0 {
ok := object.Key("behavior")
ok.String(string(v.Behavior))
}
return nil
}
func awsAwsjson11_serializeDocumentCacheBehaviorList(v []types.CacheBehaviorPerPath, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentCacheBehaviorPerPath(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCacheBehaviorPerPath(v *types.CacheBehaviorPerPath, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Behavior) > 0 {
ok := object.Key("behavior")
ok.String(string(v.Behavior))
}
if v.Path != nil {
ok := object.Key("path")
ok.String(*v.Path)
}
return nil
}
func awsAwsjson11_serializeDocumentCacheSettings(v *types.CacheSettings, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowedHTTPMethods != nil {
ok := object.Key("allowedHTTPMethods")
ok.String(*v.AllowedHTTPMethods)
}
if v.CachedHTTPMethods != nil {
ok := object.Key("cachedHTTPMethods")
ok.String(*v.CachedHTTPMethods)
}
if v.DefaultTTL != nil {
ok := object.Key("defaultTTL")
ok.Long(*v.DefaultTTL)
}
if v.ForwardedCookies != nil {
ok := object.Key("forwardedCookies")
if err := awsAwsjson11_serializeDocumentCookieObject(v.ForwardedCookies, ok); err != nil {
return err
}
}
if v.ForwardedHeaders != nil {
ok := object.Key("forwardedHeaders")
if err := awsAwsjson11_serializeDocumentHeaderObject(v.ForwardedHeaders, ok); err != nil {
return err
}
}
if v.ForwardedQueryStrings != nil {
ok := object.Key("forwardedQueryStrings")
if err := awsAwsjson11_serializeDocumentQueryStringObject(v.ForwardedQueryStrings, ok); err != nil {
return err
}
}
if v.MaximumTTL != nil {
ok := object.Key("maximumTTL")
ok.Long(*v.MaximumTTL)
}
if v.MinimumTTL != nil {
ok := object.Key("minimumTTL")
ok.Long(*v.MinimumTTL)
}
return nil
}
func awsAwsjson11_serializeDocumentCertificateStatusList(v []types.CertificateStatus, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentContactProtocolsList(v []types.ContactProtocol, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentContainer(v *types.Container, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Command != nil {
ok := object.Key("command")
if err := awsAwsjson11_serializeDocumentStringList(v.Command, ok); err != nil {
return err
}
}
if v.Environment != nil {
ok := object.Key("environment")
if err := awsAwsjson11_serializeDocumentEnvironment(v.Environment, ok); err != nil {
return err
}
}
if v.Image != nil {
ok := object.Key("image")
ok.String(*v.Image)
}
if v.Ports != nil {
ok := object.Key("ports")
if err := awsAwsjson11_serializeDocumentPortMap(v.Ports, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentContainerMap(v map[string]types.Container, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsAwsjson11_serializeDocumentContainer(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentContainerServiceDeploymentRequest(v *types.ContainerServiceDeploymentRequest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Containers != nil {
ok := object.Key("containers")
if err := awsAwsjson11_serializeDocumentContainerMap(v.Containers, ok); err != nil {
return err
}
}
if v.PublicEndpoint != nil {
ok := object.Key("publicEndpoint")
if err := awsAwsjson11_serializeDocumentEndpointRequest(v.PublicEndpoint, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentContainerServiceECRImagePullerRoleRequest(v *types.ContainerServiceECRImagePullerRoleRequest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IsActive != nil {
ok := object.Key("isActive")
ok.Boolean(*v.IsActive)
}
return nil
}
func awsAwsjson11_serializeDocumentContainerServiceHealthCheckConfig(v *types.ContainerServiceHealthCheckConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.HealthyThreshold != nil {
ok := object.Key("healthyThreshold")
ok.Integer(*v.HealthyThreshold)
}
if v.IntervalSeconds != nil {
ok := object.Key("intervalSeconds")
ok.Integer(*v.IntervalSeconds)
}
if v.Path != nil {
ok := object.Key("path")
ok.String(*v.Path)
}
if v.SuccessCodes != nil {
ok := object.Key("successCodes")
ok.String(*v.SuccessCodes)
}
if v.TimeoutSeconds != nil {
ok := object.Key("timeoutSeconds")
ok.Integer(*v.TimeoutSeconds)
}
if v.UnhealthyThreshold != nil {
ok := object.Key("unhealthyThreshold")
ok.Integer(*v.UnhealthyThreshold)
}
return nil
}
func awsAwsjson11_serializeDocumentContainerServicePublicDomains(v map[string][]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
continue
}
if err := awsAwsjson11_serializeDocumentContainerServicePublicDomainsList(v[key], om); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentContainerServicePublicDomainsList(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_serializeDocumentCookieObject(v *types.CookieObject, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CookiesAllowList != nil {
ok := object.Key("cookiesAllowList")
if err := awsAwsjson11_serializeDocumentStringList(v.CookiesAllowList, ok); err != nil {
return err
}
}
if len(v.Option) > 0 {
ok := object.Key("option")
ok.String(string(v.Option))
}
return nil
}
func awsAwsjson11_serializeDocumentDiskMap(v *types.DiskMap, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NewDiskName != nil {
ok := object.Key("newDiskName")
ok.String(*v.NewDiskName)
}
if v.OriginalDiskPath != nil {
ok := object.Key("originalDiskPath")
ok.String(*v.OriginalDiskPath)
}
return nil
}
func awsAwsjson11_serializeDocumentDiskMapList(v []types.DiskMap, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentDiskMap(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentDomainEntry(v *types.DomainEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.IsAlias != nil {
ok := object.Key("isAlias")
ok.Boolean(*v.IsAlias)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Options != nil {
ok := object.Key("options")
if err := awsAwsjson11_serializeDocumentDomainEntryOptions(v.Options, ok); err != nil {
return err
}
}
if v.Target != nil {
ok := object.Key("target")
ok.String(*v.Target)
}
if v.Type != nil {
ok := object.Key("type")
ok.String(*v.Type)
}
return nil
}
func awsAwsjson11_serializeDocumentDomainEntryOptions(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsAwsjson11_serializeDocumentDomainNameList(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_serializeDocumentEndpointRequest(v *types.EndpointRequest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("containerName")
ok.String(*v.ContainerName)
}
if v.ContainerPort != nil {
ok := object.Key("containerPort")
ok.Integer(*v.ContainerPort)
}
if v.HealthCheck != nil {
ok := object.Key("healthCheck")
if err := awsAwsjson11_serializeDocumentContainerServiceHealthCheckConfig(v.HealthCheck, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentEnvironment(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsAwsjson11_serializeDocumentHeaderForwardList(v []types.HeaderEnum, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentHeaderObject(v *types.HeaderObject, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.HeadersAllowList != nil {
ok := object.Key("headersAllowList")
if err := awsAwsjson11_serializeDocumentHeaderForwardList(v.HeadersAllowList, ok); err != nil {
return err
}
}
if len(v.Option) > 0 {
ok := object.Key("option")
ok.String(string(v.Option))
}
return nil
}
func awsAwsjson11_serializeDocumentInputOrigin(v *types.InputOrigin, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if len(v.ProtocolPolicy) > 0 {
ok := object.Key("protocolPolicy")
ok.String(string(v.ProtocolPolicy))
}
if len(v.RegionName) > 0 {
ok := object.Key("regionName")
ok.String(string(v.RegionName))
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceEntry(v *types.InstanceEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AvailabilityZone != nil {
ok := object.Key("availabilityZone")
ok.String(*v.AvailabilityZone)
}
if v.InstanceType != nil {
ok := object.Key("instanceType")
ok.String(*v.InstanceType)
}
if len(v.PortInfoSource) > 0 {
ok := object.Key("portInfoSource")
ok.String(string(v.PortInfoSource))
}
if v.SourceName != nil {
ok := object.Key("sourceName")
ok.String(*v.SourceName)
}
if v.UserData != nil {
ok := object.Key("userData")
ok.String(*v.UserData)
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceEntryList(v []types.InstanceEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentInstanceEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentMetricStatisticList(v []types.MetricStatistic, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentNotificationTriggerList(v []types.AlarmState, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentPartnerIdList(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_serializeDocumentPortInfo(v *types.PortInfo, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CidrListAliases != nil {
ok := object.Key("cidrListAliases")
if err := awsAwsjson11_serializeDocumentStringList(v.CidrListAliases, ok); err != nil {
return err
}
}
if v.Cidrs != nil {
ok := object.Key("cidrs")
if err := awsAwsjson11_serializeDocumentStringList(v.Cidrs, ok); err != nil {
return err
}
}
if v.FromPort != 0 {
ok := object.Key("fromPort")
ok.Integer(v.FromPort)
}
if v.Ipv6Cidrs != nil {
ok := object.Key("ipv6Cidrs")
if err := awsAwsjson11_serializeDocumentStringList(v.Ipv6Cidrs, ok); err != nil {
return err
}
}
if len(v.Protocol) > 0 {
ok := object.Key("protocol")
ok.String(string(v.Protocol))
}
if v.ToPort != 0 {
ok := object.Key("toPort")
ok.Integer(v.ToPort)
}
return nil
}
func awsAwsjson11_serializeDocumentPortInfoList(v []types.PortInfo, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentPortInfo(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentPortMap(v map[string]types.ContainerServiceProtocol, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(string(v[key]))
}
return nil
}
func awsAwsjson11_serializeDocumentPrivateRegistryAccessRequest(v *types.PrivateRegistryAccessRequest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EcrImagePullerRole != nil {
ok := object.Key("ecrImagePullerRole")
if err := awsAwsjson11_serializeDocumentContainerServiceECRImagePullerRoleRequest(v.EcrImagePullerRole, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentQueryStringObject(v *types.QueryStringObject, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Option != nil {
ok := object.Key("option")
ok.Boolean(*v.Option)
}
if v.QueryStringsAllowList != nil {
ok := object.Key("queryStringsAllowList")
if err := awsAwsjson11_serializeDocumentStringList(v.QueryStringsAllowList, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRelationalDatabaseParameter(v *types.RelationalDatabaseParameter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowedValues != nil {
ok := object.Key("allowedValues")
ok.String(*v.AllowedValues)
}
if v.ApplyMethod != nil {
ok := object.Key("applyMethod")
ok.String(*v.ApplyMethod)
}
if v.ApplyType != nil {
ok := object.Key("applyType")
ok.String(*v.ApplyType)
}
if v.DataType != nil {
ok := object.Key("dataType")
ok.String(*v.DataType)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.IsModifiable != nil {
ok := object.Key("isModifiable")
ok.Boolean(*v.IsModifiable)
}
if v.ParameterName != nil {
ok := object.Key("parameterName")
ok.String(*v.ParameterName)
}
if v.ParameterValue != nil {
ok := object.Key("parameterValue")
ok.String(*v.ParameterValue)
}
return nil
}
func awsAwsjson11_serializeDocumentRelationalDatabaseParameterList(v []types.RelationalDatabaseParameter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRelationalDatabaseParameter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentResourceNameList(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_serializeDocumentStopInstanceOnIdleRequest(v *types.StopInstanceOnIdleRequest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Duration != nil {
ok := object.Key("duration")
ok.String(*v.Duration)
}
if v.Threshold != nil {
ok := object.Key("threshold")
ok.String(*v.Threshold)
}
return nil
}
func awsAwsjson11_serializeDocumentStringList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentSubjectAlternativeNameList(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_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_serializeDocumentTagKeyList(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_serializeDocumentTagList(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_serializeOpDocumentAllocateStaticIpInput(v *AllocateStaticIpInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StaticIpName != nil {
ok := object.Key("staticIpName")
ok.String(*v.StaticIpName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAttachCertificateToDistributionInput(v *AttachCertificateToDistributionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateName != nil {
ok := object.Key("certificateName")
ok.String(*v.CertificateName)
}
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAttachDiskInput(v *AttachDiskInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AutoMounting != nil {
ok := object.Key("autoMounting")
ok.Boolean(*v.AutoMounting)
}
if v.DiskName != nil {
ok := object.Key("diskName")
ok.String(*v.DiskName)
}
if v.DiskPath != nil {
ok := object.Key("diskPath")
ok.String(*v.DiskPath)
}
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAttachInstancesToLoadBalancerInput(v *AttachInstancesToLoadBalancerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceNames != nil {
ok := object.Key("instanceNames")
if err := awsAwsjson11_serializeDocumentResourceNameList(v.InstanceNames, ok); err != nil {
return err
}
}
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAttachLoadBalancerTlsCertificateInput(v *AttachLoadBalancerTlsCertificateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateName != nil {
ok := object.Key("certificateName")
ok.String(*v.CertificateName)
}
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAttachStaticIpInput(v *AttachStaticIpInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
if v.StaticIpName != nil {
ok := object.Key("staticIpName")
ok.String(*v.StaticIpName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCloseInstancePublicPortsInput(v *CloseInstancePublicPortsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
if v.PortInfo != nil {
ok := object.Key("portInfo")
if err := awsAwsjson11_serializeDocumentPortInfo(v.PortInfo, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCopySnapshotInput(v *CopySnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RestoreDate != nil {
ok := object.Key("restoreDate")
ok.String(*v.RestoreDate)
}
if len(v.SourceRegion) > 0 {
ok := object.Key("sourceRegion")
ok.String(string(v.SourceRegion))
}
if v.SourceResourceName != nil {
ok := object.Key("sourceResourceName")
ok.String(*v.SourceResourceName)
}
if v.SourceSnapshotName != nil {
ok := object.Key("sourceSnapshotName")
ok.String(*v.SourceSnapshotName)
}
if v.TargetSnapshotName != nil {
ok := object.Key("targetSnapshotName")
ok.String(*v.TargetSnapshotName)
}
if v.UseLatestRestorableAutoSnapshot != nil {
ok := object.Key("useLatestRestorableAutoSnapshot")
ok.Boolean(*v.UseLatestRestorableAutoSnapshot)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateBucketAccessKeyInput(v *CreateBucketAccessKeyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateBucketInput(v *CreateBucketInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.BundleId != nil {
ok := object.Key("bundleId")
ok.String(*v.BundleId)
}
if v.EnableObjectVersioning != nil {
ok := object.Key("enableObjectVersioning")
ok.Boolean(*v.EnableObjectVersioning)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateCertificateInput(v *CreateCertificateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateName != nil {
ok := object.Key("certificateName")
ok.String(*v.CertificateName)
}
if v.DomainName != nil {
ok := object.Key("domainName")
ok.String(*v.DomainName)
}
if v.SubjectAlternativeNames != nil {
ok := object.Key("subjectAlternativeNames")
if err := awsAwsjson11_serializeDocumentSubjectAlternativeNameList(v.SubjectAlternativeNames, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateCloudFormationStackInput(v *CreateCloudFormationStackInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Instances != nil {
ok := object.Key("instances")
if err := awsAwsjson11_serializeDocumentInstanceEntryList(v.Instances, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateContactMethodInput(v *CreateContactMethodInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContactEndpoint != nil {
ok := object.Key("contactEndpoint")
ok.String(*v.ContactEndpoint)
}
if len(v.Protocol) > 0 {
ok := object.Key("protocol")
ok.String(string(v.Protocol))
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateContainerServiceDeploymentInput(v *CreateContainerServiceDeploymentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Containers != nil {
ok := object.Key("containers")
if err := awsAwsjson11_serializeDocumentContainerMap(v.Containers, ok); err != nil {
return err
}
}
if v.PublicEndpoint != nil {
ok := object.Key("publicEndpoint")
if err := awsAwsjson11_serializeDocumentEndpointRequest(v.PublicEndpoint, ok); err != nil {
return err
}
}
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateContainerServiceInput(v *CreateContainerServiceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Deployment != nil {
ok := object.Key("deployment")
if err := awsAwsjson11_serializeDocumentContainerServiceDeploymentRequest(v.Deployment, ok); err != nil {
return err
}
}
if len(v.Power) > 0 {
ok := object.Key("power")
ok.String(string(v.Power))
}
if v.PrivateRegistryAccess != nil {
ok := object.Key("privateRegistryAccess")
if err := awsAwsjson11_serializeDocumentPrivateRegistryAccessRequest(v.PrivateRegistryAccess, ok); err != nil {
return err
}
}
if v.PublicDomainNames != nil {
ok := object.Key("publicDomainNames")
if err := awsAwsjson11_serializeDocumentContainerServicePublicDomains(v.PublicDomainNames, ok); err != nil {
return err
}
}
if v.Scale != nil {
ok := object.Key("scale")
ok.Integer(*v.Scale)
}
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateContainerServiceRegistryLoginInput(v *CreateContainerServiceRegistryLoginInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentCreateDiskFromSnapshotInput(v *CreateDiskFromSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AddOns != nil {
ok := object.Key("addOns")
if err := awsAwsjson11_serializeDocumentAddOnRequestList(v.AddOns, ok); err != nil {
return err
}
}
if v.AvailabilityZone != nil {
ok := object.Key("availabilityZone")
ok.String(*v.AvailabilityZone)
}
if v.DiskName != nil {
ok := object.Key("diskName")
ok.String(*v.DiskName)
}
if v.DiskSnapshotName != nil {
ok := object.Key("diskSnapshotName")
ok.String(*v.DiskSnapshotName)
}
if v.RestoreDate != nil {
ok := object.Key("restoreDate")
ok.String(*v.RestoreDate)
}
if v.SizeInGb != nil {
ok := object.Key("sizeInGb")
ok.Integer(*v.SizeInGb)
}
if v.SourceDiskName != nil {
ok := object.Key("sourceDiskName")
ok.String(*v.SourceDiskName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.UseLatestRestorableAutoSnapshot != nil {
ok := object.Key("useLatestRestorableAutoSnapshot")
ok.Boolean(*v.UseLatestRestorableAutoSnapshot)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateDiskInput(v *CreateDiskInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AddOns != nil {
ok := object.Key("addOns")
if err := awsAwsjson11_serializeDocumentAddOnRequestList(v.AddOns, ok); err != nil {
return err
}
}
if v.AvailabilityZone != nil {
ok := object.Key("availabilityZone")
ok.String(*v.AvailabilityZone)
}
if v.DiskName != nil {
ok := object.Key("diskName")
ok.String(*v.DiskName)
}
if v.SizeInGb != nil {
ok := object.Key("sizeInGb")
ok.Integer(*v.SizeInGb)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateDiskSnapshotInput(v *CreateDiskSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskName != nil {
ok := object.Key("diskName")
ok.String(*v.DiskName)
}
if v.DiskSnapshotName != nil {
ok := object.Key("diskSnapshotName")
ok.String(*v.DiskSnapshotName)
}
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateDistributionInput(v *CreateDistributionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BundleId != nil {
ok := object.Key("bundleId")
ok.String(*v.BundleId)
}
if v.CacheBehaviors != nil {
ok := object.Key("cacheBehaviors")
if err := awsAwsjson11_serializeDocumentCacheBehaviorList(v.CacheBehaviors, ok); err != nil {
return err
}
}
if v.CacheBehaviorSettings != nil {
ok := object.Key("cacheBehaviorSettings")
if err := awsAwsjson11_serializeDocumentCacheSettings(v.CacheBehaviorSettings, ok); err != nil {
return err
}
}
if v.DefaultCacheBehavior != nil {
ok := object.Key("defaultCacheBehavior")
if err := awsAwsjson11_serializeDocumentCacheBehavior(v.DefaultCacheBehavior, ok); err != nil {
return err
}
}
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
if len(v.IpAddressType) > 0 {
ok := object.Key("ipAddressType")
ok.String(string(v.IpAddressType))
}
if v.Origin != nil {
ok := object.Key("origin")
if err := awsAwsjson11_serializeDocumentInputOrigin(v.Origin, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateDomainEntryInput(v *CreateDomainEntryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DomainEntry != nil {
ok := object.Key("domainEntry")
if err := awsAwsjson11_serializeDocumentDomainEntry(v.DomainEntry, ok); err != nil {
return err
}
}
if v.DomainName != nil {
ok := object.Key("domainName")
ok.String(*v.DomainName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateDomainInput(v *CreateDomainInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DomainName != nil {
ok := object.Key("domainName")
ok.String(*v.DomainName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateGUISessionAccessDetailsInput(v *CreateGUISessionAccessDetailsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateInstancesFromSnapshotInput(v *CreateInstancesFromSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AddOns != nil {
ok := object.Key("addOns")
if err := awsAwsjson11_serializeDocumentAddOnRequestList(v.AddOns, ok); err != nil {
return err
}
}
if v.AttachedDiskMapping != nil {
ok := object.Key("attachedDiskMapping")
if err := awsAwsjson11_serializeDocumentAttachedDiskMap(v.AttachedDiskMapping, ok); err != nil {
return err
}
}
if v.AvailabilityZone != nil {
ok := object.Key("availabilityZone")
ok.String(*v.AvailabilityZone)
}
if v.BundleId != nil {
ok := object.Key("bundleId")
ok.String(*v.BundleId)
}
if v.InstanceNames != nil {
ok := object.Key("instanceNames")
if err := awsAwsjson11_serializeDocumentStringList(v.InstanceNames, ok); err != nil {
return err
}
}
if v.InstanceSnapshotName != nil {
ok := object.Key("instanceSnapshotName")
ok.String(*v.InstanceSnapshotName)
}
if len(v.IpAddressType) > 0 {
ok := object.Key("ipAddressType")
ok.String(string(v.IpAddressType))
}
if v.KeyPairName != nil {
ok := object.Key("keyPairName")
ok.String(*v.KeyPairName)
}
if v.RestoreDate != nil {
ok := object.Key("restoreDate")
ok.String(*v.RestoreDate)
}
if v.SourceInstanceName != nil {
ok := object.Key("sourceInstanceName")
ok.String(*v.SourceInstanceName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.UseLatestRestorableAutoSnapshot != nil {
ok := object.Key("useLatestRestorableAutoSnapshot")
ok.Boolean(*v.UseLatestRestorableAutoSnapshot)
}
if v.UserData != nil {
ok := object.Key("userData")
ok.String(*v.UserData)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateInstancesInput(v *CreateInstancesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AddOns != nil {
ok := object.Key("addOns")
if err := awsAwsjson11_serializeDocumentAddOnRequestList(v.AddOns, ok); err != nil {
return err
}
}
if v.AvailabilityZone != nil {
ok := object.Key("availabilityZone")
ok.String(*v.AvailabilityZone)
}
if v.BlueprintId != nil {
ok := object.Key("blueprintId")
ok.String(*v.BlueprintId)
}
if v.BundleId != nil {
ok := object.Key("bundleId")
ok.String(*v.BundleId)
}
if v.CustomImageName != nil {
ok := object.Key("customImageName")
ok.String(*v.CustomImageName)
}
if v.InstanceNames != nil {
ok := object.Key("instanceNames")
if err := awsAwsjson11_serializeDocumentStringList(v.InstanceNames, ok); err != nil {
return err
}
}
if len(v.IpAddressType) > 0 {
ok := object.Key("ipAddressType")
ok.String(string(v.IpAddressType))
}
if v.KeyPairName != nil {
ok := object.Key("keyPairName")
ok.String(*v.KeyPairName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.UserData != nil {
ok := object.Key("userData")
ok.String(*v.UserData)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateInstanceSnapshotInput(v *CreateInstanceSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
if v.InstanceSnapshotName != nil {
ok := object.Key("instanceSnapshotName")
ok.String(*v.InstanceSnapshotName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateKeyPairInput(v *CreateKeyPairInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KeyPairName != nil {
ok := object.Key("keyPairName")
ok.String(*v.KeyPairName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateLoadBalancerInput(v *CreateLoadBalancerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateAlternativeNames != nil {
ok := object.Key("certificateAlternativeNames")
if err := awsAwsjson11_serializeDocumentDomainNameList(v.CertificateAlternativeNames, ok); err != nil {
return err
}
}
if v.CertificateDomainName != nil {
ok := object.Key("certificateDomainName")
ok.String(*v.CertificateDomainName)
}
if v.CertificateName != nil {
ok := object.Key("certificateName")
ok.String(*v.CertificateName)
}
if v.HealthCheckPath != nil {
ok := object.Key("healthCheckPath")
ok.String(*v.HealthCheckPath)
}
{
ok := object.Key("instancePort")
ok.Integer(v.InstancePort)
}
if len(v.IpAddressType) > 0 {
ok := object.Key("ipAddressType")
ok.String(string(v.IpAddressType))
}
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.TlsPolicyName != nil {
ok := object.Key("tlsPolicyName")
ok.String(*v.TlsPolicyName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateLoadBalancerTlsCertificateInput(v *CreateLoadBalancerTlsCertificateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateAlternativeNames != nil {
ok := object.Key("certificateAlternativeNames")
if err := awsAwsjson11_serializeDocumentDomainNameList(v.CertificateAlternativeNames, ok); err != nil {
return err
}
}
if v.CertificateDomainName != nil {
ok := object.Key("certificateDomainName")
ok.String(*v.CertificateDomainName)
}
if v.CertificateName != nil {
ok := object.Key("certificateName")
ok.String(*v.CertificateName)
}
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRelationalDatabaseFromSnapshotInput(v *CreateRelationalDatabaseFromSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AvailabilityZone != nil {
ok := object.Key("availabilityZone")
ok.String(*v.AvailabilityZone)
}
if v.PubliclyAccessible != nil {
ok := object.Key("publiclyAccessible")
ok.Boolean(*v.PubliclyAccessible)
}
if v.RelationalDatabaseBundleId != nil {
ok := object.Key("relationalDatabaseBundleId")
ok.String(*v.RelationalDatabaseBundleId)
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
if v.RelationalDatabaseSnapshotName != nil {
ok := object.Key("relationalDatabaseSnapshotName")
ok.String(*v.RelationalDatabaseSnapshotName)
}
if v.RestoreTime != nil {
ok := object.Key("restoreTime")
ok.Double(smithytime.FormatEpochSeconds(*v.RestoreTime))
}
if v.SourceRelationalDatabaseName != nil {
ok := object.Key("sourceRelationalDatabaseName")
ok.String(*v.SourceRelationalDatabaseName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.UseLatestRestorableTime != nil {
ok := object.Key("useLatestRestorableTime")
ok.Boolean(*v.UseLatestRestorableTime)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRelationalDatabaseInput(v *CreateRelationalDatabaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AvailabilityZone != nil {
ok := object.Key("availabilityZone")
ok.String(*v.AvailabilityZone)
}
if v.MasterDatabaseName != nil {
ok := object.Key("masterDatabaseName")
ok.String(*v.MasterDatabaseName)
}
if v.MasterUsername != nil {
ok := object.Key("masterUsername")
ok.String(*v.MasterUsername)
}
if v.MasterUserPassword != nil {
ok := object.Key("masterUserPassword")
ok.String(*v.MasterUserPassword)
}
if v.PreferredBackupWindow != nil {
ok := object.Key("preferredBackupWindow")
ok.String(*v.PreferredBackupWindow)
}
if v.PreferredMaintenanceWindow != nil {
ok := object.Key("preferredMaintenanceWindow")
ok.String(*v.PreferredMaintenanceWindow)
}
if v.PubliclyAccessible != nil {
ok := object.Key("publiclyAccessible")
ok.Boolean(*v.PubliclyAccessible)
}
if v.RelationalDatabaseBlueprintId != nil {
ok := object.Key("relationalDatabaseBlueprintId")
ok.String(*v.RelationalDatabaseBlueprintId)
}
if v.RelationalDatabaseBundleId != nil {
ok := object.Key("relationalDatabaseBundleId")
ok.String(*v.RelationalDatabaseBundleId)
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateRelationalDatabaseSnapshotInput(v *CreateRelationalDatabaseSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
if v.RelationalDatabaseSnapshotName != nil {
ok := object.Key("relationalDatabaseSnapshotName")
ok.String(*v.RelationalDatabaseSnapshotName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteAlarmInput(v *DeleteAlarmInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AlarmName != nil {
ok := object.Key("alarmName")
ok.String(*v.AlarmName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteAutoSnapshotInput(v *DeleteAutoSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Date != nil {
ok := object.Key("date")
ok.String(*v.Date)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteBucketAccessKeyInput(v *DeleteBucketAccessKeyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessKeyId != nil {
ok := object.Key("accessKeyId")
ok.String(*v.AccessKeyId)
}
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteBucketInput(v *DeleteBucketInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.ForceDelete != nil {
ok := object.Key("forceDelete")
ok.Boolean(*v.ForceDelete)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteCertificateInput(v *DeleteCertificateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateName != nil {
ok := object.Key("certificateName")
ok.String(*v.CertificateName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteContactMethodInput(v *DeleteContactMethodInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Protocol) > 0 {
ok := object.Key("protocol")
ok.String(string(v.Protocol))
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteContainerImageInput(v *DeleteContainerImageInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Image != nil {
ok := object.Key("image")
ok.String(*v.Image)
}
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteContainerServiceInput(v *DeleteContainerServiceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteDiskInput(v *DeleteDiskInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskName != nil {
ok := object.Key("diskName")
ok.String(*v.DiskName)
}
if v.ForceDeleteAddOns != nil {
ok := object.Key("forceDeleteAddOns")
ok.Boolean(*v.ForceDeleteAddOns)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteDiskSnapshotInput(v *DeleteDiskSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskSnapshotName != nil {
ok := object.Key("diskSnapshotName")
ok.String(*v.DiskSnapshotName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteDistributionInput(v *DeleteDistributionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteDomainEntryInput(v *DeleteDomainEntryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DomainEntry != nil {
ok := object.Key("domainEntry")
if err := awsAwsjson11_serializeDocumentDomainEntry(v.DomainEntry, ok); err != nil {
return err
}
}
if v.DomainName != nil {
ok := object.Key("domainName")
ok.String(*v.DomainName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteDomainInput(v *DeleteDomainInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DomainName != nil {
ok := object.Key("domainName")
ok.String(*v.DomainName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteInstanceInput(v *DeleteInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ForceDeleteAddOns != nil {
ok := object.Key("forceDeleteAddOns")
ok.Boolean(*v.ForceDeleteAddOns)
}
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteInstanceSnapshotInput(v *DeleteInstanceSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceSnapshotName != nil {
ok := object.Key("instanceSnapshotName")
ok.String(*v.InstanceSnapshotName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteKeyPairInput(v *DeleteKeyPairInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExpectedFingerprint != nil {
ok := object.Key("expectedFingerprint")
ok.String(*v.ExpectedFingerprint)
}
if v.KeyPairName != nil {
ok := object.Key("keyPairName")
ok.String(*v.KeyPairName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteKnownHostKeysInput(v *DeleteKnownHostKeysInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteLoadBalancerInput(v *DeleteLoadBalancerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteLoadBalancerTlsCertificateInput(v *DeleteLoadBalancerTlsCertificateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateName != nil {
ok := object.Key("certificateName")
ok.String(*v.CertificateName)
}
if v.Force != nil {
ok := object.Key("force")
ok.Boolean(*v.Force)
}
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteRelationalDatabaseInput(v *DeleteRelationalDatabaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FinalRelationalDatabaseSnapshotName != nil {
ok := object.Key("finalRelationalDatabaseSnapshotName")
ok.String(*v.FinalRelationalDatabaseSnapshotName)
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
if v.SkipFinalSnapshot != nil {
ok := object.Key("skipFinalSnapshot")
ok.Boolean(*v.SkipFinalSnapshot)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteRelationalDatabaseSnapshotInput(v *DeleteRelationalDatabaseSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RelationalDatabaseSnapshotName != nil {
ok := object.Key("relationalDatabaseSnapshotName")
ok.String(*v.RelationalDatabaseSnapshotName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetachCertificateFromDistributionInput(v *DetachCertificateFromDistributionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetachDiskInput(v *DetachDiskInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskName != nil {
ok := object.Key("diskName")
ok.String(*v.DiskName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetachInstancesFromLoadBalancerInput(v *DetachInstancesFromLoadBalancerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceNames != nil {
ok := object.Key("instanceNames")
if err := awsAwsjson11_serializeDocumentResourceNameList(v.InstanceNames, ok); err != nil {
return err
}
}
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDetachStaticIpInput(v *DetachStaticIpInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StaticIpName != nil {
ok := object.Key("staticIpName")
ok.String(*v.StaticIpName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDisableAddOnInput(v *DisableAddOnInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AddOnType) > 0 {
ok := object.Key("addOnType")
ok.String(string(v.AddOnType))
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDownloadDefaultKeyPairInput(v *DownloadDefaultKeyPairInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentEnableAddOnInput(v *EnableAddOnInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AddOnRequest != nil {
ok := object.Key("addOnRequest")
if err := awsAwsjson11_serializeDocumentAddOnRequest(v.AddOnRequest, ok); err != nil {
return err
}
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentExportSnapshotInput(v *ExportSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SourceSnapshotName != nil {
ok := object.Key("sourceSnapshotName")
ok.String(*v.SourceSnapshotName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetActiveNamesInput(v *GetActiveNamesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetAlarmsInput(v *GetAlarmsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AlarmName != nil {
ok := object.Key("alarmName")
ok.String(*v.AlarmName)
}
if v.MonitoredResourceName != nil {
ok := object.Key("monitoredResourceName")
ok.String(*v.MonitoredResourceName)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetAutoSnapshotsInput(v *GetAutoSnapshotsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetBlueprintsInput(v *GetBlueprintsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AppCategory) > 0 {
ok := object.Key("appCategory")
ok.String(string(v.AppCategory))
}
if v.IncludeInactive != nil {
ok := object.Key("includeInactive")
ok.Boolean(*v.IncludeInactive)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetBucketAccessKeysInput(v *GetBucketAccessKeysInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetBucketBundlesInput(v *GetBucketBundlesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IncludeInactive != nil {
ok := object.Key("includeInactive")
ok.Boolean(*v.IncludeInactive)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetBucketMetricDataInput(v *GetBucketMetricDataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
{
ok := object.Key("period")
ok.Integer(v.Period)
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
if v.Statistics != nil {
ok := object.Key("statistics")
if err := awsAwsjson11_serializeDocumentMetricStatisticList(v.Statistics, ok); err != nil {
return err
}
}
if len(v.Unit) > 0 {
ok := object.Key("unit")
ok.String(string(v.Unit))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetBucketsInput(v *GetBucketsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.IncludeConnectedResources != nil {
ok := object.Key("includeConnectedResources")
ok.Boolean(*v.IncludeConnectedResources)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetBundlesInput(v *GetBundlesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AppCategory) > 0 {
ok := object.Key("appCategory")
ok.String(string(v.AppCategory))
}
if v.IncludeInactive != nil {
ok := object.Key("includeInactive")
ok.Boolean(*v.IncludeInactive)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetCertificatesInput(v *GetCertificatesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateName != nil {
ok := object.Key("certificateName")
ok.String(*v.CertificateName)
}
if v.CertificateStatuses != nil {
ok := object.Key("certificateStatuses")
if err := awsAwsjson11_serializeDocumentCertificateStatusList(v.CertificateStatuses, ok); err != nil {
return err
}
}
if v.IncludeCertificateDetails {
ok := object.Key("includeCertificateDetails")
ok.Boolean(v.IncludeCertificateDetails)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetCloudFormationStackRecordsInput(v *GetCloudFormationStackRecordsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetContactMethodsInput(v *GetContactMethodsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Protocols != nil {
ok := object.Key("protocols")
if err := awsAwsjson11_serializeDocumentContactProtocolsList(v.Protocols, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetContainerAPIMetadataInput(v *GetContainerAPIMetadataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentGetContainerImagesInput(v *GetContainerImagesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetContainerLogInput(v *GetContainerLogInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("containerName")
ok.String(*v.ContainerName)
}
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if v.FilterPattern != nil {
ok := object.Key("filterPattern")
ok.String(*v.FilterPattern)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetContainerServiceDeploymentsInput(v *GetContainerServiceDeploymentsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetContainerServiceMetricDataInput(v *GetContainerServiceMetricDataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
{
ok := object.Key("period")
ok.Integer(v.Period)
}
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
if v.Statistics != nil {
ok := object.Key("statistics")
if err := awsAwsjson11_serializeDocumentMetricStatisticList(v.Statistics, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetContainerServicePowersInput(v *GetContainerServicePowersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentGetContainerServicesInput(v *GetContainerServicesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetCostEstimateInput(v *GetCostEstimateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDiskInput(v *GetDiskInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskName != nil {
ok := object.Key("diskName")
ok.String(*v.DiskName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDisksInput(v *GetDisksInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDiskSnapshotInput(v *GetDiskSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DiskSnapshotName != nil {
ok := object.Key("diskSnapshotName")
ok.String(*v.DiskSnapshotName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDiskSnapshotsInput(v *GetDiskSnapshotsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDistributionBundlesInput(v *GetDistributionBundlesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentGetDistributionLatestCacheResetInput(v *GetDistributionLatestCacheResetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDistributionMetricDataInput(v *GetDistributionMetricDataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
{
ok := object.Key("period")
ok.Integer(v.Period)
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
if v.Statistics != nil {
ok := object.Key("statistics")
if err := awsAwsjson11_serializeDocumentMetricStatisticList(v.Statistics, ok); err != nil {
return err
}
}
if len(v.Unit) > 0 {
ok := object.Key("unit")
ok.String(string(v.Unit))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDistributionsInput(v *GetDistributionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDomainInput(v *GetDomainInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DomainName != nil {
ok := object.Key("domainName")
ok.String(*v.DomainName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetDomainsInput(v *GetDomainsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetExportSnapshotRecordsInput(v *GetExportSnapshotRecordsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetInstanceAccessDetailsInput(v *GetInstanceAccessDetailsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
if len(v.Protocol) > 0 {
ok := object.Key("protocol")
ok.String(string(v.Protocol))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetInstanceInput(v *GetInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetInstanceMetricDataInput(v *GetInstanceMetricDataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
{
ok := object.Key("period")
ok.Integer(v.Period)
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
if v.Statistics != nil {
ok := object.Key("statistics")
if err := awsAwsjson11_serializeDocumentMetricStatisticList(v.Statistics, ok); err != nil {
return err
}
}
if len(v.Unit) > 0 {
ok := object.Key("unit")
ok.String(string(v.Unit))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetInstancePortStatesInput(v *GetInstancePortStatesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetInstancesInput(v *GetInstancesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetInstanceSnapshotInput(v *GetInstanceSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceSnapshotName != nil {
ok := object.Key("instanceSnapshotName")
ok.String(*v.InstanceSnapshotName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetInstanceSnapshotsInput(v *GetInstanceSnapshotsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetInstanceStateInput(v *GetInstanceStateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetKeyPairInput(v *GetKeyPairInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KeyPairName != nil {
ok := object.Key("keyPairName")
ok.String(*v.KeyPairName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetKeyPairsInput(v *GetKeyPairsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IncludeDefaultKeyPair != nil {
ok := object.Key("includeDefaultKeyPair")
ok.Boolean(*v.IncludeDefaultKeyPair)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLoadBalancerInput(v *GetLoadBalancerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLoadBalancerMetricDataInput(v *GetLoadBalancerMetricDataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
{
ok := object.Key("period")
ok.Integer(v.Period)
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
if v.Statistics != nil {
ok := object.Key("statistics")
if err := awsAwsjson11_serializeDocumentMetricStatisticList(v.Statistics, ok); err != nil {
return err
}
}
if len(v.Unit) > 0 {
ok := object.Key("unit")
ok.String(string(v.Unit))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLoadBalancersInput(v *GetLoadBalancersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLoadBalancerTlsCertificatesInput(v *GetLoadBalancerTlsCertificatesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLoadBalancerTlsPoliciesInput(v *GetLoadBalancerTlsPoliciesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetOperationInput(v *GetOperationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.OperationId != nil {
ok := object.Key("operationId")
ok.String(*v.OperationId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetOperationsForResourceInput(v *GetOperationsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetOperationsInput(v *GetOperationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRegionsInput(v *GetRegionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IncludeAvailabilityZones != nil {
ok := object.Key("includeAvailabilityZones")
ok.Boolean(*v.IncludeAvailabilityZones)
}
if v.IncludeRelationalDatabaseAvailabilityZones != nil {
ok := object.Key("includeRelationalDatabaseAvailabilityZones")
ok.Boolean(*v.IncludeRelationalDatabaseAvailabilityZones)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseBlueprintsInput(v *GetRelationalDatabaseBlueprintsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseBundlesInput(v *GetRelationalDatabaseBundlesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IncludeInactive != nil {
ok := object.Key("includeInactive")
ok.Boolean(*v.IncludeInactive)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseEventsInput(v *GetRelationalDatabaseEventsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DurationInMinutes != nil {
ok := object.Key("durationInMinutes")
ok.Integer(*v.DurationInMinutes)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseInput(v *GetRelationalDatabaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseLogEventsInput(v *GetRelationalDatabaseLogEventsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if v.LogStreamName != nil {
ok := object.Key("logStreamName")
ok.String(*v.LogStreamName)
}
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
if v.StartFromHead != nil {
ok := object.Key("startFromHead")
ok.Boolean(*v.StartFromHead)
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseLogStreamsInput(v *GetRelationalDatabaseLogStreamsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseMasterUserPasswordInput(v *GetRelationalDatabaseMasterUserPasswordInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.PasswordVersion) > 0 {
ok := object.Key("passwordVersion")
ok.String(string(v.PasswordVersion))
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseMetricDataInput(v *GetRelationalDatabaseMetricDataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTime != nil {
ok := object.Key("endTime")
ok.Double(smithytime.FormatEpochSeconds(*v.EndTime))
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
{
ok := object.Key("period")
ok.Integer(v.Period)
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
if v.Statistics != nil {
ok := object.Key("statistics")
if err := awsAwsjson11_serializeDocumentMetricStatisticList(v.Statistics, ok); err != nil {
return err
}
}
if len(v.Unit) > 0 {
ok := object.Key("unit")
ok.String(string(v.Unit))
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseParametersInput(v *GetRelationalDatabaseParametersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabasesInput(v *GetRelationalDatabasesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseSnapshotInput(v *GetRelationalDatabaseSnapshotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RelationalDatabaseSnapshotName != nil {
ok := object.Key("relationalDatabaseSnapshotName")
ok.String(*v.RelationalDatabaseSnapshotName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRelationalDatabaseSnapshotsInput(v *GetRelationalDatabaseSnapshotsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetStaticIpInput(v *GetStaticIpInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StaticIpName != nil {
ok := object.Key("staticIpName")
ok.String(*v.StaticIpName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetStaticIpsInput(v *GetStaticIpsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PageToken != nil {
ok := object.Key("pageToken")
ok.String(*v.PageToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentImportKeyPairInput(v *ImportKeyPairInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KeyPairName != nil {
ok := object.Key("keyPairName")
ok.String(*v.KeyPairName)
}
if v.PublicKeyBase64 != nil {
ok := object.Key("publicKeyBase64")
ok.String(*v.PublicKeyBase64)
}
return nil
}
func awsAwsjson11_serializeOpDocumentIsVpcPeeredInput(v *IsVpcPeeredInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentOpenInstancePublicPortsInput(v *OpenInstancePublicPortsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
if v.PortInfo != nil {
ok := object.Key("portInfo")
if err := awsAwsjson11_serializeDocumentPortInfo(v.PortInfo, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentPeerVpcInput(v *PeerVpcInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentPutAlarmInput(v *PutAlarmInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AlarmName != nil {
ok := object.Key("alarmName")
ok.String(*v.AlarmName)
}
if len(v.ComparisonOperator) > 0 {
ok := object.Key("comparisonOperator")
ok.String(string(v.ComparisonOperator))
}
if v.ContactProtocols != nil {
ok := object.Key("contactProtocols")
if err := awsAwsjson11_serializeDocumentContactProtocolsList(v.ContactProtocols, ok); err != nil {
return err
}
}
if v.DatapointsToAlarm != nil {
ok := object.Key("datapointsToAlarm")
ok.Integer(*v.DatapointsToAlarm)
}
if v.EvaluationPeriods != nil {
ok := object.Key("evaluationPeriods")
ok.Integer(*v.EvaluationPeriods)
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
if v.MonitoredResourceName != nil {
ok := object.Key("monitoredResourceName")
ok.String(*v.MonitoredResourceName)
}
if v.NotificationEnabled != nil {
ok := object.Key("notificationEnabled")
ok.Boolean(*v.NotificationEnabled)
}
if v.NotificationTriggers != nil {
ok := object.Key("notificationTriggers")
if err := awsAwsjson11_serializeDocumentNotificationTriggerList(v.NotificationTriggers, ok); err != nil {
return err
}
}
if v.Threshold != nil {
ok := object.Key("threshold")
switch {
case math.IsNaN(*v.Threshold):
ok.String("NaN")
case math.IsInf(*v.Threshold, 1):
ok.String("Infinity")
case math.IsInf(*v.Threshold, -1):
ok.String("-Infinity")
default:
ok.Double(*v.Threshold)
}
}
if len(v.TreatMissingData) > 0 {
ok := object.Key("treatMissingData")
ok.String(string(v.TreatMissingData))
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutInstancePublicPortsInput(v *PutInstancePublicPortsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
if v.PortInfos != nil {
ok := object.Key("portInfos")
if err := awsAwsjson11_serializeDocumentPortInfoList(v.PortInfos, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentRebootInstanceInput(v *RebootInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRebootRelationalDatabaseInput(v *RebootRelationalDatabaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRegisterContainerImageInput(v *RegisterContainerImageInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Digest != nil {
ok := object.Key("digest")
ok.String(*v.Digest)
}
if v.Label != nil {
ok := object.Key("label")
ok.String(*v.Label)
}
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentReleaseStaticIpInput(v *ReleaseStaticIpInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StaticIpName != nil {
ok := object.Key("staticIpName")
ok.String(*v.StaticIpName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentResetDistributionCacheInput(v *ResetDistributionCacheInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSendContactMethodVerificationInput(v *SendContactMethodVerificationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Protocol) > 0 {
ok := object.Key("protocol")
ok.String(string(v.Protocol))
}
return nil
}
func awsAwsjson11_serializeOpDocumentSetIpAddressTypeInput(v *SetIpAddressTypeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.IpAddressType) > 0 {
ok := object.Key("ipAddressType")
ok.String(string(v.IpAddressType))
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
if len(v.ResourceType) > 0 {
ok := object.Key("resourceType")
ok.String(string(v.ResourceType))
}
return nil
}
func awsAwsjson11_serializeOpDocumentSetResourceAccessForBucketInput(v *SetResourceAccessForBucketInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Access) > 0 {
ok := object.Key("access")
ok.String(string(v.Access))
}
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartGUISessionInput(v *StartGUISessionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartInstanceInput(v *StartInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartRelationalDatabaseInput(v *StartRelationalDatabaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopGUISessionInput(v *StopGUISessionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopInstanceInput(v *StopInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Force != nil {
ok := object.Key("force")
ok.Boolean(*v.Force)
}
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopRelationalDatabaseInput(v *StopRelationalDatabaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
if v.RelationalDatabaseSnapshotName != nil {
ok := object.Key("relationalDatabaseSnapshotName")
ok.String(*v.RelationalDatabaseSnapshotName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("resourceArn")
ok.String(*v.ResourceArn)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentTestAlarmInput(v *TestAlarmInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AlarmName != nil {
ok := object.Key("alarmName")
ok.String(*v.AlarmName)
}
if len(v.State) > 0 {
ok := object.Key("state")
ok.String(string(v.State))
}
return nil
}
func awsAwsjson11_serializeOpDocumentUnpeerVpcInput(v *UnpeerVpcInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("resourceArn")
ok.String(*v.ResourceArn)
}
if v.ResourceName != nil {
ok := object.Key("resourceName")
ok.String(*v.ResourceName)
}
if v.TagKeys != nil {
ok := object.Key("tagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateBucketBundleInput(v *UpdateBucketBundleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.BundleId != nil {
ok := object.Key("bundleId")
ok.String(*v.BundleId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateBucketInput(v *UpdateBucketInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessLogConfig != nil {
ok := object.Key("accessLogConfig")
if err := awsAwsjson11_serializeDocumentBucketAccessLogConfig(v.AccessLogConfig, ok); err != nil {
return err
}
}
if v.AccessRules != nil {
ok := object.Key("accessRules")
if err := awsAwsjson11_serializeDocumentAccessRules(v.AccessRules, ok); err != nil {
return err
}
}
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.ReadonlyAccessAccounts != nil {
ok := object.Key("readonlyAccessAccounts")
if err := awsAwsjson11_serializeDocumentPartnerIdList(v.ReadonlyAccessAccounts, ok); err != nil {
return err
}
}
if v.Versioning != nil {
ok := object.Key("versioning")
ok.String(*v.Versioning)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateContainerServiceInput(v *UpdateContainerServiceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IsDisabled != nil {
ok := object.Key("isDisabled")
ok.Boolean(*v.IsDisabled)
}
if len(v.Power) > 0 {
ok := object.Key("power")
ok.String(string(v.Power))
}
if v.PrivateRegistryAccess != nil {
ok := object.Key("privateRegistryAccess")
if err := awsAwsjson11_serializeDocumentPrivateRegistryAccessRequest(v.PrivateRegistryAccess, ok); err != nil {
return err
}
}
if v.PublicDomainNames != nil {
ok := object.Key("publicDomainNames")
if err := awsAwsjson11_serializeDocumentContainerServicePublicDomains(v.PublicDomainNames, ok); err != nil {
return err
}
}
if v.Scale != nil {
ok := object.Key("scale")
ok.Integer(*v.Scale)
}
if v.ServiceName != nil {
ok := object.Key("serviceName")
ok.String(*v.ServiceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateDistributionBundleInput(v *UpdateDistributionBundleInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BundleId != nil {
ok := object.Key("bundleId")
ok.String(*v.BundleId)
}
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateDistributionInput(v *UpdateDistributionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CacheBehaviors != nil {
ok := object.Key("cacheBehaviors")
if err := awsAwsjson11_serializeDocumentCacheBehaviorList(v.CacheBehaviors, ok); err != nil {
return err
}
}
if v.CacheBehaviorSettings != nil {
ok := object.Key("cacheBehaviorSettings")
if err := awsAwsjson11_serializeDocumentCacheSettings(v.CacheBehaviorSettings, ok); err != nil {
return err
}
}
if v.DefaultCacheBehavior != nil {
ok := object.Key("defaultCacheBehavior")
if err := awsAwsjson11_serializeDocumentCacheBehavior(v.DefaultCacheBehavior, ok); err != nil {
return err
}
}
if v.DistributionName != nil {
ok := object.Key("distributionName")
ok.String(*v.DistributionName)
}
if v.IsEnabled != nil {
ok := object.Key("isEnabled")
ok.Boolean(*v.IsEnabled)
}
if v.Origin != nil {
ok := object.Key("origin")
if err := awsAwsjson11_serializeDocumentInputOrigin(v.Origin, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateDomainEntryInput(v *UpdateDomainEntryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DomainEntry != nil {
ok := object.Key("domainEntry")
if err := awsAwsjson11_serializeDocumentDomainEntry(v.DomainEntry, ok); err != nil {
return err
}
}
if v.DomainName != nil {
ok := object.Key("domainName")
ok.String(*v.DomainName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateInstanceMetadataOptionsInput(v *UpdateInstanceMetadataOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.HttpEndpoint) > 0 {
ok := object.Key("httpEndpoint")
ok.String(string(v.HttpEndpoint))
}
if len(v.HttpProtocolIpv6) > 0 {
ok := object.Key("httpProtocolIpv6")
ok.String(string(v.HttpProtocolIpv6))
}
if v.HttpPutResponseHopLimit != nil {
ok := object.Key("httpPutResponseHopLimit")
ok.Integer(*v.HttpPutResponseHopLimit)
}
if len(v.HttpTokens) > 0 {
ok := object.Key("httpTokens")
ok.String(string(v.HttpTokens))
}
if v.InstanceName != nil {
ok := object.Key("instanceName")
ok.String(*v.InstanceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateLoadBalancerAttributeInput(v *UpdateLoadBalancerAttributeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AttributeName) > 0 {
ok := object.Key("attributeName")
ok.String(string(v.AttributeName))
}
if v.AttributeValue != nil {
ok := object.Key("attributeValue")
ok.String(*v.AttributeValue)
}
if v.LoadBalancerName != nil {
ok := object.Key("loadBalancerName")
ok.String(*v.LoadBalancerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateRelationalDatabaseInput(v *UpdateRelationalDatabaseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplyImmediately != nil {
ok := object.Key("applyImmediately")
ok.Boolean(*v.ApplyImmediately)
}
if v.CaCertificateIdentifier != nil {
ok := object.Key("caCertificateIdentifier")
ok.String(*v.CaCertificateIdentifier)
}
if v.DisableBackupRetention != nil {
ok := object.Key("disableBackupRetention")
ok.Boolean(*v.DisableBackupRetention)
}
if v.EnableBackupRetention != nil {
ok := object.Key("enableBackupRetention")
ok.Boolean(*v.EnableBackupRetention)
}
if v.MasterUserPassword != nil {
ok := object.Key("masterUserPassword")
ok.String(*v.MasterUserPassword)
}
if v.PreferredBackupWindow != nil {
ok := object.Key("preferredBackupWindow")
ok.String(*v.PreferredBackupWindow)
}
if v.PreferredMaintenanceWindow != nil {
ok := object.Key("preferredMaintenanceWindow")
ok.String(*v.PreferredMaintenanceWindow)
}
if v.PubliclyAccessible != nil {
ok := object.Key("publiclyAccessible")
ok.Boolean(*v.PubliclyAccessible)
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
if v.RotateMasterUserPassword != nil {
ok := object.Key("rotateMasterUserPassword")
ok.Boolean(*v.RotateMasterUserPassword)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateRelationalDatabaseParametersInput(v *UpdateRelationalDatabaseParametersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Parameters != nil {
ok := object.Key("parameters")
if err := awsAwsjson11_serializeDocumentRelationalDatabaseParameterList(v.Parameters, ok); err != nil {
return err
}
}
if v.RelationalDatabaseName != nil {
ok := object.Key("relationalDatabaseName")
ok.String(*v.RelationalDatabaseName)
}
return nil
}
| 12,923 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lightsail
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lightsail/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAllocateStaticIp struct {
}
func (*validateOpAllocateStaticIp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAllocateStaticIp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AllocateStaticIpInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAllocateStaticIpInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAttachCertificateToDistribution struct {
}
func (*validateOpAttachCertificateToDistribution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAttachCertificateToDistribution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AttachCertificateToDistributionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAttachCertificateToDistributionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAttachDisk struct {
}
func (*validateOpAttachDisk) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAttachDisk) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AttachDiskInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAttachDiskInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAttachInstancesToLoadBalancer struct {
}
func (*validateOpAttachInstancesToLoadBalancer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAttachInstancesToLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AttachInstancesToLoadBalancerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAttachInstancesToLoadBalancerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAttachLoadBalancerTlsCertificate struct {
}
func (*validateOpAttachLoadBalancerTlsCertificate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAttachLoadBalancerTlsCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AttachLoadBalancerTlsCertificateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAttachLoadBalancerTlsCertificateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAttachStaticIp struct {
}
func (*validateOpAttachStaticIp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAttachStaticIp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AttachStaticIpInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAttachStaticIpInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCloseInstancePublicPorts struct {
}
func (*validateOpCloseInstancePublicPorts) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCloseInstancePublicPorts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CloseInstancePublicPortsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCloseInstancePublicPortsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCopySnapshot struct {
}
func (*validateOpCopySnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCopySnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CopySnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCopySnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateBucketAccessKey struct {
}
func (*validateOpCreateBucketAccessKey) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateBucketAccessKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateBucketAccessKeyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateBucketAccessKeyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateBucket struct {
}
func (*validateOpCreateBucket) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateBucket) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateBucketInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateBucketInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCertificate struct {
}
func (*validateOpCreateCertificate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCertificateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCertificateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCloudFormationStack struct {
}
func (*validateOpCreateCloudFormationStack) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCloudFormationStack) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCloudFormationStackInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCloudFormationStackInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateContactMethod struct {
}
func (*validateOpCreateContactMethod) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateContactMethod) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateContactMethodInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateContactMethodInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateContainerServiceDeployment struct {
}
func (*validateOpCreateContainerServiceDeployment) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateContainerServiceDeployment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateContainerServiceDeploymentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateContainerServiceDeploymentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateContainerService struct {
}
func (*validateOpCreateContainerService) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateContainerService) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateContainerServiceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateContainerServiceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDiskFromSnapshot struct {
}
func (*validateOpCreateDiskFromSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDiskFromSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDiskFromSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDiskFromSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDisk struct {
}
func (*validateOpCreateDisk) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDisk) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDiskInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDiskInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDiskSnapshot struct {
}
func (*validateOpCreateDiskSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDiskSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDiskSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDiskSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDistribution struct {
}
func (*validateOpCreateDistribution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDistribution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDistributionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDistributionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDomainEntry struct {
}
func (*validateOpCreateDomainEntry) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDomainEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDomainEntryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDomainEntryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDomain struct {
}
func (*validateOpCreateDomain) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDomainInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDomainInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateGUISessionAccessDetails struct {
}
func (*validateOpCreateGUISessionAccessDetails) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateGUISessionAccessDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateGUISessionAccessDetailsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateGUISessionAccessDetailsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateInstancesFromSnapshot struct {
}
func (*validateOpCreateInstancesFromSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateInstancesFromSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateInstancesFromSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateInstancesFromSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateInstances struct {
}
func (*validateOpCreateInstances) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateInstancesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateInstancesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateInstanceSnapshot struct {
}
func (*validateOpCreateInstanceSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateInstanceSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateInstanceSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateInstanceSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateKeyPair struct {
}
func (*validateOpCreateKeyPair) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateKeyPair) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateKeyPairInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateKeyPairInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateLoadBalancer struct {
}
func (*validateOpCreateLoadBalancer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateLoadBalancerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateLoadBalancerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateLoadBalancerTlsCertificate struct {
}
func (*validateOpCreateLoadBalancerTlsCertificate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateLoadBalancerTlsCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateLoadBalancerTlsCertificateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateLoadBalancerTlsCertificateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRelationalDatabaseFromSnapshot struct {
}
func (*validateOpCreateRelationalDatabaseFromSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRelationalDatabaseFromSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRelationalDatabaseFromSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRelationalDatabaseFromSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRelationalDatabase struct {
}
func (*validateOpCreateRelationalDatabase) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRelationalDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRelationalDatabaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRelationalDatabaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRelationalDatabaseSnapshot struct {
}
func (*validateOpCreateRelationalDatabaseSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRelationalDatabaseSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRelationalDatabaseSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRelationalDatabaseSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAlarm struct {
}
func (*validateOpDeleteAlarm) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAlarm) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAlarmInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAlarmInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAutoSnapshot struct {
}
func (*validateOpDeleteAutoSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAutoSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAutoSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAutoSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBucketAccessKey struct {
}
func (*validateOpDeleteBucketAccessKey) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBucketAccessKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBucketAccessKeyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBucketAccessKeyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBucket struct {
}
func (*validateOpDeleteBucket) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBucket) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBucketInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBucketInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteCertificate struct {
}
func (*validateOpDeleteCertificate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteCertificateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteCertificateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteContactMethod struct {
}
func (*validateOpDeleteContactMethod) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteContactMethod) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteContactMethodInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteContactMethodInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteContainerImage struct {
}
func (*validateOpDeleteContainerImage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteContainerImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteContainerImageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteContainerImageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteContainerService struct {
}
func (*validateOpDeleteContainerService) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteContainerService) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteContainerServiceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteContainerServiceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDisk struct {
}
func (*validateOpDeleteDisk) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDisk) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDiskInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDiskInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDiskSnapshot struct {
}
func (*validateOpDeleteDiskSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDiskSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDiskSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDiskSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDomainEntry struct {
}
func (*validateOpDeleteDomainEntry) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDomainEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDomainEntryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDomainEntryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDomain struct {
}
func (*validateOpDeleteDomain) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDomainInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDomainInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteInstance struct {
}
func (*validateOpDeleteInstance) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteInstanceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteInstanceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteInstanceSnapshot struct {
}
func (*validateOpDeleteInstanceSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteInstanceSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteInstanceSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteInstanceSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteKeyPair struct {
}
func (*validateOpDeleteKeyPair) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteKeyPair) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteKeyPairInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteKeyPairInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteKnownHostKeys struct {
}
func (*validateOpDeleteKnownHostKeys) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteKnownHostKeys) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteKnownHostKeysInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteKnownHostKeysInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLoadBalancer struct {
}
func (*validateOpDeleteLoadBalancer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLoadBalancerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLoadBalancerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLoadBalancerTlsCertificate struct {
}
func (*validateOpDeleteLoadBalancerTlsCertificate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLoadBalancerTlsCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLoadBalancerTlsCertificateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLoadBalancerTlsCertificateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRelationalDatabase struct {
}
func (*validateOpDeleteRelationalDatabase) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRelationalDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRelationalDatabaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRelationalDatabaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRelationalDatabaseSnapshot struct {
}
func (*validateOpDeleteRelationalDatabaseSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRelationalDatabaseSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRelationalDatabaseSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRelationalDatabaseSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetachCertificateFromDistribution struct {
}
func (*validateOpDetachCertificateFromDistribution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetachCertificateFromDistribution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetachCertificateFromDistributionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetachCertificateFromDistributionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetachDisk struct {
}
func (*validateOpDetachDisk) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetachDisk) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetachDiskInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetachDiskInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetachInstancesFromLoadBalancer struct {
}
func (*validateOpDetachInstancesFromLoadBalancer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetachInstancesFromLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetachInstancesFromLoadBalancerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetachInstancesFromLoadBalancerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDetachStaticIp struct {
}
func (*validateOpDetachStaticIp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDetachStaticIp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DetachStaticIpInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDetachStaticIpInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisableAddOn struct {
}
func (*validateOpDisableAddOn) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisableAddOn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisableAddOnInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisableAddOnInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpEnableAddOn struct {
}
func (*validateOpEnableAddOn) ID() string {
return "OperationInputValidation"
}
func (m *validateOpEnableAddOn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*EnableAddOnInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpEnableAddOnInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpExportSnapshot struct {
}
func (*validateOpExportSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpExportSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ExportSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpExportSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAutoSnapshots struct {
}
func (*validateOpGetAutoSnapshots) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAutoSnapshots) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAutoSnapshotsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAutoSnapshotsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBucketAccessKeys struct {
}
func (*validateOpGetBucketAccessKeys) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBucketAccessKeys) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBucketAccessKeysInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBucketAccessKeysInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBucketMetricData struct {
}
func (*validateOpGetBucketMetricData) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBucketMetricData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBucketMetricDataInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBucketMetricDataInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContainerImages struct {
}
func (*validateOpGetContainerImages) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContainerImages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContainerImagesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContainerImagesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContainerLog struct {
}
func (*validateOpGetContainerLog) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContainerLog) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContainerLogInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContainerLogInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContainerServiceDeployments struct {
}
func (*validateOpGetContainerServiceDeployments) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContainerServiceDeployments) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContainerServiceDeploymentsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContainerServiceDeploymentsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContainerServiceMetricData struct {
}
func (*validateOpGetContainerServiceMetricData) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContainerServiceMetricData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContainerServiceMetricDataInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContainerServiceMetricDataInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetCostEstimate struct {
}
func (*validateOpGetCostEstimate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetCostEstimate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetCostEstimateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetCostEstimateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDisk struct {
}
func (*validateOpGetDisk) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDisk) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDiskInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDiskInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDiskSnapshot struct {
}
func (*validateOpGetDiskSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDiskSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDiskSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDiskSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDistributionMetricData struct {
}
func (*validateOpGetDistributionMetricData) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDistributionMetricData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDistributionMetricDataInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDistributionMetricDataInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDomain struct {
}
func (*validateOpGetDomain) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDomainInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDomainInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetInstanceAccessDetails struct {
}
func (*validateOpGetInstanceAccessDetails) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetInstanceAccessDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetInstanceAccessDetailsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetInstanceAccessDetailsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetInstance struct {
}
func (*validateOpGetInstance) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetInstanceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetInstanceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetInstanceMetricData struct {
}
func (*validateOpGetInstanceMetricData) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetInstanceMetricData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetInstanceMetricDataInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetInstanceMetricDataInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetInstancePortStates struct {
}
func (*validateOpGetInstancePortStates) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetInstancePortStates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetInstancePortStatesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetInstancePortStatesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetInstanceSnapshot struct {
}
func (*validateOpGetInstanceSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetInstanceSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetInstanceSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetInstanceSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetInstanceState struct {
}
func (*validateOpGetInstanceState) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetInstanceState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetInstanceStateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetInstanceStateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetKeyPair struct {
}
func (*validateOpGetKeyPair) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetKeyPair) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetKeyPairInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetKeyPairInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLoadBalancer struct {
}
func (*validateOpGetLoadBalancer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLoadBalancer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLoadBalancerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLoadBalancerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLoadBalancerMetricData struct {
}
func (*validateOpGetLoadBalancerMetricData) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLoadBalancerMetricData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLoadBalancerMetricDataInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLoadBalancerMetricDataInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLoadBalancerTlsCertificates struct {
}
func (*validateOpGetLoadBalancerTlsCertificates) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLoadBalancerTlsCertificates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLoadBalancerTlsCertificatesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLoadBalancerTlsCertificatesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetOperation struct {
}
func (*validateOpGetOperation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetOperation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetOperationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetOperationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetOperationsForResource struct {
}
func (*validateOpGetOperationsForResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetOperationsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetOperationsForResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetOperationsForResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRelationalDatabaseEvents struct {
}
func (*validateOpGetRelationalDatabaseEvents) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRelationalDatabaseEvents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRelationalDatabaseEventsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRelationalDatabaseEventsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRelationalDatabase struct {
}
func (*validateOpGetRelationalDatabase) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRelationalDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRelationalDatabaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRelationalDatabaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRelationalDatabaseLogEvents struct {
}
func (*validateOpGetRelationalDatabaseLogEvents) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRelationalDatabaseLogEvents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRelationalDatabaseLogEventsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRelationalDatabaseLogEventsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRelationalDatabaseLogStreams struct {
}
func (*validateOpGetRelationalDatabaseLogStreams) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRelationalDatabaseLogStreams) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRelationalDatabaseLogStreamsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRelationalDatabaseLogStreamsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRelationalDatabaseMasterUserPassword struct {
}
func (*validateOpGetRelationalDatabaseMasterUserPassword) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRelationalDatabaseMasterUserPassword) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRelationalDatabaseMasterUserPasswordInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRelationalDatabaseMasterUserPasswordInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRelationalDatabaseMetricData struct {
}
func (*validateOpGetRelationalDatabaseMetricData) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRelationalDatabaseMetricData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRelationalDatabaseMetricDataInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRelationalDatabaseMetricDataInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRelationalDatabaseParameters struct {
}
func (*validateOpGetRelationalDatabaseParameters) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRelationalDatabaseParameters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRelationalDatabaseParametersInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRelationalDatabaseParametersInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRelationalDatabaseSnapshot struct {
}
func (*validateOpGetRelationalDatabaseSnapshot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRelationalDatabaseSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRelationalDatabaseSnapshotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRelationalDatabaseSnapshotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetStaticIp struct {
}
func (*validateOpGetStaticIp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetStaticIp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetStaticIpInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetStaticIpInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpImportKeyPair struct {
}
func (*validateOpImportKeyPair) ID() string {
return "OperationInputValidation"
}
func (m *validateOpImportKeyPair) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ImportKeyPairInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpImportKeyPairInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpOpenInstancePublicPorts struct {
}
func (*validateOpOpenInstancePublicPorts) ID() string {
return "OperationInputValidation"
}
func (m *validateOpOpenInstancePublicPorts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*OpenInstancePublicPortsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpOpenInstancePublicPortsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutAlarm struct {
}
func (*validateOpPutAlarm) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutAlarm) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutAlarmInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutAlarmInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutInstancePublicPorts struct {
}
func (*validateOpPutInstancePublicPorts) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutInstancePublicPorts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutInstancePublicPortsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutInstancePublicPortsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRebootInstance struct {
}
func (*validateOpRebootInstance) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRebootInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RebootInstanceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRebootInstanceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRebootRelationalDatabase struct {
}
func (*validateOpRebootRelationalDatabase) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRebootRelationalDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RebootRelationalDatabaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRebootRelationalDatabaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRegisterContainerImage struct {
}
func (*validateOpRegisterContainerImage) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRegisterContainerImage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RegisterContainerImageInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRegisterContainerImageInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpReleaseStaticIp struct {
}
func (*validateOpReleaseStaticIp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpReleaseStaticIp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ReleaseStaticIpInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpReleaseStaticIpInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSendContactMethodVerification struct {
}
func (*validateOpSendContactMethodVerification) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSendContactMethodVerification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SendContactMethodVerificationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSendContactMethodVerificationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSetIpAddressType struct {
}
func (*validateOpSetIpAddressType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSetIpAddressType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SetIpAddressTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSetIpAddressTypeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSetResourceAccessForBucket struct {
}
func (*validateOpSetResourceAccessForBucket) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSetResourceAccessForBucket) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SetResourceAccessForBucketInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSetResourceAccessForBucketInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartGUISession struct {
}
func (*validateOpStartGUISession) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartGUISession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartGUISessionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartGUISessionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartInstance struct {
}
func (*validateOpStartInstance) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartInstanceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartInstanceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartRelationalDatabase struct {
}
func (*validateOpStartRelationalDatabase) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartRelationalDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartRelationalDatabaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartRelationalDatabaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopGUISession struct {
}
func (*validateOpStopGUISession) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopGUISession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopGUISessionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopGUISessionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopInstance struct {
}
func (*validateOpStopInstance) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopInstanceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopInstanceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopRelationalDatabase struct {
}
func (*validateOpStopRelationalDatabase) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopRelationalDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopRelationalDatabaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopRelationalDatabaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTestAlarm struct {
}
func (*validateOpTestAlarm) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTestAlarm) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TestAlarmInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTestAlarmInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateBucketBundle struct {
}
func (*validateOpUpdateBucketBundle) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateBucketBundle) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateBucketBundleInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateBucketBundleInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateBucket struct {
}
func (*validateOpUpdateBucket) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateBucket) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateBucketInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateBucketInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateContainerService struct {
}
func (*validateOpUpdateContainerService) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateContainerService) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateContainerServiceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateContainerServiceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateDistribution struct {
}
func (*validateOpUpdateDistribution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateDistribution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateDistributionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateDistributionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateDomainEntry struct {
}
func (*validateOpUpdateDomainEntry) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateDomainEntry) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateDomainEntryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateDomainEntryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateInstanceMetadataOptions struct {
}
func (*validateOpUpdateInstanceMetadataOptions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateInstanceMetadataOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateInstanceMetadataOptionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateInstanceMetadataOptionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateLoadBalancerAttribute struct {
}
func (*validateOpUpdateLoadBalancerAttribute) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateLoadBalancerAttribute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateLoadBalancerAttributeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateLoadBalancerAttributeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRelationalDatabase struct {
}
func (*validateOpUpdateRelationalDatabase) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRelationalDatabase) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRelationalDatabaseInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRelationalDatabaseInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRelationalDatabaseParameters struct {
}
func (*validateOpUpdateRelationalDatabaseParameters) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRelationalDatabaseParameters) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRelationalDatabaseParametersInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRelationalDatabaseParametersInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAllocateStaticIpValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAllocateStaticIp{}, middleware.After)
}
func addOpAttachCertificateToDistributionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAttachCertificateToDistribution{}, middleware.After)
}
func addOpAttachDiskValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAttachDisk{}, middleware.After)
}
func addOpAttachInstancesToLoadBalancerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAttachInstancesToLoadBalancer{}, middleware.After)
}
func addOpAttachLoadBalancerTlsCertificateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAttachLoadBalancerTlsCertificate{}, middleware.After)
}
func addOpAttachStaticIpValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAttachStaticIp{}, middleware.After)
}
func addOpCloseInstancePublicPortsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCloseInstancePublicPorts{}, middleware.After)
}
func addOpCopySnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCopySnapshot{}, middleware.After)
}
func addOpCreateBucketAccessKeyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateBucketAccessKey{}, middleware.After)
}
func addOpCreateBucketValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateBucket{}, middleware.After)
}
func addOpCreateCertificateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCertificate{}, middleware.After)
}
func addOpCreateCloudFormationStackValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCloudFormationStack{}, middleware.After)
}
func addOpCreateContactMethodValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateContactMethod{}, middleware.After)
}
func addOpCreateContainerServiceDeploymentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateContainerServiceDeployment{}, middleware.After)
}
func addOpCreateContainerServiceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateContainerService{}, middleware.After)
}
func addOpCreateDiskFromSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDiskFromSnapshot{}, middleware.After)
}
func addOpCreateDiskValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDisk{}, middleware.After)
}
func addOpCreateDiskSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDiskSnapshot{}, middleware.After)
}
func addOpCreateDistributionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDistribution{}, middleware.After)
}
func addOpCreateDomainEntryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDomainEntry{}, middleware.After)
}
func addOpCreateDomainValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDomain{}, middleware.After)
}
func addOpCreateGUISessionAccessDetailsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateGUISessionAccessDetails{}, middleware.After)
}
func addOpCreateInstancesFromSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateInstancesFromSnapshot{}, middleware.After)
}
func addOpCreateInstancesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateInstances{}, middleware.After)
}
func addOpCreateInstanceSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateInstanceSnapshot{}, middleware.After)
}
func addOpCreateKeyPairValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateKeyPair{}, middleware.After)
}
func addOpCreateLoadBalancerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateLoadBalancer{}, middleware.After)
}
func addOpCreateLoadBalancerTlsCertificateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateLoadBalancerTlsCertificate{}, middleware.After)
}
func addOpCreateRelationalDatabaseFromSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRelationalDatabaseFromSnapshot{}, middleware.After)
}
func addOpCreateRelationalDatabaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRelationalDatabase{}, middleware.After)
}
func addOpCreateRelationalDatabaseSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRelationalDatabaseSnapshot{}, middleware.After)
}
func addOpDeleteAlarmValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAlarm{}, middleware.After)
}
func addOpDeleteAutoSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAutoSnapshot{}, middleware.After)
}
func addOpDeleteBucketAccessKeyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBucketAccessKey{}, middleware.After)
}
func addOpDeleteBucketValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBucket{}, middleware.After)
}
func addOpDeleteCertificateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteCertificate{}, middleware.After)
}
func addOpDeleteContactMethodValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteContactMethod{}, middleware.After)
}
func addOpDeleteContainerImageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteContainerImage{}, middleware.After)
}
func addOpDeleteContainerServiceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteContainerService{}, middleware.After)
}
func addOpDeleteDiskValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDisk{}, middleware.After)
}
func addOpDeleteDiskSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDiskSnapshot{}, middleware.After)
}
func addOpDeleteDomainEntryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDomainEntry{}, middleware.After)
}
func addOpDeleteDomainValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDomain{}, middleware.After)
}
func addOpDeleteInstanceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteInstance{}, middleware.After)
}
func addOpDeleteInstanceSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteInstanceSnapshot{}, middleware.After)
}
func addOpDeleteKeyPairValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteKeyPair{}, middleware.After)
}
func addOpDeleteKnownHostKeysValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteKnownHostKeys{}, middleware.After)
}
func addOpDeleteLoadBalancerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLoadBalancer{}, middleware.After)
}
func addOpDeleteLoadBalancerTlsCertificateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLoadBalancerTlsCertificate{}, middleware.After)
}
func addOpDeleteRelationalDatabaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRelationalDatabase{}, middleware.After)
}
func addOpDeleteRelationalDatabaseSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRelationalDatabaseSnapshot{}, middleware.After)
}
func addOpDetachCertificateFromDistributionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetachCertificateFromDistribution{}, middleware.After)
}
func addOpDetachDiskValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetachDisk{}, middleware.After)
}
func addOpDetachInstancesFromLoadBalancerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetachInstancesFromLoadBalancer{}, middleware.After)
}
func addOpDetachStaticIpValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDetachStaticIp{}, middleware.After)
}
func addOpDisableAddOnValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisableAddOn{}, middleware.After)
}
func addOpEnableAddOnValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpEnableAddOn{}, middleware.After)
}
func addOpExportSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpExportSnapshot{}, middleware.After)
}
func addOpGetAutoSnapshotsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAutoSnapshots{}, middleware.After)
}
func addOpGetBucketAccessKeysValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBucketAccessKeys{}, middleware.After)
}
func addOpGetBucketMetricDataValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBucketMetricData{}, middleware.After)
}
func addOpGetContainerImagesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContainerImages{}, middleware.After)
}
func addOpGetContainerLogValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContainerLog{}, middleware.After)
}
func addOpGetContainerServiceDeploymentsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContainerServiceDeployments{}, middleware.After)
}
func addOpGetContainerServiceMetricDataValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContainerServiceMetricData{}, middleware.After)
}
func addOpGetCostEstimateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetCostEstimate{}, middleware.After)
}
func addOpGetDiskValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDisk{}, middleware.After)
}
func addOpGetDiskSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDiskSnapshot{}, middleware.After)
}
func addOpGetDistributionMetricDataValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDistributionMetricData{}, middleware.After)
}
func addOpGetDomainValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDomain{}, middleware.After)
}
func addOpGetInstanceAccessDetailsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetInstanceAccessDetails{}, middleware.After)
}
func addOpGetInstanceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetInstance{}, middleware.After)
}
func addOpGetInstanceMetricDataValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetInstanceMetricData{}, middleware.After)
}
func addOpGetInstancePortStatesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetInstancePortStates{}, middleware.After)
}
func addOpGetInstanceSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetInstanceSnapshot{}, middleware.After)
}
func addOpGetInstanceStateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetInstanceState{}, middleware.After)
}
func addOpGetKeyPairValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetKeyPair{}, middleware.After)
}
func addOpGetLoadBalancerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLoadBalancer{}, middleware.After)
}
func addOpGetLoadBalancerMetricDataValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLoadBalancerMetricData{}, middleware.After)
}
func addOpGetLoadBalancerTlsCertificatesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLoadBalancerTlsCertificates{}, middleware.After)
}
func addOpGetOperationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetOperation{}, middleware.After)
}
func addOpGetOperationsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetOperationsForResource{}, middleware.After)
}
func addOpGetRelationalDatabaseEventsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRelationalDatabaseEvents{}, middleware.After)
}
func addOpGetRelationalDatabaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRelationalDatabase{}, middleware.After)
}
func addOpGetRelationalDatabaseLogEventsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRelationalDatabaseLogEvents{}, middleware.After)
}
func addOpGetRelationalDatabaseLogStreamsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRelationalDatabaseLogStreams{}, middleware.After)
}
func addOpGetRelationalDatabaseMasterUserPasswordValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRelationalDatabaseMasterUserPassword{}, middleware.After)
}
func addOpGetRelationalDatabaseMetricDataValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRelationalDatabaseMetricData{}, middleware.After)
}
func addOpGetRelationalDatabaseParametersValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRelationalDatabaseParameters{}, middleware.After)
}
func addOpGetRelationalDatabaseSnapshotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRelationalDatabaseSnapshot{}, middleware.After)
}
func addOpGetStaticIpValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetStaticIp{}, middleware.After)
}
func addOpImportKeyPairValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpImportKeyPair{}, middleware.After)
}
func addOpOpenInstancePublicPortsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpOpenInstancePublicPorts{}, middleware.After)
}
func addOpPutAlarmValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutAlarm{}, middleware.After)
}
func addOpPutInstancePublicPortsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutInstancePublicPorts{}, middleware.After)
}
func addOpRebootInstanceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRebootInstance{}, middleware.After)
}
func addOpRebootRelationalDatabaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRebootRelationalDatabase{}, middleware.After)
}
func addOpRegisterContainerImageValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRegisterContainerImage{}, middleware.After)
}
func addOpReleaseStaticIpValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpReleaseStaticIp{}, middleware.After)
}
func addOpSendContactMethodVerificationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSendContactMethodVerification{}, middleware.After)
}
func addOpSetIpAddressTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSetIpAddressType{}, middleware.After)
}
func addOpSetResourceAccessForBucketValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSetResourceAccessForBucket{}, middleware.After)
}
func addOpStartGUISessionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartGUISession{}, middleware.After)
}
func addOpStartInstanceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartInstance{}, middleware.After)
}
func addOpStartRelationalDatabaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartRelationalDatabase{}, middleware.After)
}
func addOpStopGUISessionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopGUISession{}, middleware.After)
}
func addOpStopInstanceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopInstance{}, middleware.After)
}
func addOpStopRelationalDatabaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopRelationalDatabase{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpTestAlarmValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTestAlarm{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateBucketBundleValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateBucketBundle{}, middleware.After)
}
func addOpUpdateBucketValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateBucket{}, middleware.After)
}
func addOpUpdateContainerServiceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateContainerService{}, middleware.After)
}
func addOpUpdateDistributionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateDistribution{}, middleware.After)
}
func addOpUpdateDomainEntryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateDomainEntry{}, middleware.After)
}
func addOpUpdateInstanceMetadataOptionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateInstanceMetadataOptions{}, middleware.After)
}
func addOpUpdateLoadBalancerAttributeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateLoadBalancerAttribute{}, middleware.After)
}
func addOpUpdateRelationalDatabaseValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRelationalDatabase{}, middleware.After)
}
func addOpUpdateRelationalDatabaseParametersValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRelationalDatabaseParameters{}, middleware.After)
}
func validateAddOnRequest(v *types.AddOnRequest) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddOnRequest"}
if len(v.AddOnType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("AddOnType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAddOnRequestList(v []types.AddOnRequest) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddOnRequestList"}
for i := range v {
if err := validateAddOnRequest(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBucketAccessLogConfig(v *types.BucketAccessLogConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BucketAccessLogConfig"}
if v.Enabled == nil {
invalidParams.Add(smithy.NewErrParamRequired("Enabled"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateContainerServiceDeploymentRequest(v *types.ContainerServiceDeploymentRequest) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ContainerServiceDeploymentRequest"}
if v.PublicEndpoint != nil {
if err := validateEndpointRequest(v.PublicEndpoint); err != nil {
invalidParams.AddNested("PublicEndpoint", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEndpointRequest(v *types.EndpointRequest) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EndpointRequest"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if v.ContainerPort == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerPort"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceEntry(v *types.InstanceEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceEntry"}
if v.SourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceName"))
}
if v.InstanceType == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceType"))
}
if len(v.PortInfoSource) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("PortInfoSource"))
}
if v.AvailabilityZone == nil {
invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZone"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceEntryList(v []types.InstanceEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceEntryList"}
for i := range v {
if err := validateInstanceEntry(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAllocateStaticIpInput(v *AllocateStaticIpInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AllocateStaticIpInput"}
if v.StaticIpName == nil {
invalidParams.Add(smithy.NewErrParamRequired("StaticIpName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAttachCertificateToDistributionInput(v *AttachCertificateToDistributionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AttachCertificateToDistributionInput"}
if v.DistributionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DistributionName"))
}
if v.CertificateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CertificateName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAttachDiskInput(v *AttachDiskInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AttachDiskInput"}
if v.DiskName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskName"))
}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if v.DiskPath == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskPath"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAttachInstancesToLoadBalancerInput(v *AttachInstancesToLoadBalancerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AttachInstancesToLoadBalancerInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if v.InstanceNames == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAttachLoadBalancerTlsCertificateInput(v *AttachLoadBalancerTlsCertificateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AttachLoadBalancerTlsCertificateInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if v.CertificateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CertificateName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAttachStaticIpInput(v *AttachStaticIpInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AttachStaticIpInput"}
if v.StaticIpName == nil {
invalidParams.Add(smithy.NewErrParamRequired("StaticIpName"))
}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCloseInstancePublicPortsInput(v *CloseInstancePublicPortsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloseInstancePublicPortsInput"}
if v.PortInfo == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortInfo"))
}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCopySnapshotInput(v *CopySnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CopySnapshotInput"}
if v.TargetSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetSnapshotName"))
}
if len(v.SourceRegion) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("SourceRegion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateBucketAccessKeyInput(v *CreateBucketAccessKeyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateBucketAccessKeyInput"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateBucketInput(v *CreateBucketInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateBucketInput"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if v.BundleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BundleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCertificateInput(v *CreateCertificateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCertificateInput"}
if v.CertificateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CertificateName"))
}
if v.DomainName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCloudFormationStackInput(v *CreateCloudFormationStackInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCloudFormationStackInput"}
if v.Instances == nil {
invalidParams.Add(smithy.NewErrParamRequired("Instances"))
} else if v.Instances != nil {
if err := validateInstanceEntryList(v.Instances); err != nil {
invalidParams.AddNested("Instances", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateContactMethodInput(v *CreateContactMethodInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateContactMethodInput"}
if len(v.Protocol) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Protocol"))
}
if v.ContactEndpoint == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactEndpoint"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateContainerServiceDeploymentInput(v *CreateContainerServiceDeploymentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateContainerServiceDeploymentInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if v.PublicEndpoint != nil {
if err := validateEndpointRequest(v.PublicEndpoint); err != nil {
invalidParams.AddNested("PublicEndpoint", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateContainerServiceInput(v *CreateContainerServiceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateContainerServiceInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if len(v.Power) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Power"))
}
if v.Scale == nil {
invalidParams.Add(smithy.NewErrParamRequired("Scale"))
}
if v.Deployment != nil {
if err := validateContainerServiceDeploymentRequest(v.Deployment); err != nil {
invalidParams.AddNested("Deployment", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDiskFromSnapshotInput(v *CreateDiskFromSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDiskFromSnapshotInput"}
if v.DiskName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskName"))
}
if v.AvailabilityZone == nil {
invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZone"))
}
if v.SizeInGb == nil {
invalidParams.Add(smithy.NewErrParamRequired("SizeInGb"))
}
if v.AddOns != nil {
if err := validateAddOnRequestList(v.AddOns); err != nil {
invalidParams.AddNested("AddOns", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDiskInput(v *CreateDiskInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDiskInput"}
if v.DiskName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskName"))
}
if v.AvailabilityZone == nil {
invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZone"))
}
if v.SizeInGb == nil {
invalidParams.Add(smithy.NewErrParamRequired("SizeInGb"))
}
if v.AddOns != nil {
if err := validateAddOnRequestList(v.AddOns); err != nil {
invalidParams.AddNested("AddOns", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDiskSnapshotInput(v *CreateDiskSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDiskSnapshotInput"}
if v.DiskSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDistributionInput(v *CreateDistributionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDistributionInput"}
if v.DistributionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DistributionName"))
}
if v.Origin == nil {
invalidParams.Add(smithy.NewErrParamRequired("Origin"))
}
if v.DefaultCacheBehavior == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultCacheBehavior"))
}
if v.BundleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BundleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDomainEntryInput(v *CreateDomainEntryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDomainEntryInput"}
if v.DomainName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainName"))
}
if v.DomainEntry == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainEntry"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDomainInput(v *CreateDomainInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDomainInput"}
if v.DomainName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateGUISessionAccessDetailsInput(v *CreateGUISessionAccessDetailsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateGUISessionAccessDetailsInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateInstancesFromSnapshotInput(v *CreateInstancesFromSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateInstancesFromSnapshotInput"}
if v.InstanceNames == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceNames"))
}
if v.AvailabilityZone == nil {
invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZone"))
}
if v.BundleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BundleId"))
}
if v.AddOns != nil {
if err := validateAddOnRequestList(v.AddOns); err != nil {
invalidParams.AddNested("AddOns", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateInstancesInput(v *CreateInstancesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateInstancesInput"}
if v.InstanceNames == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceNames"))
}
if v.AvailabilityZone == nil {
invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZone"))
}
if v.BlueprintId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BlueprintId"))
}
if v.BundleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BundleId"))
}
if v.AddOns != nil {
if err := validateAddOnRequestList(v.AddOns); err != nil {
invalidParams.AddNested("AddOns", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateInstanceSnapshotInput(v *CreateInstanceSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateInstanceSnapshotInput"}
if v.InstanceSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceSnapshotName"))
}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateKeyPairInput(v *CreateKeyPairInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateKeyPairInput"}
if v.KeyPairName == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyPairName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateLoadBalancerInput(v *CreateLoadBalancerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateLoadBalancerInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateLoadBalancerTlsCertificateInput(v *CreateLoadBalancerTlsCertificateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateLoadBalancerTlsCertificateInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if v.CertificateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CertificateName"))
}
if v.CertificateDomainName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CertificateDomainName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRelationalDatabaseFromSnapshotInput(v *CreateRelationalDatabaseFromSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRelationalDatabaseFromSnapshotInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRelationalDatabaseInput(v *CreateRelationalDatabaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRelationalDatabaseInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if v.RelationalDatabaseBlueprintId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseBlueprintId"))
}
if v.RelationalDatabaseBundleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseBundleId"))
}
if v.MasterDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MasterDatabaseName"))
}
if v.MasterUsername == nil {
invalidParams.Add(smithy.NewErrParamRequired("MasterUsername"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRelationalDatabaseSnapshotInput(v *CreateRelationalDatabaseSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRelationalDatabaseSnapshotInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if v.RelationalDatabaseSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAlarmInput(v *DeleteAlarmInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAlarmInput"}
if v.AlarmName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AlarmName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAutoSnapshotInput(v *DeleteAutoSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAutoSnapshotInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if v.Date == nil {
invalidParams.Add(smithy.NewErrParamRequired("Date"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBucketAccessKeyInput(v *DeleteBucketAccessKeyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBucketAccessKeyInput"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if v.AccessKeyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccessKeyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBucketInput(v *DeleteBucketInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBucketInput"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteCertificateInput(v *DeleteCertificateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCertificateInput"}
if v.CertificateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CertificateName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteContactMethodInput(v *DeleteContactMethodInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteContactMethodInput"}
if len(v.Protocol) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Protocol"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteContainerImageInput(v *DeleteContainerImageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteContainerImageInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if v.Image == nil {
invalidParams.Add(smithy.NewErrParamRequired("Image"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteContainerServiceInput(v *DeleteContainerServiceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteContainerServiceInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDiskInput(v *DeleteDiskInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDiskInput"}
if v.DiskName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDiskSnapshotInput(v *DeleteDiskSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDiskSnapshotInput"}
if v.DiskSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDomainEntryInput(v *DeleteDomainEntryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDomainEntryInput"}
if v.DomainName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainName"))
}
if v.DomainEntry == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainEntry"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDomainInput(v *DeleteDomainInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDomainInput"}
if v.DomainName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteInstanceInput(v *DeleteInstanceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteInstanceInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteInstanceSnapshotInput(v *DeleteInstanceSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteInstanceSnapshotInput"}
if v.InstanceSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteKeyPairInput(v *DeleteKeyPairInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteKeyPairInput"}
if v.KeyPairName == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyPairName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteKnownHostKeysInput(v *DeleteKnownHostKeysInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteKnownHostKeysInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLoadBalancerInput(v *DeleteLoadBalancerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLoadBalancerInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLoadBalancerTlsCertificateInput(v *DeleteLoadBalancerTlsCertificateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLoadBalancerTlsCertificateInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if v.CertificateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CertificateName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRelationalDatabaseInput(v *DeleteRelationalDatabaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRelationalDatabaseInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRelationalDatabaseSnapshotInput(v *DeleteRelationalDatabaseSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRelationalDatabaseSnapshotInput"}
if v.RelationalDatabaseSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetachCertificateFromDistributionInput(v *DetachCertificateFromDistributionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetachCertificateFromDistributionInput"}
if v.DistributionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DistributionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetachDiskInput(v *DetachDiskInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetachDiskInput"}
if v.DiskName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetachInstancesFromLoadBalancerInput(v *DetachInstancesFromLoadBalancerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetachInstancesFromLoadBalancerInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if v.InstanceNames == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDetachStaticIpInput(v *DetachStaticIpInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DetachStaticIpInput"}
if v.StaticIpName == nil {
invalidParams.Add(smithy.NewErrParamRequired("StaticIpName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisableAddOnInput(v *DisableAddOnInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisableAddOnInput"}
if len(v.AddOnType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("AddOnType"))
}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpEnableAddOnInput(v *EnableAddOnInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EnableAddOnInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if v.AddOnRequest == nil {
invalidParams.Add(smithy.NewErrParamRequired("AddOnRequest"))
} else if v.AddOnRequest != nil {
if err := validateAddOnRequest(v.AddOnRequest); err != nil {
invalidParams.AddNested("AddOnRequest", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpExportSnapshotInput(v *ExportSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExportSnapshotInput"}
if v.SourceSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAutoSnapshotsInput(v *GetAutoSnapshotsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAutoSnapshotsInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBucketAccessKeysInput(v *GetBucketAccessKeysInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBucketAccessKeysInput"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBucketMetricDataInput(v *GetBucketMetricDataInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBucketMetricDataInput"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if len(v.MetricName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if v.Statistics == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statistics"))
}
if len(v.Unit) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Unit"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContainerImagesInput(v *GetContainerImagesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContainerImagesInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContainerLogInput(v *GetContainerLogInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContainerLogInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContainerServiceDeploymentsInput(v *GetContainerServiceDeploymentsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContainerServiceDeploymentsInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContainerServiceMetricDataInput(v *GetContainerServiceMetricDataInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContainerServiceMetricDataInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if len(v.MetricName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if v.Statistics == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statistics"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetCostEstimateInput(v *GetCostEstimateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetCostEstimateInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDiskInput(v *GetDiskInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDiskInput"}
if v.DiskName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDiskSnapshotInput(v *GetDiskSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDiskSnapshotInput"}
if v.DiskSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DiskSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDistributionMetricDataInput(v *GetDistributionMetricDataInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDistributionMetricDataInput"}
if v.DistributionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DistributionName"))
}
if len(v.MetricName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if len(v.Unit) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Unit"))
}
if v.Statistics == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statistics"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDomainInput(v *GetDomainInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDomainInput"}
if v.DomainName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetInstanceAccessDetailsInput(v *GetInstanceAccessDetailsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetInstanceAccessDetailsInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetInstanceInput(v *GetInstanceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetInstanceInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetInstanceMetricDataInput(v *GetInstanceMetricDataInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetInstanceMetricDataInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if len(v.MetricName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if len(v.Unit) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Unit"))
}
if v.Statistics == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statistics"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetInstancePortStatesInput(v *GetInstancePortStatesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetInstancePortStatesInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetInstanceSnapshotInput(v *GetInstanceSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetInstanceSnapshotInput"}
if v.InstanceSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetInstanceStateInput(v *GetInstanceStateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetInstanceStateInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetKeyPairInput(v *GetKeyPairInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetKeyPairInput"}
if v.KeyPairName == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyPairName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLoadBalancerInput(v *GetLoadBalancerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLoadBalancerInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLoadBalancerMetricDataInput(v *GetLoadBalancerMetricDataInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLoadBalancerMetricDataInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if len(v.MetricName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if len(v.Unit) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Unit"))
}
if v.Statistics == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statistics"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLoadBalancerTlsCertificatesInput(v *GetLoadBalancerTlsCertificatesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLoadBalancerTlsCertificatesInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetOperationInput(v *GetOperationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetOperationInput"}
if v.OperationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("OperationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetOperationsForResourceInput(v *GetOperationsForResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetOperationsForResourceInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRelationalDatabaseEventsInput(v *GetRelationalDatabaseEventsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRelationalDatabaseEventsInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRelationalDatabaseInput(v *GetRelationalDatabaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRelationalDatabaseInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRelationalDatabaseLogEventsInput(v *GetRelationalDatabaseLogEventsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRelationalDatabaseLogEventsInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if v.LogStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogStreamName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRelationalDatabaseLogStreamsInput(v *GetRelationalDatabaseLogStreamsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRelationalDatabaseLogStreamsInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRelationalDatabaseMasterUserPasswordInput(v *GetRelationalDatabaseMasterUserPasswordInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRelationalDatabaseMasterUserPasswordInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRelationalDatabaseMetricDataInput(v *GetRelationalDatabaseMetricDataInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRelationalDatabaseMetricDataInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if len(v.MetricName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.StartTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTime"))
}
if v.EndTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTime"))
}
if len(v.Unit) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Unit"))
}
if v.Statistics == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statistics"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRelationalDatabaseParametersInput(v *GetRelationalDatabaseParametersInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRelationalDatabaseParametersInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRelationalDatabaseSnapshotInput(v *GetRelationalDatabaseSnapshotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRelationalDatabaseSnapshotInput"}
if v.RelationalDatabaseSnapshotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseSnapshotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetStaticIpInput(v *GetStaticIpInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetStaticIpInput"}
if v.StaticIpName == nil {
invalidParams.Add(smithy.NewErrParamRequired("StaticIpName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpImportKeyPairInput(v *ImportKeyPairInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportKeyPairInput"}
if v.KeyPairName == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyPairName"))
}
if v.PublicKeyBase64 == nil {
invalidParams.Add(smithy.NewErrParamRequired("PublicKeyBase64"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpOpenInstancePublicPortsInput(v *OpenInstancePublicPortsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OpenInstancePublicPortsInput"}
if v.PortInfo == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortInfo"))
}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutAlarmInput(v *PutAlarmInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAlarmInput"}
if v.AlarmName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AlarmName"))
}
if len(v.MetricName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.MonitoredResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MonitoredResourceName"))
}
if len(v.ComparisonOperator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ComparisonOperator"))
}
if v.Threshold == nil {
invalidParams.Add(smithy.NewErrParamRequired("Threshold"))
}
if v.EvaluationPeriods == nil {
invalidParams.Add(smithy.NewErrParamRequired("EvaluationPeriods"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutInstancePublicPortsInput(v *PutInstancePublicPortsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutInstancePublicPortsInput"}
if v.PortInfos == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortInfos"))
}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRebootInstanceInput(v *RebootInstanceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RebootInstanceInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRebootRelationalDatabaseInput(v *RebootRelationalDatabaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RebootRelationalDatabaseInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRegisterContainerImageInput(v *RegisterContainerImageInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegisterContainerImageInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if v.Label == nil {
invalidParams.Add(smithy.NewErrParamRequired("Label"))
}
if v.Digest == nil {
invalidParams.Add(smithy.NewErrParamRequired("Digest"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpReleaseStaticIpInput(v *ReleaseStaticIpInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReleaseStaticIpInput"}
if v.StaticIpName == nil {
invalidParams.Add(smithy.NewErrParamRequired("StaticIpName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSendContactMethodVerificationInput(v *SendContactMethodVerificationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SendContactMethodVerificationInput"}
if len(v.Protocol) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Protocol"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSetIpAddressTypeInput(v *SetIpAddressTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SetIpAddressTypeInput"}
if len(v.ResourceType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if len(v.IpAddressType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("IpAddressType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSetResourceAccessForBucketInput(v *SetResourceAccessForBucketInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SetResourceAccessForBucketInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if len(v.Access) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Access"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartGUISessionInput(v *StartGUISessionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartGUISessionInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartInstanceInput(v *StartInstanceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartInstanceInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartRelationalDatabaseInput(v *StartRelationalDatabaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartRelationalDatabaseInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopGUISessionInput(v *StopGUISessionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopGUISessionInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopInstanceInput(v *StopInstanceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopInstanceInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopRelationalDatabaseInput(v *StopRelationalDatabaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopRelationalDatabaseInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTestAlarmInput(v *TestAlarmInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestAlarmInput"}
if v.AlarmName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AlarmName"))
}
if len(v.State) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("State"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceName"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateBucketBundleInput(v *UpdateBucketBundleInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateBucketBundleInput"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if v.BundleId == nil {
invalidParams.Add(smithy.NewErrParamRequired("BundleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateBucketInput(v *UpdateBucketInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateBucketInput"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if v.AccessLogConfig != nil {
if err := validateBucketAccessLogConfig(v.AccessLogConfig); err != nil {
invalidParams.AddNested("AccessLogConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateContainerServiceInput(v *UpdateContainerServiceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateContainerServiceInput"}
if v.ServiceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateDistributionInput(v *UpdateDistributionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateDistributionInput"}
if v.DistributionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DistributionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateDomainEntryInput(v *UpdateDomainEntryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateDomainEntryInput"}
if v.DomainName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainName"))
}
if v.DomainEntry == nil {
invalidParams.Add(smithy.NewErrParamRequired("DomainEntry"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateInstanceMetadataOptionsInput(v *UpdateInstanceMetadataOptionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateInstanceMetadataOptionsInput"}
if v.InstanceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateLoadBalancerAttributeInput(v *UpdateLoadBalancerAttributeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateLoadBalancerAttributeInput"}
if v.LoadBalancerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoadBalancerName"))
}
if len(v.AttributeName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("AttributeName"))
}
if v.AttributeValue == nil {
invalidParams.Add(smithy.NewErrParamRequired("AttributeValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRelationalDatabaseInput(v *UpdateRelationalDatabaseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRelationalDatabaseInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRelationalDatabaseParametersInput(v *UpdateRelationalDatabaseParametersInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRelationalDatabaseParametersInput"}
if v.RelationalDatabaseName == nil {
invalidParams.Add(smithy.NewErrParamRequired("RelationalDatabaseName"))
}
if v.Parameters == nil {
invalidParams.Add(smithy.NewErrParamRequired("Parameters"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 5,149 |
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 Lightsail 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: "lightsail.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lightsail-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "lightsail-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lightsail.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lightsail.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lightsail-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "lightsail-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lightsail.{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: "lightsail-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lightsail.{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: "lightsail-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lightsail.{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: "lightsail-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lightsail.{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: "lightsail-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lightsail.{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: "lightsail.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lightsail-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "lightsail-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lightsail.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 341 |
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 AccessDirection string
// Enum values for AccessDirection
const (
AccessDirectionInbound AccessDirection = "inbound"
AccessDirectionOutbound AccessDirection = "outbound"
)
// Values returns all known values for AccessDirection. 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 (AccessDirection) Values() []AccessDirection {
return []AccessDirection{
"inbound",
"outbound",
}
}
type AccessType string
// Enum values for AccessType
const (
AccessTypePublic AccessType = "public"
AccessTypePrivate AccessType = "private"
)
// Values returns all known values for AccessType. 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 (AccessType) Values() []AccessType {
return []AccessType{
"public",
"private",
}
}
type AccountLevelBpaSyncStatus string
// Enum values for AccountLevelBpaSyncStatus
const (
AccountLevelBpaSyncStatusInSync AccountLevelBpaSyncStatus = "InSync"
AccountLevelBpaSyncStatusFailed AccountLevelBpaSyncStatus = "Failed"
AccountLevelBpaSyncStatusNeverSynced AccountLevelBpaSyncStatus = "NeverSynced"
AccountLevelBpaSyncStatusDefaulted AccountLevelBpaSyncStatus = "Defaulted"
)
// Values returns all known values for AccountLevelBpaSyncStatus. 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 (AccountLevelBpaSyncStatus) Values() []AccountLevelBpaSyncStatus {
return []AccountLevelBpaSyncStatus{
"InSync",
"Failed",
"NeverSynced",
"Defaulted",
}
}
type AddOnType string
// Enum values for AddOnType
const (
AddOnTypeAutoSnapshot AddOnType = "AutoSnapshot"
AddOnTypeStopInstanceOnIdle AddOnType = "StopInstanceOnIdle"
)
// Values returns all known values for AddOnType. 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 (AddOnType) Values() []AddOnType {
return []AddOnType{
"AutoSnapshot",
"StopInstanceOnIdle",
}
}
type AlarmState string
// Enum values for AlarmState
const (
AlarmStateOk AlarmState = "OK"
AlarmStateAlarm AlarmState = "ALARM"
AlarmStateInsufficientData AlarmState = "INSUFFICIENT_DATA"
)
// Values returns all known values for AlarmState. 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 (AlarmState) Values() []AlarmState {
return []AlarmState{
"OK",
"ALARM",
"INSUFFICIENT_DATA",
}
}
type AppCategory string
// Enum values for AppCategory
const (
AppCategoryLfR AppCategory = "LfR"
)
// Values returns all known values for AppCategory. 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 (AppCategory) Values() []AppCategory {
return []AppCategory{
"LfR",
}
}
type AutoMountStatus string
// Enum values for AutoMountStatus
const (
AutoMountStatusFailed AutoMountStatus = "Failed"
AutoMountStatusPending AutoMountStatus = "Pending"
AutoMountStatusMounted AutoMountStatus = "Mounted"
AutoMountStatusNotMounted AutoMountStatus = "NotMounted"
)
// Values returns all known values for AutoMountStatus. 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 (AutoMountStatus) Values() []AutoMountStatus {
return []AutoMountStatus{
"Failed",
"Pending",
"Mounted",
"NotMounted",
}
}
type AutoSnapshotStatus string
// Enum values for AutoSnapshotStatus
const (
AutoSnapshotStatusSuccess AutoSnapshotStatus = "Success"
AutoSnapshotStatusFailed AutoSnapshotStatus = "Failed"
AutoSnapshotStatusInProgress AutoSnapshotStatus = "InProgress"
AutoSnapshotStatusNotFound AutoSnapshotStatus = "NotFound"
)
// Values returns all known values for AutoSnapshotStatus. 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 (AutoSnapshotStatus) Values() []AutoSnapshotStatus {
return []AutoSnapshotStatus{
"Success",
"Failed",
"InProgress",
"NotFound",
}
}
type BehaviorEnum string
// Enum values for BehaviorEnum
const (
BehaviorEnumDontCacheSetting BehaviorEnum = "dont-cache"
BehaviorEnumCacheSetting BehaviorEnum = "cache"
)
// Values returns all known values for BehaviorEnum. 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 (BehaviorEnum) Values() []BehaviorEnum {
return []BehaviorEnum{
"dont-cache",
"cache",
}
}
type BlueprintType string
// Enum values for BlueprintType
const (
BlueprintTypeOs BlueprintType = "os"
BlueprintTypeApp BlueprintType = "app"
)
// Values returns all known values for BlueprintType. 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 (BlueprintType) Values() []BlueprintType {
return []BlueprintType{
"os",
"app",
}
}
type BPAStatusMessage string
// Enum values for BPAStatusMessage
const (
BPAStatusMessageDefaultedForSlrMissing BPAStatusMessage = "DEFAULTED_FOR_SLR_MISSING"
BPAStatusMessageSyncOnHold BPAStatusMessage = "SYNC_ON_HOLD"
BPAStatusMessageDefaultedForSlrMissingOnHold BPAStatusMessage = "DEFAULTED_FOR_SLR_MISSING_ON_HOLD"
BPAStatusMessageUnknown BPAStatusMessage = "Unknown"
)
// Values returns all known values for BPAStatusMessage. 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 (BPAStatusMessage) Values() []BPAStatusMessage {
return []BPAStatusMessage{
"DEFAULTED_FOR_SLR_MISSING",
"SYNC_ON_HOLD",
"DEFAULTED_FOR_SLR_MISSING_ON_HOLD",
"Unknown",
}
}
type BucketMetricName string
// Enum values for BucketMetricName
const (
BucketMetricNameBucketSizeBytes BucketMetricName = "BucketSizeBytes"
BucketMetricNameNumberOfObjects BucketMetricName = "NumberOfObjects"
)
// Values returns all known values for BucketMetricName. 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 (BucketMetricName) Values() []BucketMetricName {
return []BucketMetricName{
"BucketSizeBytes",
"NumberOfObjects",
}
}
type CertificateDomainValidationStatus string
// Enum values for CertificateDomainValidationStatus
const (
CertificateDomainValidationStatusPendingValidation CertificateDomainValidationStatus = "PENDING_VALIDATION"
CertificateDomainValidationStatusFailed CertificateDomainValidationStatus = "FAILED"
CertificateDomainValidationStatusSuccess CertificateDomainValidationStatus = "SUCCESS"
)
// Values returns all known values for CertificateDomainValidationStatus. 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 (CertificateDomainValidationStatus) Values() []CertificateDomainValidationStatus {
return []CertificateDomainValidationStatus{
"PENDING_VALIDATION",
"FAILED",
"SUCCESS",
}
}
type CertificateStatus string
// Enum values for CertificateStatus
const (
CertificateStatusPendingValidation CertificateStatus = "PENDING_VALIDATION"
CertificateStatusIssued CertificateStatus = "ISSUED"
CertificateStatusInactive CertificateStatus = "INACTIVE"
CertificateStatusExpired CertificateStatus = "EXPIRED"
CertificateStatusValidationTimedOut CertificateStatus = "VALIDATION_TIMED_OUT"
CertificateStatusRevoked CertificateStatus = "REVOKED"
CertificateStatusFailed CertificateStatus = "FAILED"
)
// Values returns all known values for CertificateStatus. 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 (CertificateStatus) Values() []CertificateStatus {
return []CertificateStatus{
"PENDING_VALIDATION",
"ISSUED",
"INACTIVE",
"EXPIRED",
"VALIDATION_TIMED_OUT",
"REVOKED",
"FAILED",
}
}
type CloudFormationStackRecordSourceType string
// Enum values for CloudFormationStackRecordSourceType
const (
CloudFormationStackRecordSourceTypeExportSnapshotRecord CloudFormationStackRecordSourceType = "ExportSnapshotRecord"
)
// Values returns all known values for CloudFormationStackRecordSourceType. 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 (CloudFormationStackRecordSourceType) Values() []CloudFormationStackRecordSourceType {
return []CloudFormationStackRecordSourceType{
"ExportSnapshotRecord",
}
}
type ComparisonOperator string
// Enum values for ComparisonOperator
const (
ComparisonOperatorGreaterThanOrEqualToThreshold ComparisonOperator = "GreaterThanOrEqualToThreshold"
ComparisonOperatorGreaterThanThreshold ComparisonOperator = "GreaterThanThreshold"
ComparisonOperatorLessThanThreshold ComparisonOperator = "LessThanThreshold"
ComparisonOperatorLessThanOrEqualToThreshold ComparisonOperator = "LessThanOrEqualToThreshold"
)
// Values returns all known values for ComparisonOperator. 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 (ComparisonOperator) Values() []ComparisonOperator {
return []ComparisonOperator{
"GreaterThanOrEqualToThreshold",
"GreaterThanThreshold",
"LessThanThreshold",
"LessThanOrEqualToThreshold",
}
}
type ContactMethodStatus string
// Enum values for ContactMethodStatus
const (
ContactMethodStatusPendingVerification ContactMethodStatus = "PendingVerification"
ContactMethodStatusValid ContactMethodStatus = "Valid"
ContactMethodStatusInvalid ContactMethodStatus = "Invalid"
)
// Values returns all known values for ContactMethodStatus. 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 (ContactMethodStatus) Values() []ContactMethodStatus {
return []ContactMethodStatus{
"PendingVerification",
"Valid",
"Invalid",
}
}
type ContactMethodVerificationProtocol string
// Enum values for ContactMethodVerificationProtocol
const (
ContactMethodVerificationProtocolEmail ContactMethodVerificationProtocol = "Email"
)
// Values returns all known values for ContactMethodVerificationProtocol. 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 (ContactMethodVerificationProtocol) Values() []ContactMethodVerificationProtocol {
return []ContactMethodVerificationProtocol{
"Email",
}
}
type ContactProtocol string
// Enum values for ContactProtocol
const (
ContactProtocolEmail ContactProtocol = "Email"
ContactProtocolSms ContactProtocol = "SMS"
)
// Values returns all known values for ContactProtocol. 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 (ContactProtocol) Values() []ContactProtocol {
return []ContactProtocol{
"Email",
"SMS",
}
}
type ContainerServiceDeploymentState string
// Enum values for ContainerServiceDeploymentState
const (
ContainerServiceDeploymentStateActivating ContainerServiceDeploymentState = "ACTIVATING"
ContainerServiceDeploymentStateActive ContainerServiceDeploymentState = "ACTIVE"
ContainerServiceDeploymentStateInactive ContainerServiceDeploymentState = "INACTIVE"
ContainerServiceDeploymentStateFailed ContainerServiceDeploymentState = "FAILED"
)
// Values returns all known values for ContainerServiceDeploymentState. 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 (ContainerServiceDeploymentState) Values() []ContainerServiceDeploymentState {
return []ContainerServiceDeploymentState{
"ACTIVATING",
"ACTIVE",
"INACTIVE",
"FAILED",
}
}
type ContainerServiceMetricName string
// Enum values for ContainerServiceMetricName
const (
ContainerServiceMetricNameCPUUtilization ContainerServiceMetricName = "CPUUtilization"
ContainerServiceMetricNameMemoryUtilization ContainerServiceMetricName = "MemoryUtilization"
)
// Values returns all known values for ContainerServiceMetricName. 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 (ContainerServiceMetricName) Values() []ContainerServiceMetricName {
return []ContainerServiceMetricName{
"CPUUtilization",
"MemoryUtilization",
}
}
type ContainerServicePowerName string
// Enum values for ContainerServicePowerName
const (
ContainerServicePowerNameNano ContainerServicePowerName = "nano"
ContainerServicePowerNameMicro ContainerServicePowerName = "micro"
ContainerServicePowerNameSmall ContainerServicePowerName = "small"
ContainerServicePowerNameMedium ContainerServicePowerName = "medium"
ContainerServicePowerNameLarge ContainerServicePowerName = "large"
ContainerServicePowerNameXlarge ContainerServicePowerName = "xlarge"
)
// Values returns all known values for ContainerServicePowerName. 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 (ContainerServicePowerName) Values() []ContainerServicePowerName {
return []ContainerServicePowerName{
"nano",
"micro",
"small",
"medium",
"large",
"xlarge",
}
}
type ContainerServiceProtocol string
// Enum values for ContainerServiceProtocol
const (
ContainerServiceProtocolHttp ContainerServiceProtocol = "HTTP"
ContainerServiceProtocolHttps ContainerServiceProtocol = "HTTPS"
ContainerServiceProtocolTcp ContainerServiceProtocol = "TCP"
ContainerServiceProtocolUdp ContainerServiceProtocol = "UDP"
)
// Values returns all known values for ContainerServiceProtocol. 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 (ContainerServiceProtocol) Values() []ContainerServiceProtocol {
return []ContainerServiceProtocol{
"HTTP",
"HTTPS",
"TCP",
"UDP",
}
}
type ContainerServiceState string
// Enum values for ContainerServiceState
const (
ContainerServiceStatePending ContainerServiceState = "PENDING"
ContainerServiceStateReady ContainerServiceState = "READY"
ContainerServiceStateRunning ContainerServiceState = "RUNNING"
ContainerServiceStateUpdating ContainerServiceState = "UPDATING"
ContainerServiceStateDeleting ContainerServiceState = "DELETING"
ContainerServiceStateDisabled ContainerServiceState = "DISABLED"
ContainerServiceStateDeploying ContainerServiceState = "DEPLOYING"
)
// Values returns all known values for ContainerServiceState. 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 (ContainerServiceState) Values() []ContainerServiceState {
return []ContainerServiceState{
"PENDING",
"READY",
"RUNNING",
"UPDATING",
"DELETING",
"DISABLED",
"DEPLOYING",
}
}
type ContainerServiceStateDetailCode string
// Enum values for ContainerServiceStateDetailCode
const (
ContainerServiceStateDetailCodeCreatingSystemResources ContainerServiceStateDetailCode = "CREATING_SYSTEM_RESOURCES"
ContainerServiceStateDetailCodeCreatingNetworkInfrastructure ContainerServiceStateDetailCode = "CREATING_NETWORK_INFRASTRUCTURE"
ContainerServiceStateDetailCodeProvisioningCertificate ContainerServiceStateDetailCode = "PROVISIONING_CERTIFICATE"
ContainerServiceStateDetailCodeProvisioningService ContainerServiceStateDetailCode = "PROVISIONING_SERVICE"
ContainerServiceStateDetailCodeCreatingDeployment ContainerServiceStateDetailCode = "CREATING_DEPLOYMENT"
ContainerServiceStateDetailCodeEvaluatingHealthCheck ContainerServiceStateDetailCode = "EVALUATING_HEALTH_CHECK"
ContainerServiceStateDetailCodeActivatingDeployment ContainerServiceStateDetailCode = "ACTIVATING_DEPLOYMENT"
ContainerServiceStateDetailCodeCertificateLimitExceeded ContainerServiceStateDetailCode = "CERTIFICATE_LIMIT_EXCEEDED"
ContainerServiceStateDetailCodeUnknownError ContainerServiceStateDetailCode = "UNKNOWN_ERROR"
)
// Values returns all known values for ContainerServiceStateDetailCode. 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 (ContainerServiceStateDetailCode) Values() []ContainerServiceStateDetailCode {
return []ContainerServiceStateDetailCode{
"CREATING_SYSTEM_RESOURCES",
"CREATING_NETWORK_INFRASTRUCTURE",
"PROVISIONING_CERTIFICATE",
"PROVISIONING_SERVICE",
"CREATING_DEPLOYMENT",
"EVALUATING_HEALTH_CHECK",
"ACTIVATING_DEPLOYMENT",
"CERTIFICATE_LIMIT_EXCEEDED",
"UNKNOWN_ERROR",
}
}
type Currency string
// Enum values for Currency
const (
CurrencyUsd Currency = "USD"
)
// Values returns all known values for Currency. 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 (Currency) Values() []Currency {
return []Currency{
"USD",
}
}
type DiskSnapshotState string
// Enum values for DiskSnapshotState
const (
DiskSnapshotStatePending DiskSnapshotState = "pending"
DiskSnapshotStateCompleted DiskSnapshotState = "completed"
DiskSnapshotStateError DiskSnapshotState = "error"
DiskSnapshotStateUnknown DiskSnapshotState = "unknown"
)
// Values returns all known values for DiskSnapshotState. 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 (DiskSnapshotState) Values() []DiskSnapshotState {
return []DiskSnapshotState{
"pending",
"completed",
"error",
"unknown",
}
}
type DiskState string
// Enum values for DiskState
const (
DiskStatePending DiskState = "pending"
DiskStateError DiskState = "error"
DiskStateAvailable DiskState = "available"
DiskStateInUse DiskState = "in-use"
DiskStateUnknown DiskState = "unknown"
)
// Values returns all known values for DiskState. 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 (DiskState) Values() []DiskState {
return []DiskState{
"pending",
"error",
"available",
"in-use",
"unknown",
}
}
type DistributionMetricName string
// Enum values for DistributionMetricName
const (
DistributionMetricNameRequests DistributionMetricName = "Requests"
DistributionMetricNameBytesDownloaded DistributionMetricName = "BytesDownloaded"
DistributionMetricNameBytesUploaded DistributionMetricName = "BytesUploaded"
DistributionMetricNameTotalErrorRate DistributionMetricName = "TotalErrorRate"
DistributionMetricNameHttp4xxErrorRate DistributionMetricName = "Http4xxErrorRate"
DistributionMetricNameHttp5xxErrorRate DistributionMetricName = "Http5xxErrorRate"
)
// Values returns all known values for DistributionMetricName. 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 (DistributionMetricName) Values() []DistributionMetricName {
return []DistributionMetricName{
"Requests",
"BytesDownloaded",
"BytesUploaded",
"TotalErrorRate",
"Http4xxErrorRate",
"Http5xxErrorRate",
}
}
type DnsRecordCreationStateCode string
// Enum values for DnsRecordCreationStateCode
const (
DnsRecordCreationStateCodeSucceeded DnsRecordCreationStateCode = "SUCCEEDED"
DnsRecordCreationStateCodeStarted DnsRecordCreationStateCode = "STARTED"
DnsRecordCreationStateCodeFailed DnsRecordCreationStateCode = "FAILED"
)
// Values returns all known values for DnsRecordCreationStateCode. 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 (DnsRecordCreationStateCode) Values() []DnsRecordCreationStateCode {
return []DnsRecordCreationStateCode{
"SUCCEEDED",
"STARTED",
"FAILED",
}
}
type ExportSnapshotRecordSourceType string
// Enum values for ExportSnapshotRecordSourceType
const (
ExportSnapshotRecordSourceTypeInstanceSnapshot ExportSnapshotRecordSourceType = "InstanceSnapshot"
ExportSnapshotRecordSourceTypeDiskSnapshot ExportSnapshotRecordSourceType = "DiskSnapshot"
)
// Values returns all known values for ExportSnapshotRecordSourceType. 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 (ExportSnapshotRecordSourceType) Values() []ExportSnapshotRecordSourceType {
return []ExportSnapshotRecordSourceType{
"InstanceSnapshot",
"DiskSnapshot",
}
}
type ForwardValues string
// Enum values for ForwardValues
const (
ForwardValuesNone ForwardValues = "none"
ForwardValuesAllowList ForwardValues = "allow-list"
ForwardValuesAll ForwardValues = "all"
)
// Values returns all known values for ForwardValues. 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 (ForwardValues) Values() []ForwardValues {
return []ForwardValues{
"none",
"allow-list",
"all",
}
}
type HeaderEnum string
// Enum values for HeaderEnum
const (
HeaderEnumAccept HeaderEnum = "Accept"
HeaderEnumAcceptCharset HeaderEnum = "Accept-Charset"
HeaderEnumAcceptDatetime HeaderEnum = "Accept-Datetime"
HeaderEnumAcceptEncoding HeaderEnum = "Accept-Encoding"
HeaderEnumAcceptLanguage HeaderEnum = "Accept-Language"
HeaderEnumAuthorization HeaderEnum = "Authorization"
HeaderEnumCloudFrontForwardedProto HeaderEnum = "CloudFront-Forwarded-Proto"
HeaderEnumCloudFrontIsDesktopViewer HeaderEnum = "CloudFront-Is-Desktop-Viewer"
HeaderEnumCloudFrontIsMobileViewer HeaderEnum = "CloudFront-Is-Mobile-Viewer"
HeaderEnumCloudFrontIsSmartTVViewer HeaderEnum = "CloudFront-Is-SmartTV-Viewer"
HeaderEnumCloudFrontIsTabletViewer HeaderEnum = "CloudFront-Is-Tablet-Viewer"
HeaderEnumCloudFrontViewerCountry HeaderEnum = "CloudFront-Viewer-Country"
HeaderEnumHost HeaderEnum = "Host"
HeaderEnumOrigin HeaderEnum = "Origin"
HeaderEnumReferer HeaderEnum = "Referer"
)
// Values returns all known values for HeaderEnum. 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 (HeaderEnum) Values() []HeaderEnum {
return []HeaderEnum{
"Accept",
"Accept-Charset",
"Accept-Datetime",
"Accept-Encoding",
"Accept-Language",
"Authorization",
"CloudFront-Forwarded-Proto",
"CloudFront-Is-Desktop-Viewer",
"CloudFront-Is-Mobile-Viewer",
"CloudFront-Is-SmartTV-Viewer",
"CloudFront-Is-Tablet-Viewer",
"CloudFront-Viewer-Country",
"Host",
"Origin",
"Referer",
}
}
type HttpEndpoint string
// Enum values for HttpEndpoint
const (
HttpEndpointDisabled HttpEndpoint = "disabled"
HttpEndpointEnabled HttpEndpoint = "enabled"
)
// Values returns all known values for HttpEndpoint. 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 (HttpEndpoint) Values() []HttpEndpoint {
return []HttpEndpoint{
"disabled",
"enabled",
}
}
type HttpProtocolIpv6 string
// Enum values for HttpProtocolIpv6
const (
HttpProtocolIpv6Disabled HttpProtocolIpv6 = "disabled"
HttpProtocolIpv6Enabled HttpProtocolIpv6 = "enabled"
)
// Values returns all known values for HttpProtocolIpv6. 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 (HttpProtocolIpv6) Values() []HttpProtocolIpv6 {
return []HttpProtocolIpv6{
"disabled",
"enabled",
}
}
type HttpTokens string
// Enum values for HttpTokens
const (
HttpTokensOptional HttpTokens = "optional"
HttpTokensRequired HttpTokens = "required"
)
// Values returns all known values for HttpTokens. 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 (HttpTokens) Values() []HttpTokens {
return []HttpTokens{
"optional",
"required",
}
}
type InstanceAccessProtocol string
// Enum values for InstanceAccessProtocol
const (
InstanceAccessProtocolSsh InstanceAccessProtocol = "ssh"
InstanceAccessProtocolRdp InstanceAccessProtocol = "rdp"
)
// Values returns all known values for InstanceAccessProtocol. 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 (InstanceAccessProtocol) Values() []InstanceAccessProtocol {
return []InstanceAccessProtocol{
"ssh",
"rdp",
}
}
type InstanceHealthReason string
// Enum values for InstanceHealthReason
const (
InstanceHealthReasonLbRegistrationInProgress InstanceHealthReason = "Lb.RegistrationInProgress"
InstanceHealthReasonLbInitialHealthChecking InstanceHealthReason = "Lb.InitialHealthChecking"
InstanceHealthReasonLbInternalError InstanceHealthReason = "Lb.InternalError"
InstanceHealthReasonInstanceResponseCodeMismatch InstanceHealthReason = "Instance.ResponseCodeMismatch"
InstanceHealthReasonInstanceTimeout InstanceHealthReason = "Instance.Timeout"
InstanceHealthReasonInstanceFailedHealthChecks InstanceHealthReason = "Instance.FailedHealthChecks"
InstanceHealthReasonInstanceNotRegistered InstanceHealthReason = "Instance.NotRegistered"
InstanceHealthReasonInstanceNotInUse InstanceHealthReason = "Instance.NotInUse"
InstanceHealthReasonInstanceDeregistrationInProgress InstanceHealthReason = "Instance.DeregistrationInProgress"
InstanceHealthReasonInstanceInvalidState InstanceHealthReason = "Instance.InvalidState"
InstanceHealthReasonInstanceIpUnusable InstanceHealthReason = "Instance.IpUnusable"
)
// Values returns all known values for InstanceHealthReason. 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 (InstanceHealthReason) Values() []InstanceHealthReason {
return []InstanceHealthReason{
"Lb.RegistrationInProgress",
"Lb.InitialHealthChecking",
"Lb.InternalError",
"Instance.ResponseCodeMismatch",
"Instance.Timeout",
"Instance.FailedHealthChecks",
"Instance.NotRegistered",
"Instance.NotInUse",
"Instance.DeregistrationInProgress",
"Instance.InvalidState",
"Instance.IpUnusable",
}
}
type InstanceHealthState string
// Enum values for InstanceHealthState
const (
InstanceHealthStateInitial InstanceHealthState = "initial"
InstanceHealthStateHealthy InstanceHealthState = "healthy"
InstanceHealthStateUnhealthy InstanceHealthState = "unhealthy"
InstanceHealthStateUnused InstanceHealthState = "unused"
InstanceHealthStateDraining InstanceHealthState = "draining"
InstanceHealthStateUnavailable InstanceHealthState = "unavailable"
)
// Values returns all known values for InstanceHealthState. 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 (InstanceHealthState) Values() []InstanceHealthState {
return []InstanceHealthState{
"initial",
"healthy",
"unhealthy",
"unused",
"draining",
"unavailable",
}
}
type InstanceMetadataState string
// Enum values for InstanceMetadataState
const (
InstanceMetadataStatePending InstanceMetadataState = "pending"
InstanceMetadataStateApplied InstanceMetadataState = "applied"
)
// Values returns all known values for InstanceMetadataState. 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 (InstanceMetadataState) Values() []InstanceMetadataState {
return []InstanceMetadataState{
"pending",
"applied",
}
}
type InstanceMetricName string
// Enum values for InstanceMetricName
const (
InstanceMetricNameCPUUtilization InstanceMetricName = "CPUUtilization"
InstanceMetricNameNetworkIn InstanceMetricName = "NetworkIn"
InstanceMetricNameNetworkOut InstanceMetricName = "NetworkOut"
InstanceMetricNameStatusCheckFailed InstanceMetricName = "StatusCheckFailed"
InstanceMetricNameStatusCheckFailedInstance InstanceMetricName = "StatusCheckFailed_Instance"
InstanceMetricNameStatusCheckFailedSystem InstanceMetricName = "StatusCheckFailed_System"
InstanceMetricNameBurstCapacityTime InstanceMetricName = "BurstCapacityTime"
InstanceMetricNameBurstCapacityPercentage InstanceMetricName = "BurstCapacityPercentage"
InstanceMetricNameMetadataNoToken InstanceMetricName = "MetadataNoToken"
)
// Values returns all known values for InstanceMetricName. 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 (InstanceMetricName) Values() []InstanceMetricName {
return []InstanceMetricName{
"CPUUtilization",
"NetworkIn",
"NetworkOut",
"StatusCheckFailed",
"StatusCheckFailed_Instance",
"StatusCheckFailed_System",
"BurstCapacityTime",
"BurstCapacityPercentage",
"MetadataNoToken",
}
}
type InstancePlatform string
// Enum values for InstancePlatform
const (
InstancePlatformLinuxUnix InstancePlatform = "LINUX_UNIX"
InstancePlatformWindows InstancePlatform = "WINDOWS"
)
// Values returns all known values for InstancePlatform. 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 (InstancePlatform) Values() []InstancePlatform {
return []InstancePlatform{
"LINUX_UNIX",
"WINDOWS",
}
}
type InstanceSnapshotState string
// Enum values for InstanceSnapshotState
const (
InstanceSnapshotStatePending InstanceSnapshotState = "pending"
InstanceSnapshotStateError InstanceSnapshotState = "error"
InstanceSnapshotStateAvailable InstanceSnapshotState = "available"
)
// Values returns all known values for InstanceSnapshotState. 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 (InstanceSnapshotState) Values() []InstanceSnapshotState {
return []InstanceSnapshotState{
"pending",
"error",
"available",
}
}
type IpAddressType string
// Enum values for IpAddressType
const (
IpAddressTypeDualstack IpAddressType = "dualstack"
IpAddressTypeIpv4 IpAddressType = "ipv4"
)
// Values returns all known values for IpAddressType. 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 (IpAddressType) Values() []IpAddressType {
return []IpAddressType{
"dualstack",
"ipv4",
}
}
type LoadBalancerAttributeName string
// Enum values for LoadBalancerAttributeName
const (
LoadBalancerAttributeNameHealthCheckPath LoadBalancerAttributeName = "HealthCheckPath"
LoadBalancerAttributeNameSessionStickinessEnabled LoadBalancerAttributeName = "SessionStickinessEnabled"
LoadBalancerAttributeNameSessionStickinessLbCookieDurationSeconds LoadBalancerAttributeName = "SessionStickiness_LB_CookieDurationSeconds"
LoadBalancerAttributeNameHttpsRedirectionEnabled LoadBalancerAttributeName = "HttpsRedirectionEnabled"
LoadBalancerAttributeNameTlsPolicyName LoadBalancerAttributeName = "TlsPolicyName"
)
// Values returns all known values for LoadBalancerAttributeName. 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 (LoadBalancerAttributeName) Values() []LoadBalancerAttributeName {
return []LoadBalancerAttributeName{
"HealthCheckPath",
"SessionStickinessEnabled",
"SessionStickiness_LB_CookieDurationSeconds",
"HttpsRedirectionEnabled",
"TlsPolicyName",
}
}
type LoadBalancerMetricName string
// Enum values for LoadBalancerMetricName
const (
LoadBalancerMetricNameClientTLSNegotiationErrorCount LoadBalancerMetricName = "ClientTLSNegotiationErrorCount"
LoadBalancerMetricNameHealthyHostCount LoadBalancerMetricName = "HealthyHostCount"
LoadBalancerMetricNameUnhealthyHostCount LoadBalancerMetricName = "UnhealthyHostCount"
LoadBalancerMetricNameHTTPCodeLb4xxCount LoadBalancerMetricName = "HTTPCode_LB_4XX_Count"
LoadBalancerMetricNameHTTPCodeLb5xxCount LoadBalancerMetricName = "HTTPCode_LB_5XX_Count"
LoadBalancerMetricNameHTTPCodeInstance2xxCount LoadBalancerMetricName = "HTTPCode_Instance_2XX_Count"
LoadBalancerMetricNameHTTPCodeInstance3xxCount LoadBalancerMetricName = "HTTPCode_Instance_3XX_Count"
LoadBalancerMetricNameHTTPCodeInstance4xxCount LoadBalancerMetricName = "HTTPCode_Instance_4XX_Count"
LoadBalancerMetricNameHTTPCodeInstance5xxCount LoadBalancerMetricName = "HTTPCode_Instance_5XX_Count"
LoadBalancerMetricNameInstanceResponseTime LoadBalancerMetricName = "InstanceResponseTime"
LoadBalancerMetricNameRejectedConnectionCount LoadBalancerMetricName = "RejectedConnectionCount"
LoadBalancerMetricNameRequestCount LoadBalancerMetricName = "RequestCount"
)
// Values returns all known values for LoadBalancerMetricName. 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 (LoadBalancerMetricName) Values() []LoadBalancerMetricName {
return []LoadBalancerMetricName{
"ClientTLSNegotiationErrorCount",
"HealthyHostCount",
"UnhealthyHostCount",
"HTTPCode_LB_4XX_Count",
"HTTPCode_LB_5XX_Count",
"HTTPCode_Instance_2XX_Count",
"HTTPCode_Instance_3XX_Count",
"HTTPCode_Instance_4XX_Count",
"HTTPCode_Instance_5XX_Count",
"InstanceResponseTime",
"RejectedConnectionCount",
"RequestCount",
}
}
type LoadBalancerProtocol string
// Enum values for LoadBalancerProtocol
const (
LoadBalancerProtocolHttpHttps LoadBalancerProtocol = "HTTP_HTTPS"
LoadBalancerProtocolHttp LoadBalancerProtocol = "HTTP"
)
// Values returns all known values for LoadBalancerProtocol. 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 (LoadBalancerProtocol) Values() []LoadBalancerProtocol {
return []LoadBalancerProtocol{
"HTTP_HTTPS",
"HTTP",
}
}
type LoadBalancerState string
// Enum values for LoadBalancerState
const (
LoadBalancerStateActive LoadBalancerState = "active"
LoadBalancerStateProvisioning LoadBalancerState = "provisioning"
LoadBalancerStateActiveImpaired LoadBalancerState = "active_impaired"
LoadBalancerStateFailed LoadBalancerState = "failed"
LoadBalancerStateUnknown LoadBalancerState = "unknown"
)
// Values returns all known values for LoadBalancerState. 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 (LoadBalancerState) Values() []LoadBalancerState {
return []LoadBalancerState{
"active",
"provisioning",
"active_impaired",
"failed",
"unknown",
}
}
type LoadBalancerTlsCertificateDnsRecordCreationStateCode string
// Enum values for LoadBalancerTlsCertificateDnsRecordCreationStateCode
const (
LoadBalancerTlsCertificateDnsRecordCreationStateCodeSucceeded LoadBalancerTlsCertificateDnsRecordCreationStateCode = "SUCCEEDED"
LoadBalancerTlsCertificateDnsRecordCreationStateCodeStarted LoadBalancerTlsCertificateDnsRecordCreationStateCode = "STARTED"
LoadBalancerTlsCertificateDnsRecordCreationStateCodeFailed LoadBalancerTlsCertificateDnsRecordCreationStateCode = "FAILED"
)
// Values returns all known values for
// LoadBalancerTlsCertificateDnsRecordCreationStateCode. 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 (LoadBalancerTlsCertificateDnsRecordCreationStateCode) Values() []LoadBalancerTlsCertificateDnsRecordCreationStateCode {
return []LoadBalancerTlsCertificateDnsRecordCreationStateCode{
"SUCCEEDED",
"STARTED",
"FAILED",
}
}
type LoadBalancerTlsCertificateDomainStatus string
// Enum values for LoadBalancerTlsCertificateDomainStatus
const (
LoadBalancerTlsCertificateDomainStatusPendingValidation LoadBalancerTlsCertificateDomainStatus = "PENDING_VALIDATION"
LoadBalancerTlsCertificateDomainStatusFailed LoadBalancerTlsCertificateDomainStatus = "FAILED"
LoadBalancerTlsCertificateDomainStatusSuccess LoadBalancerTlsCertificateDomainStatus = "SUCCESS"
)
// Values returns all known values for LoadBalancerTlsCertificateDomainStatus.
// 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 (LoadBalancerTlsCertificateDomainStatus) Values() []LoadBalancerTlsCertificateDomainStatus {
return []LoadBalancerTlsCertificateDomainStatus{
"PENDING_VALIDATION",
"FAILED",
"SUCCESS",
}
}
type LoadBalancerTlsCertificateFailureReason string
// Enum values for LoadBalancerTlsCertificateFailureReason
const (
LoadBalancerTlsCertificateFailureReasonNoAvailableContacts LoadBalancerTlsCertificateFailureReason = "NO_AVAILABLE_CONTACTS"
LoadBalancerTlsCertificateFailureReasonAdditionalVerificationRequired LoadBalancerTlsCertificateFailureReason = "ADDITIONAL_VERIFICATION_REQUIRED"
LoadBalancerTlsCertificateFailureReasonDomainNotAllowed LoadBalancerTlsCertificateFailureReason = "DOMAIN_NOT_ALLOWED"
LoadBalancerTlsCertificateFailureReasonInvalidPublicDomain LoadBalancerTlsCertificateFailureReason = "INVALID_PUBLIC_DOMAIN"
LoadBalancerTlsCertificateFailureReasonOther LoadBalancerTlsCertificateFailureReason = "OTHER"
)
// Values returns all known values for LoadBalancerTlsCertificateFailureReason.
// 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 (LoadBalancerTlsCertificateFailureReason) Values() []LoadBalancerTlsCertificateFailureReason {
return []LoadBalancerTlsCertificateFailureReason{
"NO_AVAILABLE_CONTACTS",
"ADDITIONAL_VERIFICATION_REQUIRED",
"DOMAIN_NOT_ALLOWED",
"INVALID_PUBLIC_DOMAIN",
"OTHER",
}
}
type LoadBalancerTlsCertificateRenewalStatus string
// Enum values for LoadBalancerTlsCertificateRenewalStatus
const (
LoadBalancerTlsCertificateRenewalStatusPendingAutoRenewal LoadBalancerTlsCertificateRenewalStatus = "PENDING_AUTO_RENEWAL"
LoadBalancerTlsCertificateRenewalStatusPendingValidation LoadBalancerTlsCertificateRenewalStatus = "PENDING_VALIDATION"
LoadBalancerTlsCertificateRenewalStatusSuccess LoadBalancerTlsCertificateRenewalStatus = "SUCCESS"
LoadBalancerTlsCertificateRenewalStatusFailed LoadBalancerTlsCertificateRenewalStatus = "FAILED"
)
// Values returns all known values for LoadBalancerTlsCertificateRenewalStatus.
// 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 (LoadBalancerTlsCertificateRenewalStatus) Values() []LoadBalancerTlsCertificateRenewalStatus {
return []LoadBalancerTlsCertificateRenewalStatus{
"PENDING_AUTO_RENEWAL",
"PENDING_VALIDATION",
"SUCCESS",
"FAILED",
}
}
type LoadBalancerTlsCertificateRevocationReason string
// Enum values for LoadBalancerTlsCertificateRevocationReason
const (
LoadBalancerTlsCertificateRevocationReasonUnspecified LoadBalancerTlsCertificateRevocationReason = "UNSPECIFIED"
LoadBalancerTlsCertificateRevocationReasonKeyCompromise LoadBalancerTlsCertificateRevocationReason = "KEY_COMPROMISE"
LoadBalancerTlsCertificateRevocationReasonCaCompromise LoadBalancerTlsCertificateRevocationReason = "CA_COMPROMISE"
LoadBalancerTlsCertificateRevocationReasonAffiliationChanged LoadBalancerTlsCertificateRevocationReason = "AFFILIATION_CHANGED"
LoadBalancerTlsCertificateRevocationReasonSuperceded LoadBalancerTlsCertificateRevocationReason = "SUPERCEDED"
LoadBalancerTlsCertificateRevocationReasonCessationOfOperation LoadBalancerTlsCertificateRevocationReason = "CESSATION_OF_OPERATION"
LoadBalancerTlsCertificateRevocationReasonCertificateHold LoadBalancerTlsCertificateRevocationReason = "CERTIFICATE_HOLD"
LoadBalancerTlsCertificateRevocationReasonRemoveFromCrl LoadBalancerTlsCertificateRevocationReason = "REMOVE_FROM_CRL"
LoadBalancerTlsCertificateRevocationReasonPrivilegeWithdrawn LoadBalancerTlsCertificateRevocationReason = "PRIVILEGE_WITHDRAWN"
LoadBalancerTlsCertificateRevocationReasonAACompromise LoadBalancerTlsCertificateRevocationReason = "A_A_COMPROMISE"
)
// Values returns all known values for LoadBalancerTlsCertificateRevocationReason.
// 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 (LoadBalancerTlsCertificateRevocationReason) Values() []LoadBalancerTlsCertificateRevocationReason {
return []LoadBalancerTlsCertificateRevocationReason{
"UNSPECIFIED",
"KEY_COMPROMISE",
"CA_COMPROMISE",
"AFFILIATION_CHANGED",
"SUPERCEDED",
"CESSATION_OF_OPERATION",
"CERTIFICATE_HOLD",
"REMOVE_FROM_CRL",
"PRIVILEGE_WITHDRAWN",
"A_A_COMPROMISE",
}
}
type LoadBalancerTlsCertificateStatus string
// Enum values for LoadBalancerTlsCertificateStatus
const (
LoadBalancerTlsCertificateStatusPendingValidation LoadBalancerTlsCertificateStatus = "PENDING_VALIDATION"
LoadBalancerTlsCertificateStatusIssued LoadBalancerTlsCertificateStatus = "ISSUED"
LoadBalancerTlsCertificateStatusInactive LoadBalancerTlsCertificateStatus = "INACTIVE"
LoadBalancerTlsCertificateStatusExpired LoadBalancerTlsCertificateStatus = "EXPIRED"
LoadBalancerTlsCertificateStatusValidationTimedOut LoadBalancerTlsCertificateStatus = "VALIDATION_TIMED_OUT"
LoadBalancerTlsCertificateStatusRevoked LoadBalancerTlsCertificateStatus = "REVOKED"
LoadBalancerTlsCertificateStatusFailed LoadBalancerTlsCertificateStatus = "FAILED"
LoadBalancerTlsCertificateStatusUnknown LoadBalancerTlsCertificateStatus = "UNKNOWN"
)
// Values returns all known values for LoadBalancerTlsCertificateStatus. 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 (LoadBalancerTlsCertificateStatus) Values() []LoadBalancerTlsCertificateStatus {
return []LoadBalancerTlsCertificateStatus{
"PENDING_VALIDATION",
"ISSUED",
"INACTIVE",
"EXPIRED",
"VALIDATION_TIMED_OUT",
"REVOKED",
"FAILED",
"UNKNOWN",
}
}
type MetricName string
// Enum values for MetricName
const (
MetricNameCPUUtilization MetricName = "CPUUtilization"
MetricNameNetworkIn MetricName = "NetworkIn"
MetricNameNetworkOut MetricName = "NetworkOut"
MetricNameStatusCheckFailed MetricName = "StatusCheckFailed"
MetricNameStatusCheckFailedInstance MetricName = "StatusCheckFailed_Instance"
MetricNameStatusCheckFailedSystem MetricName = "StatusCheckFailed_System"
MetricNameClientTLSNegotiationErrorCount MetricName = "ClientTLSNegotiationErrorCount"
MetricNameHealthyHostCount MetricName = "HealthyHostCount"
MetricNameUnhealthyHostCount MetricName = "UnhealthyHostCount"
MetricNameHTTPCodeLb4xxCount MetricName = "HTTPCode_LB_4XX_Count"
MetricNameHTTPCodeLb5xxCount MetricName = "HTTPCode_LB_5XX_Count"
MetricNameHTTPCodeInstance2xxCount MetricName = "HTTPCode_Instance_2XX_Count"
MetricNameHTTPCodeInstance3xxCount MetricName = "HTTPCode_Instance_3XX_Count"
MetricNameHTTPCodeInstance4xxCount MetricName = "HTTPCode_Instance_4XX_Count"
MetricNameHTTPCodeInstance5xxCount MetricName = "HTTPCode_Instance_5XX_Count"
MetricNameInstanceResponseTime MetricName = "InstanceResponseTime"
MetricNameRejectedConnectionCount MetricName = "RejectedConnectionCount"
MetricNameRequestCount MetricName = "RequestCount"
MetricNameDatabaseConnections MetricName = "DatabaseConnections"
MetricNameDiskQueueDepth MetricName = "DiskQueueDepth"
MetricNameFreeStorageSpace MetricName = "FreeStorageSpace"
MetricNameNetworkReceiveThroughput MetricName = "NetworkReceiveThroughput"
MetricNameNetworkTransmitThroughput MetricName = "NetworkTransmitThroughput"
MetricNameBurstCapacityTime MetricName = "BurstCapacityTime"
MetricNameBurstCapacityPercentage MetricName = "BurstCapacityPercentage"
)
// Values returns all known values for MetricName. 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 (MetricName) Values() []MetricName {
return []MetricName{
"CPUUtilization",
"NetworkIn",
"NetworkOut",
"StatusCheckFailed",
"StatusCheckFailed_Instance",
"StatusCheckFailed_System",
"ClientTLSNegotiationErrorCount",
"HealthyHostCount",
"UnhealthyHostCount",
"HTTPCode_LB_4XX_Count",
"HTTPCode_LB_5XX_Count",
"HTTPCode_Instance_2XX_Count",
"HTTPCode_Instance_3XX_Count",
"HTTPCode_Instance_4XX_Count",
"HTTPCode_Instance_5XX_Count",
"InstanceResponseTime",
"RejectedConnectionCount",
"RequestCount",
"DatabaseConnections",
"DiskQueueDepth",
"FreeStorageSpace",
"NetworkReceiveThroughput",
"NetworkTransmitThroughput",
"BurstCapacityTime",
"BurstCapacityPercentage",
}
}
type MetricStatistic string
// Enum values for MetricStatistic
const (
MetricStatisticMinimum MetricStatistic = "Minimum"
MetricStatisticMaximum MetricStatistic = "Maximum"
MetricStatisticSum MetricStatistic = "Sum"
MetricStatisticAverage MetricStatistic = "Average"
MetricStatisticSampleCount MetricStatistic = "SampleCount"
)
// Values returns all known values for MetricStatistic. 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 (MetricStatistic) Values() []MetricStatistic {
return []MetricStatistic{
"Minimum",
"Maximum",
"Sum",
"Average",
"SampleCount",
}
}
type MetricUnit string
// Enum values for MetricUnit
const (
MetricUnitSeconds MetricUnit = "Seconds"
MetricUnitMicroseconds MetricUnit = "Microseconds"
MetricUnitMilliseconds MetricUnit = "Milliseconds"
MetricUnitBytes MetricUnit = "Bytes"
MetricUnitKilobytes MetricUnit = "Kilobytes"
MetricUnitMegabytes MetricUnit = "Megabytes"
MetricUnitGigabytes MetricUnit = "Gigabytes"
MetricUnitTerabytes MetricUnit = "Terabytes"
MetricUnitBits MetricUnit = "Bits"
MetricUnitKilobits MetricUnit = "Kilobits"
MetricUnitMegabits MetricUnit = "Megabits"
MetricUnitGigabits MetricUnit = "Gigabits"
MetricUnitTerabits MetricUnit = "Terabits"
MetricUnitPercent MetricUnit = "Percent"
MetricUnitCount MetricUnit = "Count"
MetricUnitBytesSecond MetricUnit = "Bytes/Second"
MetricUnitKilobytesSecond MetricUnit = "Kilobytes/Second"
MetricUnitMegabytesSecond MetricUnit = "Megabytes/Second"
MetricUnitGigabytesSecond MetricUnit = "Gigabytes/Second"
MetricUnitTerabytesSecond MetricUnit = "Terabytes/Second"
MetricUnitBitsSecond MetricUnit = "Bits/Second"
MetricUnitKilobitsSecond MetricUnit = "Kilobits/Second"
MetricUnitMegabitsSecond MetricUnit = "Megabits/Second"
MetricUnitGigabitsSecond MetricUnit = "Gigabits/Second"
MetricUnitTerabitsSecond MetricUnit = "Terabits/Second"
MetricUnitCountSecond MetricUnit = "Count/Second"
MetricUnitNone MetricUnit = "None"
)
// Values returns all known values for MetricUnit. 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 (MetricUnit) Values() []MetricUnit {
return []MetricUnit{
"Seconds",
"Microseconds",
"Milliseconds",
"Bytes",
"Kilobytes",
"Megabytes",
"Gigabytes",
"Terabytes",
"Bits",
"Kilobits",
"Megabits",
"Gigabits",
"Terabits",
"Percent",
"Count",
"Bytes/Second",
"Kilobytes/Second",
"Megabytes/Second",
"Gigabytes/Second",
"Terabytes/Second",
"Bits/Second",
"Kilobits/Second",
"Megabits/Second",
"Gigabits/Second",
"Terabits/Second",
"Count/Second",
"None",
}
}
type NameServersUpdateStateCode string
// Enum values for NameServersUpdateStateCode
const (
NameServersUpdateStateCodeSucceeded NameServersUpdateStateCode = "SUCCEEDED"
NameServersUpdateStateCodePending NameServersUpdateStateCode = "PENDING"
NameServersUpdateStateCodeFailed NameServersUpdateStateCode = "FAILED"
NameServersUpdateStateCodeStarted NameServersUpdateStateCode = "STARTED"
)
// Values returns all known values for NameServersUpdateStateCode. 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 (NameServersUpdateStateCode) Values() []NameServersUpdateStateCode {
return []NameServersUpdateStateCode{
"SUCCEEDED",
"PENDING",
"FAILED",
"STARTED",
}
}
type NetworkProtocol string
// Enum values for NetworkProtocol
const (
NetworkProtocolTcp NetworkProtocol = "tcp"
NetworkProtocolAll NetworkProtocol = "all"
NetworkProtocolUdp NetworkProtocol = "udp"
NetworkProtocolIcmp NetworkProtocol = "icmp"
)
// Values returns all known values for NetworkProtocol. 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 (NetworkProtocol) Values() []NetworkProtocol {
return []NetworkProtocol{
"tcp",
"all",
"udp",
"icmp",
}
}
type OperationStatus string
// Enum values for OperationStatus
const (
OperationStatusNotStarted OperationStatus = "NotStarted"
OperationStatusStarted OperationStatus = "Started"
OperationStatusFailed OperationStatus = "Failed"
OperationStatusCompleted OperationStatus = "Completed"
OperationStatusSucceeded OperationStatus = "Succeeded"
)
// Values returns all known values for OperationStatus. 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 (OperationStatus) Values() []OperationStatus {
return []OperationStatus{
"NotStarted",
"Started",
"Failed",
"Completed",
"Succeeded",
}
}
type OperationType string
// Enum values for OperationType
const (
OperationTypeDeleteKnownHostKeys OperationType = "DeleteKnownHostKeys"
OperationTypeDeleteInstance OperationType = "DeleteInstance"
OperationTypeCreateInstance OperationType = "CreateInstance"
OperationTypeStopInstance OperationType = "StopInstance"
OperationTypeStartInstance OperationType = "StartInstance"
OperationTypeRebootInstance OperationType = "RebootInstance"
OperationTypeOpenInstancePublicPorts OperationType = "OpenInstancePublicPorts"
OperationTypePutInstancePublicPorts OperationType = "PutInstancePublicPorts"
OperationTypeCloseInstancePublicPorts OperationType = "CloseInstancePublicPorts"
OperationTypeAllocateStaticIp OperationType = "AllocateStaticIp"
OperationTypeReleaseStaticIp OperationType = "ReleaseStaticIp"
OperationTypeAttachStaticIp OperationType = "AttachStaticIp"
OperationTypeDetachStaticIp OperationType = "DetachStaticIp"
OperationTypeUpdateDomainEntry OperationType = "UpdateDomainEntry"
OperationTypeDeleteDomainEntry OperationType = "DeleteDomainEntry"
OperationTypeCreateDomain OperationType = "CreateDomain"
OperationTypeDeleteDomain OperationType = "DeleteDomain"
OperationTypeCreateInstanceSnapshot OperationType = "CreateInstanceSnapshot"
OperationTypeDeleteInstanceSnapshot OperationType = "DeleteInstanceSnapshot"
OperationTypeCreateInstancesFromSnapshot OperationType = "CreateInstancesFromSnapshot"
OperationTypeCreateLoadBalancer OperationType = "CreateLoadBalancer"
OperationTypeDeleteLoadBalancer OperationType = "DeleteLoadBalancer"
OperationTypeAttachInstancesToLoadBalancer OperationType = "AttachInstancesToLoadBalancer"
OperationTypeDetachInstancesFromLoadBalancer OperationType = "DetachInstancesFromLoadBalancer"
OperationTypeUpdateLoadBalancerAttribute OperationType = "UpdateLoadBalancerAttribute"
OperationTypeCreateLoadBalancerTlsCertificate OperationType = "CreateLoadBalancerTlsCertificate"
OperationTypeDeleteLoadBalancerTlsCertificate OperationType = "DeleteLoadBalancerTlsCertificate"
OperationTypeAttachLoadBalancerTlsCertificate OperationType = "AttachLoadBalancerTlsCertificate"
OperationTypeCreateDisk OperationType = "CreateDisk"
OperationTypeDeleteDisk OperationType = "DeleteDisk"
OperationTypeAttachDisk OperationType = "AttachDisk"
OperationTypeDetachDisk OperationType = "DetachDisk"
OperationTypeCreateDiskSnapshot OperationType = "CreateDiskSnapshot"
OperationTypeDeleteDiskSnapshot OperationType = "DeleteDiskSnapshot"
OperationTypeCreateDiskFromSnapshot OperationType = "CreateDiskFromSnapshot"
OperationTypeCreateRelationalDatabase OperationType = "CreateRelationalDatabase"
OperationTypeUpdateRelationalDatabase OperationType = "UpdateRelationalDatabase"
OperationTypeDeleteRelationalDatabase OperationType = "DeleteRelationalDatabase"
OperationTypeCreateRelationalDatabaseFromSnapshot OperationType = "CreateRelationalDatabaseFromSnapshot"
OperationTypeCreateRelationalDatabaseSnapshot OperationType = "CreateRelationalDatabaseSnapshot"
OperationTypeDeleteRelationalDatabaseSnapshot OperationType = "DeleteRelationalDatabaseSnapshot"
OperationTypeUpdateRelationalDatabaseParameters OperationType = "UpdateRelationalDatabaseParameters"
OperationTypeStartRelationalDatabase OperationType = "StartRelationalDatabase"
OperationTypeRebootRelationalDatabase OperationType = "RebootRelationalDatabase"
OperationTypeStopRelationalDatabase OperationType = "StopRelationalDatabase"
OperationTypeEnableAddOn OperationType = "EnableAddOn"
OperationTypeDisableAddOn OperationType = "DisableAddOn"
OperationTypePutAlarm OperationType = "PutAlarm"
OperationTypeGetAlarms OperationType = "GetAlarms"
OperationTypeDeleteAlarm OperationType = "DeleteAlarm"
OperationTypeTestAlarm OperationType = "TestAlarm"
OperationTypeCreateContactMethod OperationType = "CreateContactMethod"
OperationTypeGetContactMethods OperationType = "GetContactMethods"
OperationTypeSendContactMethodVerification OperationType = "SendContactMethodVerification"
OperationTypeDeleteContactMethod OperationType = "DeleteContactMethod"
OperationTypeCreateDistribution OperationType = "CreateDistribution"
OperationTypeUpdateDistribution OperationType = "UpdateDistribution"
OperationTypeDeleteDistribution OperationType = "DeleteDistribution"
OperationTypeResetDistributionCache OperationType = "ResetDistributionCache"
OperationTypeAttachCertificateToDistribution OperationType = "AttachCertificateToDistribution"
OperationTypeDetachCertificateFromDistribution OperationType = "DetachCertificateFromDistribution"
OperationTypeUpdateDistributionBundle OperationType = "UpdateDistributionBundle"
OperationTypeSetIpAddressType OperationType = "SetIpAddressType"
OperationTypeCreateCertificate OperationType = "CreateCertificate"
OperationTypeDeleteCertificate OperationType = "DeleteCertificate"
OperationTypeCreateContainerService OperationType = "CreateContainerService"
OperationTypeUpdateContainerService OperationType = "UpdateContainerService"
OperationTypeDeleteContainerService OperationType = "DeleteContainerService"
OperationTypeCreateContainerServiceDeployment OperationType = "CreateContainerServiceDeployment"
OperationTypeCreateContainerServiceRegistryLogin OperationType = "CreateContainerServiceRegistryLogin"
OperationTypeRegisterContainerImage OperationType = "RegisterContainerImage"
OperationTypeDeleteContainerImage OperationType = "DeleteContainerImage"
OperationTypeCreateBucket OperationType = "CreateBucket"
OperationTypeDeleteBucket OperationType = "DeleteBucket"
OperationTypeCreateBucketAccessKey OperationType = "CreateBucketAccessKey"
OperationTypeDeleteBucketAccessKey OperationType = "DeleteBucketAccessKey"
OperationTypeUpdateBucketBundle OperationType = "UpdateBucketBundle"
OperationTypeUpdateBucket OperationType = "UpdateBucket"
OperationTypeSetResourceAccessForBucket OperationType = "SetResourceAccessForBucket"
OperationTypeUpdateInstanceMetadataOptions OperationType = "UpdateInstanceMetadataOptions"
OperationTypeStartGUISession OperationType = "StartGUISession"
OperationTypeStopGUISession OperationType = "StopGUISession"
)
// Values returns all known values for OperationType. 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 (OperationType) Values() []OperationType {
return []OperationType{
"DeleteKnownHostKeys",
"DeleteInstance",
"CreateInstance",
"StopInstance",
"StartInstance",
"RebootInstance",
"OpenInstancePublicPorts",
"PutInstancePublicPorts",
"CloseInstancePublicPorts",
"AllocateStaticIp",
"ReleaseStaticIp",
"AttachStaticIp",
"DetachStaticIp",
"UpdateDomainEntry",
"DeleteDomainEntry",
"CreateDomain",
"DeleteDomain",
"CreateInstanceSnapshot",
"DeleteInstanceSnapshot",
"CreateInstancesFromSnapshot",
"CreateLoadBalancer",
"DeleteLoadBalancer",
"AttachInstancesToLoadBalancer",
"DetachInstancesFromLoadBalancer",
"UpdateLoadBalancerAttribute",
"CreateLoadBalancerTlsCertificate",
"DeleteLoadBalancerTlsCertificate",
"AttachLoadBalancerTlsCertificate",
"CreateDisk",
"DeleteDisk",
"AttachDisk",
"DetachDisk",
"CreateDiskSnapshot",
"DeleteDiskSnapshot",
"CreateDiskFromSnapshot",
"CreateRelationalDatabase",
"UpdateRelationalDatabase",
"DeleteRelationalDatabase",
"CreateRelationalDatabaseFromSnapshot",
"CreateRelationalDatabaseSnapshot",
"DeleteRelationalDatabaseSnapshot",
"UpdateRelationalDatabaseParameters",
"StartRelationalDatabase",
"RebootRelationalDatabase",
"StopRelationalDatabase",
"EnableAddOn",
"DisableAddOn",
"PutAlarm",
"GetAlarms",
"DeleteAlarm",
"TestAlarm",
"CreateContactMethod",
"GetContactMethods",
"SendContactMethodVerification",
"DeleteContactMethod",
"CreateDistribution",
"UpdateDistribution",
"DeleteDistribution",
"ResetDistributionCache",
"AttachCertificateToDistribution",
"DetachCertificateFromDistribution",
"UpdateDistributionBundle",
"SetIpAddressType",
"CreateCertificate",
"DeleteCertificate",
"CreateContainerService",
"UpdateContainerService",
"DeleteContainerService",
"CreateContainerServiceDeployment",
"CreateContainerServiceRegistryLogin",
"RegisterContainerImage",
"DeleteContainerImage",
"CreateBucket",
"DeleteBucket",
"CreateBucketAccessKey",
"DeleteBucketAccessKey",
"UpdateBucketBundle",
"UpdateBucket",
"SetResourceAccessForBucket",
"UpdateInstanceMetadataOptions",
"StartGUISession",
"StopGUISession",
}
}
type OriginProtocolPolicyEnum string
// Enum values for OriginProtocolPolicyEnum
const (
OriginProtocolPolicyEnumHTTPOnly OriginProtocolPolicyEnum = "http-only"
OriginProtocolPolicyEnumHTTPSOnly OriginProtocolPolicyEnum = "https-only"
)
// Values returns all known values for OriginProtocolPolicyEnum. 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 (OriginProtocolPolicyEnum) Values() []OriginProtocolPolicyEnum {
return []OriginProtocolPolicyEnum{
"http-only",
"https-only",
}
}
type PortAccessType string
// Enum values for PortAccessType
const (
PortAccessTypePublic PortAccessType = "Public"
PortAccessTypePrivate PortAccessType = "Private"
)
// Values returns all known values for PortAccessType. 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 (PortAccessType) Values() []PortAccessType {
return []PortAccessType{
"Public",
"Private",
}
}
type PortInfoSourceType string
// Enum values for PortInfoSourceType
const (
PortInfoSourceTypeDefault PortInfoSourceType = "DEFAULT"
PortInfoSourceTypeInstance PortInfoSourceType = "INSTANCE"
PortInfoSourceTypeNone PortInfoSourceType = "NONE"
PortInfoSourceTypeClosed PortInfoSourceType = "CLOSED"
)
// Values returns all known values for PortInfoSourceType. 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 (PortInfoSourceType) Values() []PortInfoSourceType {
return []PortInfoSourceType{
"DEFAULT",
"INSTANCE",
"NONE",
"CLOSED",
}
}
type PortState string
// Enum values for PortState
const (
PortStateOpen PortState = "open"
PortStateClosed PortState = "closed"
)
// Values returns all known values for PortState. 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 (PortState) Values() []PortState {
return []PortState{
"open",
"closed",
}
}
type PricingUnit string
// Enum values for PricingUnit
const (
PricingUnitGb PricingUnit = "GB"
PricingUnitHrs PricingUnit = "Hrs"
PricingUnitGBMo PricingUnit = "GB-Mo"
PricingUnitBundles PricingUnit = "Bundles"
PricingUnitQueries PricingUnit = "Queries"
)
// Values returns all known values for PricingUnit. 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 (PricingUnit) Values() []PricingUnit {
return []PricingUnit{
"GB",
"Hrs",
"GB-Mo",
"Bundles",
"Queries",
}
}
type R53HostedZoneDeletionStateCode string
// Enum values for R53HostedZoneDeletionStateCode
const (
R53HostedZoneDeletionStateCodeSucceeded R53HostedZoneDeletionStateCode = "SUCCEEDED"
R53HostedZoneDeletionStateCodePending R53HostedZoneDeletionStateCode = "PENDING"
R53HostedZoneDeletionStateCodeFailed R53HostedZoneDeletionStateCode = "FAILED"
R53HostedZoneDeletionStateCodeStarted R53HostedZoneDeletionStateCode = "STARTED"
)
// Values returns all known values for R53HostedZoneDeletionStateCode. 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 (R53HostedZoneDeletionStateCode) Values() []R53HostedZoneDeletionStateCode {
return []R53HostedZoneDeletionStateCode{
"SUCCEEDED",
"PENDING",
"FAILED",
"STARTED",
}
}
type RecordState string
// Enum values for RecordState
const (
RecordStateStarted RecordState = "Started"
RecordStateSucceeded RecordState = "Succeeded"
RecordStateFailed RecordState = "Failed"
)
// Values returns all known values for RecordState. 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 (RecordState) Values() []RecordState {
return []RecordState{
"Started",
"Succeeded",
"Failed",
}
}
type RegionName string
// Enum values for RegionName
const (
RegionNameUsEast1 RegionName = "us-east-1"
RegionNameUsEast2 RegionName = "us-east-2"
RegionNameUsWest1 RegionName = "us-west-1"
RegionNameUsWest2 RegionName = "us-west-2"
RegionNameEuWest1 RegionName = "eu-west-1"
RegionNameEuWest2 RegionName = "eu-west-2"
RegionNameEuWest3 RegionName = "eu-west-3"
RegionNameEuCentral1 RegionName = "eu-central-1"
RegionNameCaCentral1 RegionName = "ca-central-1"
RegionNameApSouth1 RegionName = "ap-south-1"
RegionNameApSoutheast1 RegionName = "ap-southeast-1"
RegionNameApSoutheast2 RegionName = "ap-southeast-2"
RegionNameApNortheast1 RegionName = "ap-northeast-1"
RegionNameApNortheast2 RegionName = "ap-northeast-2"
RegionNameEuNorth1 RegionName = "eu-north-1"
)
// Values returns all known values for RegionName. 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 (RegionName) Values() []RegionName {
return []RegionName{
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2",
"eu-west-1",
"eu-west-2",
"eu-west-3",
"eu-central-1",
"ca-central-1",
"ap-south-1",
"ap-southeast-1",
"ap-southeast-2",
"ap-northeast-1",
"ap-northeast-2",
"eu-north-1",
}
}
type RelationalDatabaseEngine string
// Enum values for RelationalDatabaseEngine
const (
RelationalDatabaseEngineMysql RelationalDatabaseEngine = "mysql"
)
// Values returns all known values for RelationalDatabaseEngine. 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 (RelationalDatabaseEngine) Values() []RelationalDatabaseEngine {
return []RelationalDatabaseEngine{
"mysql",
}
}
type RelationalDatabaseMetricName string
// Enum values for RelationalDatabaseMetricName
const (
RelationalDatabaseMetricNameCPUUtilization RelationalDatabaseMetricName = "CPUUtilization"
RelationalDatabaseMetricNameDatabaseConnections RelationalDatabaseMetricName = "DatabaseConnections"
RelationalDatabaseMetricNameDiskQueueDepth RelationalDatabaseMetricName = "DiskQueueDepth"
RelationalDatabaseMetricNameFreeStorageSpace RelationalDatabaseMetricName = "FreeStorageSpace"
RelationalDatabaseMetricNameNetworkReceiveThroughput RelationalDatabaseMetricName = "NetworkReceiveThroughput"
RelationalDatabaseMetricNameNetworkTransmitThroughput RelationalDatabaseMetricName = "NetworkTransmitThroughput"
)
// Values returns all known values for RelationalDatabaseMetricName. 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 (RelationalDatabaseMetricName) Values() []RelationalDatabaseMetricName {
return []RelationalDatabaseMetricName{
"CPUUtilization",
"DatabaseConnections",
"DiskQueueDepth",
"FreeStorageSpace",
"NetworkReceiveThroughput",
"NetworkTransmitThroughput",
}
}
type RelationalDatabasePasswordVersion string
// Enum values for RelationalDatabasePasswordVersion
const (
RelationalDatabasePasswordVersionCurrent RelationalDatabasePasswordVersion = "CURRENT"
RelationalDatabasePasswordVersionPrevious RelationalDatabasePasswordVersion = "PREVIOUS"
RelationalDatabasePasswordVersionPending RelationalDatabasePasswordVersion = "PENDING"
)
// Values returns all known values for RelationalDatabasePasswordVersion. 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 (RelationalDatabasePasswordVersion) Values() []RelationalDatabasePasswordVersion {
return []RelationalDatabasePasswordVersion{
"CURRENT",
"PREVIOUS",
"PENDING",
}
}
type RenewalStatus string
// Enum values for RenewalStatus
const (
RenewalStatusPendingAutoRenewal RenewalStatus = "PendingAutoRenewal"
RenewalStatusPendingValidation RenewalStatus = "PendingValidation"
RenewalStatusSuccess RenewalStatus = "Success"
RenewalStatusFailed RenewalStatus = "Failed"
)
// Values returns all known values for RenewalStatus. 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 (RenewalStatus) Values() []RenewalStatus {
return []RenewalStatus{
"PendingAutoRenewal",
"PendingValidation",
"Success",
"Failed",
}
}
type ResourceBucketAccess string
// Enum values for ResourceBucketAccess
const (
ResourceBucketAccessAllow ResourceBucketAccess = "allow"
ResourceBucketAccessDeny ResourceBucketAccess = "deny"
)
// Values returns all known values for ResourceBucketAccess. 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 (ResourceBucketAccess) Values() []ResourceBucketAccess {
return []ResourceBucketAccess{
"allow",
"deny",
}
}
type ResourceType string
// Enum values for ResourceType
const (
ResourceTypeContainerService ResourceType = "ContainerService"
ResourceTypeInstance ResourceType = "Instance"
ResourceTypeStaticIp ResourceType = "StaticIp"
ResourceTypeKeyPair ResourceType = "KeyPair"
ResourceTypeInstanceSnapshot ResourceType = "InstanceSnapshot"
ResourceTypeDomain ResourceType = "Domain"
ResourceTypePeeredVpc ResourceType = "PeeredVpc"
ResourceTypeLoadBalancer ResourceType = "LoadBalancer"
ResourceTypeLoadBalancerTlsCertificate ResourceType = "LoadBalancerTlsCertificate"
ResourceTypeDisk ResourceType = "Disk"
ResourceTypeDiskSnapshot ResourceType = "DiskSnapshot"
ResourceTypeRelationalDatabase ResourceType = "RelationalDatabase"
ResourceTypeRelationalDatabaseSnapshot ResourceType = "RelationalDatabaseSnapshot"
ResourceTypeExportSnapshotRecord ResourceType = "ExportSnapshotRecord"
ResourceTypeCloudFormationStackRecord ResourceType = "CloudFormationStackRecord"
ResourceTypeAlarm ResourceType = "Alarm"
ResourceTypeContactMethod ResourceType = "ContactMethod"
ResourceTypeDistribution ResourceType = "Distribution"
ResourceTypeCertificate ResourceType = "Certificate"
ResourceTypeBucket ResourceType = "Bucket"
)
// Values returns all known values for ResourceType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ResourceType) Values() []ResourceType {
return []ResourceType{
"ContainerService",
"Instance",
"StaticIp",
"KeyPair",
"InstanceSnapshot",
"Domain",
"PeeredVpc",
"LoadBalancer",
"LoadBalancerTlsCertificate",
"Disk",
"DiskSnapshot",
"RelationalDatabase",
"RelationalDatabaseSnapshot",
"ExportSnapshotRecord",
"CloudFormationStackRecord",
"Alarm",
"ContactMethod",
"Distribution",
"Certificate",
"Bucket",
}
}
type Status string
// Enum values for Status
const (
StatusStartExpired Status = "startExpired"
StatusNotStarted Status = "notStarted"
StatusStarted Status = "started"
StatusStarting Status = "starting"
StatusStopped Status = "stopped"
StatusStopping Status = "stopping"
StatusSettingUpInstance Status = "settingUpInstance"
StatusFailedInstanceCreation Status = "failedInstanceCreation"
StatusFailedStartingGUISession Status = "failedStartingGUISession"
StatusFailedStoppingGUISession Status = "failedStoppingGUISession"
)
// Values returns all known values for Status. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Status) Values() []Status {
return []Status{
"startExpired",
"notStarted",
"started",
"starting",
"stopped",
"stopping",
"settingUpInstance",
"failedInstanceCreation",
"failedStartingGUISession",
"failedStoppingGUISession",
}
}
type StatusType string
// Enum values for StatusType
const (
StatusTypeActive StatusType = "Active"
StatusTypeInactive StatusType = "Inactive"
)
// Values returns all known values for StatusType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (StatusType) Values() []StatusType {
return []StatusType{
"Active",
"Inactive",
}
}
type TreatMissingData string
// Enum values for TreatMissingData
const (
TreatMissingDataBreaching TreatMissingData = "breaching"
TreatMissingDataNotBreaching TreatMissingData = "notBreaching"
TreatMissingDataIgnore TreatMissingData = "ignore"
TreatMissingDataMissing TreatMissingData = "missing"
)
// Values returns all known values for TreatMissingData. 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 (TreatMissingData) Values() []TreatMissingData {
return []TreatMissingData{
"breaching",
"notBreaching",
"ignore",
"missing",
}
}
| 2,041 |
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"
)
// Lightsail throws this exception when the user cannot be authenticated or uses
// invalid credentials to access a resource.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
Code *string
Docs *string
Tip *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 }
// Lightsail throws this exception when an account is still in the setup in
// progress state.
type AccountSetupInProgressException struct {
Message *string
ErrorCodeOverride *string
Code *string
Docs *string
Tip *string
noSmithyDocumentSerde
}
func (e *AccountSetupInProgressException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccountSetupInProgressException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccountSetupInProgressException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccountSetupInProgressException"
}
return *e.ErrorCodeOverride
}
func (e *AccountSetupInProgressException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Lightsail throws this exception when user input does not conform to the
// validation rules of an input field. Domain and distribution APIs are only
// available in the N. Virginia ( us-east-1 ) Amazon Web Services Region. Please
// set your Amazon Web Services Region configuration to us-east-1 to create, view,
// or edit these resources.
type InvalidInputException struct {
Message *string
ErrorCodeOverride *string
Code *string
Docs *string
Tip *string
noSmithyDocumentSerde
}
func (e *InvalidInputException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidInputException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidInputException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidInputException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Lightsail throws this exception when it cannot find a resource.
type NotFoundException struct {
Message *string
ErrorCodeOverride *string
Code *string
Docs *string
Tip *string
noSmithyDocumentSerde
}
func (e *NotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Lightsail throws this exception when an operation fails to execute.
type OperationFailureException struct {
Message *string
ErrorCodeOverride *string
Code *string
Docs *string
Tip *string
noSmithyDocumentSerde
}
func (e *OperationFailureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *OperationFailureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *OperationFailureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "OperationFailureException"
}
return *e.ErrorCodeOverride
}
func (e *OperationFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// A general service exception.
type ServiceException struct {
Message *string
ErrorCodeOverride *string
Code *string
Docs *string
Tip *string
noSmithyDocumentSerde
}
func (e *ServiceException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Lightsail throws this exception when the user has not been authenticated.
type UnauthenticatedException struct {
Message *string
ErrorCodeOverride *string
Code *string
Docs *string
Tip *string
noSmithyDocumentSerde
}
func (e *UnauthenticatedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnauthenticatedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnauthenticatedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnauthenticatedException"
}
return *e.ErrorCodeOverride
}
func (e *UnauthenticatedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 225 |
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"
)
// Describes an access key for an Amazon Lightsail bucket. Access keys grant full
// programmatic access to the specified bucket and its objects. You can have a
// maximum of two access keys per bucket. Use the CreateBucketAccessKey (https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_CreateBucketAccessKey.html)
// action to create an access key for a specific bucket. For more information about
// access keys, see Creating access keys for a bucket in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-creating-bucket-access-keys)
// in the Amazon Lightsail Developer Guide. The secretAccessKey value is returned
// only in response to the CreateBucketAccessKey action. You can get a secret
// access key only when you first create an access key; you cannot get the secret
// access key later. If you lose the secret access key, you must create a new
// access key.
type AccessKey struct {
// The ID of the access key.
AccessKeyId *string
// The timestamp when the access key was created.
CreatedAt *time.Time
// An object that describes the last time the access key was used. This object
// does not include data in the response of a CreateBucketAccessKey (https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_CreateBucketAccessKey.html)
// action. If the access key has not been used, the region and serviceName values
// are N/A , and the lastUsedDate value is null.
LastUsed *AccessKeyLastUsed
// The secret access key used to sign requests. You should store the secret access
// key in a safe location. We recommend that you delete the access key if the
// secret access key is compromised.
SecretAccessKey *string
// The status of the access key. A status of Active means that the key is valid,
// while Inactive means it is not.
Status StatusType
noSmithyDocumentSerde
}
// Describes the last time an access key was used. This object does not include
// data in the response of a CreateBucketAccessKey (https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_CreateBucketAccessKey.html)
// action.
type AccessKeyLastUsed struct {
// The date and time when the access key was most recently used. This value is
// null if the access key has not been used.
LastUsedDate *time.Time
// The Amazon Web Services Region where this access key was most recently used.
// This value is N/A if the access key has not been used.
Region *string
// The name of the Amazon Web Services service with which this access key was most
// recently used. This value is N/A if the access key has not been used.
ServiceName *string
noSmithyDocumentSerde
}
// Describes the anonymous access permissions for an Amazon Lightsail bucket and
// its objects. For more information about bucket access permissions, see
// Understanding bucket permissions in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-understanding-bucket-permissions)
// in the Amazon Lightsail Developer Guide.
type AccessRules struct {
// A Boolean value that indicates whether the access control list (ACL)
// permissions that are applied to individual objects override the getObject
// option that is currently specified. When this is true, you can use the
// PutObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAcl.html)
// Amazon S3 API action to set individual objects to public (read-only) using the
// public-read ACL, or to private using the private ACL.
AllowPublicOverrides *bool
// Specifies the anonymous access to all objects in a bucket. The following
// options can be specified:
// - public - Sets all objects in the bucket to public (read-only), making them
// readable by anyone in the world. If the getObject value is set to public ,
// then all objects in the bucket default to public regardless of the
// allowPublicOverrides value.
// - private - Sets all objects in the bucket to private, making them readable
// only by you or anyone you give access to. If the getObject value is set to
// private , and the allowPublicOverrides value is set to true , then all objects
// in the bucket default to private unless they are configured with a public-read
// ACL. Individual objects with a public-read ACL are readable by anyone in the
// world.
GetObject AccessType
noSmithyDocumentSerde
}
// Describes the synchronization status of the Amazon Simple Storage Service
// (Amazon S3) account-level block public access (BPA) feature for your Lightsail
// buckets. The account-level BPA feature of Amazon S3 provides centralized
// controls to limit public access to all Amazon S3 buckets in an account. BPA can
// make all Amazon S3 buckets in an Amazon Web Services account private regardless
// of the individual bucket and object permissions that are configured. Lightsail
// buckets take into account the Amazon S3 account-level BPA configuration when
// allowing or denying public access. To do this, Lightsail periodically fetches
// the account-level BPA configuration from Amazon S3. When the account-level BPA
// status is InSync , the Amazon S3 account-level BPA configuration is synchronized
// and it applies to your Lightsail buckets. For more information about Amazon
// Simple Storage Service account-level BPA and how it affects Lightsail buckets,
// see Block public access for buckets in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-block-public-access-for-buckets)
// in the Amazon Lightsail Developer Guide.
type AccountLevelBpaSync struct {
// A Boolean value that indicates whether account-level block public access is
// affecting your Lightsail buckets.
BpaImpactsLightsail *bool
// The timestamp of when the account-level BPA configuration was last
// synchronized. This value is null when the account-level BPA configuration has
// not been synchronized.
LastSyncedAt *time.Time
// A message that provides a reason for a Failed or Defaulted synchronization
// status. The following messages are possible:
// - SYNC_ON_HOLD - The synchronization has not yet happened. This status message
// occurs immediately after you create your first Lightsail bucket. This status
// message should change after the first synchronization happens, approximately 1
// hour after the first bucket is created.
// - DEFAULTED_FOR_SLR_MISSING - The synchronization failed because the required
// service-linked role is missing from your Amazon Web Services account. The
// account-level BPA configuration for your Lightsail buckets is defaulted to
// active until the synchronization can occur. This means that all your buckets are
// private and not publicly accessible. For more information about how to create
// the required service-linked role to allow synchronization, see Using
// Service-Linked Roles for Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-using-service-linked-roles)
// in the Amazon Lightsail Developer Guide.
// - DEFAULTED_FOR_SLR_MISSING_ON_HOLD - The synchronization failed because the
// required service-linked role is missing from your Amazon Web Services account.
// Account-level BPA is not yet configured for your Lightsail buckets. Therefore,
// only the bucket access permissions and individual object access permissions
// apply to your Lightsail buckets. For more information about how to create the
// required service-linked role to allow synchronization, see Using
// Service-Linked Roles for Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-using-service-linked-roles)
// in the Amazon Lightsail Developer Guide.
// - Unknown - The reason that synchronization failed is unknown. Contact Amazon
// Web Services Support for more information.
Message BPAStatusMessage
// The status of the account-level BPA synchronization. The following statuses are
// possible:
// - InSync - Account-level BPA is synchronized. The Amazon S3 account-level BPA
// configuration applies to your Lightsail buckets.
// - NeverSynced - Synchronization has not yet happened. The Amazon S3
// account-level BPA configuration does not apply to your Lightsail buckets.
// - Failed - Synchronization failed. The Amazon S3 account-level BPA
// configuration does not apply to your Lightsail buckets.
// - Defaulted - Synchronization failed and account-level BPA for your Lightsail
// buckets is defaulted to active.
// You might need to complete further actions if the status is Failed or Defaulted
// . The message parameter provides more information for those statuses.
Status AccountLevelBpaSyncStatus
noSmithyDocumentSerde
}
// Describes an add-on that is enabled for an Amazon Lightsail resource.
type AddOn struct {
// The amount of idle time in minutes after which your virtual computer will
// automatically stop. This add-on only applies to Lightsail for Research
// resources.
Duration *string
// The name of the add-on.
Name *string
// The next daily time an automatic snapshot will be created. The time shown is in
// HH:00 format, and in Coordinated Universal Time (UTC). The snapshot is
// automatically created between the time shown and up to 45 minutes after.
NextSnapshotTimeOfDay *string
// The daily time when an automatic snapshot is created. The time shown is in HH:00
// format, and in Coordinated Universal Time (UTC). The snapshot is automatically
// created between the time shown and up to 45 minutes after.
SnapshotTimeOfDay *string
// The status of the add-on.
Status *string
// The trigger threshold of the action. This add-on only applies to Lightsail for
// Research resources.
Threshold *string
noSmithyDocumentSerde
}
// Describes a request to enable, modify, or disable an add-on for an Amazon
// Lightsail resource. An additional cost may be associated with enabling add-ons.
// For more information, see the Lightsail pricing page (https://aws.amazon.com/lightsail/pricing/)
// .
type AddOnRequest struct {
// The add-on type.
//
// This member is required.
AddOnType AddOnType
// An object that represents additional parameters when enabling or modifying the
// automatic snapshot add-on.
AutoSnapshotAddOnRequest *AutoSnapshotAddOnRequest
// An object that represents additional parameters when enabling or modifying the
// StopInstanceOnIdle add-on. This object only applies to Lightsail for Research
// resources.
StopInstanceOnIdleRequest *StopInstanceOnIdleRequest
noSmithyDocumentSerde
}
// Describes an alarm. An alarm is a way to monitor your Lightsail resource
// metrics. For more information, see Alarms in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-alarms)
// .
type Alarm struct {
// The Amazon Resource Name (ARN) of the alarm.
Arn *string
// The arithmetic operation used when comparing the specified statistic and
// threshold.
ComparisonOperator ComparisonOperator
// The contact protocols for the alarm, such as Email , SMS (text messaging), or
// both.
ContactProtocols []ContactProtocol
// The timestamp when the alarm was created.
CreatedAt *time.Time
// The number of data points that must not within the specified threshold to
// trigger the alarm.
DatapointsToAlarm *int32
// The number of periods over which data is compared to the specified threshold.
EvaluationPeriods *int32
// An object that lists information about the location of the alarm.
Location *ResourceLocation
// The name of the metric associated with the alarm.
MetricName MetricName
// An object that lists information about the resource monitored by the alarm.
MonitoredResourceInfo *MonitoredResourceInfo
// The name of the alarm.
Name *string
// Indicates whether the alarm is enabled.
NotificationEnabled *bool
// The alarm states that trigger a notification.
NotificationTriggers []AlarmState
// The period, in seconds, over which the statistic is applied.
Period int32
// The Lightsail resource type (e.g., Alarm ).
ResourceType ResourceType
// The current state of the alarm. An alarm has the following possible states:
// - ALARM - The metric is outside of the defined threshold.
// - INSUFFICIENT_DATA - The alarm has just started, the metric is not available,
// or not enough data is available for the metric to determine the alarm state.
// - OK - The metric is within the defined threshold.
State AlarmState
// The statistic for the metric associated with the alarm. The following
// statistics are available:
// - Minimum - The lowest value observed during the specified period. Use this
// value to determine low volumes of activity for your application.
// - Maximum - The highest value observed during the specified period. Use this
// value to determine high volumes of activity for your application.
// - Sum - All values submitted for the matching metric added together. You can
// use this statistic to determine the total volume of a metric.
// - Average - The value of Sum / SampleCount during the specified period. By
// comparing this statistic with the Minimum and Maximum values, you can determine
// the full scope of a metric and how close the average use is to the Minimum and
// Maximum values. This comparison helps you to know when to increase or decrease
// your resources.
// - SampleCount - The count, or number, of data points used for the statistical
// calculation.
Statistic MetricStatistic
// The support code. Include this code in your email to support when you have
// questions about your Lightsail alarm. This code enables our support team to look
// up your Lightsail information more easily.
SupportCode *string
// The value against which the specified statistic is compared.
Threshold *float64
// Specifies how the alarm handles missing data points. An alarm can treat missing
// data in the following ways:
// - breaching - Assume the missing data is not within the threshold. Missing
// data counts towards the number of times the metric is not within the threshold.
// - notBreaching - Assume the missing data is within the threshold. Missing data
// does not count towards the number of times the metric is not within the
// threshold.
// - ignore - Ignore the missing data. Maintains the current alarm state.
// - missing - Missing data is treated as missing.
TreatMissingData TreatMissingData
// The unit of the metric associated with the alarm.
Unit MetricUnit
noSmithyDocumentSerde
}
// Describes a block storage disk that is attached to an instance, and is included
// in an automatic snapshot.
type AttachedDisk struct {
// The path of the disk (e.g., /dev/xvdf ).
Path *string
// The size of the disk in GB.
SizeInGb *int32
noSmithyDocumentSerde
}
// Describes a request to enable or modify the automatic snapshot add-on for an
// Amazon Lightsail instance or disk. When you modify the automatic snapshot time
// for a resource, it is typically effective immediately except under the following
// conditions:
// - If an automatic snapshot has been created for the current day, and you
// change the snapshot time to a later time of day, then the new snapshot time will
// be effective the following day. This ensures that two snapshots are not created
// for the current day.
// - If an automatic snapshot has not yet been created for the current day, and
// you change the snapshot time to an earlier time of day, then the new snapshot
// time will be effective the following day and a snapshot is automatically created
// at the previously set time for the current day. This ensures that a snapshot is
// created for the current day.
// - If an automatic snapshot has not yet been created for the current day, and
// you change the snapshot time to a time that is within 30 minutes from your
// current time, then the new snapshot time will be effective the following day and
// a snapshot is automatically created at the previously set time for the current
// day. This ensures that a snapshot is created for the current day, because 30
// minutes is required between your current time and the new snapshot time that you
// specify.
// - If an automatic snapshot is scheduled to be created within 30 minutes from
// your current time and you change the snapshot time, then the new snapshot time
// will be effective the following day and a snapshot is automatically created at
// the previously set time for the current day. This ensures that a snapshot is
// created for the current day, because 30 minutes is required between your current
// time and the new snapshot time that you specify.
type AutoSnapshotAddOnRequest struct {
// The daily time when an automatic snapshot will be created. Constraints:
// - Must be in HH:00 format, and in an hourly increment.
// - Specified in Coordinated Universal Time (UTC).
// - The snapshot will be automatically created between the time specified and
// up to 45 minutes after.
SnapshotTimeOfDay *string
noSmithyDocumentSerde
}
// Describes an automatic snapshot.
type AutoSnapshotDetails struct {
// The timestamp when the automatic snapshot was created.
CreatedAt *time.Time
// The date of the automatic snapshot in YYYY-MM-DD format.
Date *string
// An array of objects that describe the block storage disks attached to the
// instance when the automatic snapshot was created.
FromAttachedDisks []AttachedDisk
// The status of the automatic snapshot.
Status AutoSnapshotStatus
noSmithyDocumentSerde
}
// Describes an Availability Zone. This is returned only as part of a GetRegions
// request.
type AvailabilityZone struct {
// The state of the Availability Zone.
State *string
// The name of the Availability Zone. The format is us-east-2a (case-sensitive).
ZoneName *string
noSmithyDocumentSerde
}
// Describes a blueprint (a virtual private server image).
type Blueprint struct {
// Virtual computer blueprints that are supported by Lightsail for Research. This
// parameter only applies to Lightsail for Research resources.
AppCategory AppCategory
// The ID for the virtual private server image (e.g., app_wordpress_4_4 or
// app_lamp_7_0 ).
BlueprintId *string
// The description of the blueprint.
Description *string
// The group name of the blueprint (e.g., amazon-linux ).
Group *string
// A Boolean value indicating whether the blueprint is active. Inactive blueprints
// are listed to support customers with existing instances but are not necessarily
// available for launch of new instances. Blueprints are marked inactive when they
// become outdated due to operating system updates or new application releases.
IsActive *bool
// The end-user license agreement URL for the image or blueprint.
LicenseUrl *string
// The minimum bundle power required to run this blueprint. For example, you need
// a bundle with a power value of 500 or more to create an instance that uses a
// blueprint with a minimum power value of 500. 0 indicates that the blueprint
// runs on all instance sizes.
MinPower *int32
// The friendly name of the blueprint (e.g., Amazon Linux ).
Name *string
// The operating system platform (either Linux/Unix-based or Windows Server-based)
// of the blueprint.
Platform InstancePlatform
// The product URL to learn more about the image or blueprint.
ProductUrl *string
// The type of the blueprint (e.g., os or app ).
Type BlueprintType
// The version number of the operating system, application, or stack (e.g.,
// 2016.03.0 ).
Version *string
// The version code.
VersionCode *string
noSmithyDocumentSerde
}
// Describes an Amazon Lightsail bucket.
type Bucket struct {
// Indicates whether the bundle that is currently applied to a bucket can be
// changed to another bundle. You can update a bucket's bundle only one time within
// a monthly Amazon Web Services billing cycle. Use the UpdateBucketBundle (https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html)
// action to change a bucket's bundle.
AbleToUpdateBundle *bool
// An object that describes the access log configuration for the bucket.
AccessLogConfig *BucketAccessLogConfig
// An object that describes the access rules of the bucket.
AccessRules *AccessRules
// The Amazon Resource Name (ARN) of the bucket.
Arn *string
// The ID of the bundle currently applied to the bucket. A bucket bundle specifies
// the monthly cost, storage space, and data transfer quota for a bucket. Use the
// UpdateBucketBundle (https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_UpdateBucketBundle.html)
// action to change the bundle of a bucket.
BundleId *string
// The timestamp when the distribution was created.
CreatedAt *time.Time
// An object that describes the location of the bucket, such as the Amazon Web
// Services Region and Availability Zone.
Location *ResourceLocation
// The name of the bucket.
Name *string
// Indicates whether object versioning is enabled for the bucket. The following
// options can be configured:
// - Enabled - Object versioning is enabled.
// - Suspended - Object versioning was previously enabled but is currently
// suspended. Existing object versions are retained.
// - NeverEnabled - Object versioning has never been enabled.
ObjectVersioning *string
// An array of strings that specify the Amazon Web Services account IDs that have
// read-only access to the bucket.
ReadonlyAccessAccounts []string
// The Lightsail resource type of the bucket (for example, Bucket ).
ResourceType *string
// An array of objects that describe Lightsail instances that have access to the
// bucket. Use the SetResourceAccessForBucket (https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_SetResourceAccessForBucket.html)
// action to update the instances that have access to a bucket.
ResourcesReceivingAccess []ResourceReceivingAccess
// An object that describes the state of the bucket.
State *BucketState
// The support code for a bucket. Include this code in your email to support when
// you have questions about a Lightsail bucket. This code enables our support team
// to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the bucket. For more information, see Tags
// in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-tags)
// in the Amazon Lightsail Developer Guide.
Tags []Tag
// The URL of the bucket.
Url *string
noSmithyDocumentSerde
}
// Describes the access log configuration for a bucket in the Amazon Lightsail
// object storage service. For more information about bucket access logs, see
// Logging bucket requests using access logging in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-bucket-access-logs)
// in the Amazon Lightsail Developer Guide.
type BucketAccessLogConfig struct {
// A Boolean value that indicates whether bucket access logging is enabled for the
// bucket.
//
// This member is required.
Enabled *bool
// The name of the bucket where the access logs are saved. The destination can be
// a Lightsail bucket in the same account, and in the same Amazon Web Services
// Region as the source bucket. This parameter is required when enabling the access
// log for a bucket, and should be omitted when disabling the access log.
Destination *string
// The optional object prefix for the bucket access log. The prefix is an optional
// addition to the object key that organizes your access log files in the
// destination bucket. For example, if you specify a logs/ prefix, then each log
// object will begin with the logs/ prefix in its key (for example,
// logs/2021-11-01-21-32-16-E568B2907131C0C0 ). This parameter can be optionally
// specified when enabling the access log for a bucket, and should be omitted when
// disabling the access log.
Prefix *string
noSmithyDocumentSerde
}
// Describes the specifications of a bundle that can be applied to an Amazon
// Lightsail bucket. A bucket bundle specifies the monthly cost, storage space, and
// data transfer quota for a bucket.
type BucketBundle struct {
// The ID of the bundle.
BundleId *string
// Indicates whether the bundle is active. Use for a new or existing bucket.
IsActive *bool
// The name of the bundle.
Name *string
// The monthly price of the bundle, in US dollars.
Price *float32
// The storage size of the bundle, in GB.
StoragePerMonthInGb *int32
// The monthly network transfer quota of the bundle.
TransferPerMonthInGb *int32
noSmithyDocumentSerde
}
// Describes the state of an Amazon Lightsail bucket.
type BucketState struct {
// The state code of the bucket. The following codes are possible:
// - OK - The bucket is in a running state.
// - Unknown - Creation of the bucket might have timed-out. You might want to
// delete the bucket and create a new one.
Code *string
// A message that describes the state of the bucket.
Message *string
noSmithyDocumentSerde
}
// Describes a bundle, which is a set of specs describing your virtual private
// server (or instance).
type Bundle struct {
// The bundle ID (e.g., micro_1_0 ).
BundleId *string
// The number of vCPUs included in the bundle (e.g., 2 ).
CpuCount *int32
// The size of the SSD (e.g., 30 ).
DiskSizeInGb *int32
// The Amazon EC2 instance type (e.g., t2.micro ).
InstanceType *string
// A Boolean value indicating whether the bundle is active.
IsActive *bool
// A friendly name for the bundle (e.g., Micro ).
Name *string
// A numeric value that represents the power of the bundle (e.g., 500 ). You can
// use the bundle's power value in conjunction with a blueprint's minimum power
// value to determine whether the blueprint will run on the bundle. For example,
// you need a bundle with a power value of 500 or more to create an instance that
// uses a blueprint with a minimum power value of 500.
Power *int32
// The price in US dollars (e.g., 5.0 ) of the bundle.
Price *float32
// The amount of RAM in GB (e.g., 2.0 ).
RamSizeInGb *float32
// Virtual computer blueprints that are supported by a Lightsail for Research
// bundle. This parameter only applies to Lightsail for Research resources.
SupportedAppCategories []AppCategory
// The operating system platform (Linux/Unix-based or Windows Server-based) that
// the bundle supports. You can only launch a WINDOWS bundle on a blueprint that
// supports the WINDOWS platform. LINUX_UNIX blueprints require a LINUX_UNIX
// bundle.
SupportedPlatforms []InstancePlatform
// The data transfer rate per month in GB (e.g., 2000 ).
TransferPerMonthInGb *int32
noSmithyDocumentSerde
}
// Describes the default cache behavior of an Amazon Lightsail content delivery
// network (CDN) distribution.
type CacheBehavior struct {
// The cache behavior of the distribution. The following cache behaviors can be
// specified:
// - cache - This option is best for static sites. When specified, your
// distribution caches and serves your entire website as static content. This
// behavior is ideal for websites with static content that doesn't change depending
// on who views it, or for websites that don't use cookies, headers, or query
// strings to personalize content.
// - dont-cache - This option is best for sites that serve a mix of static and
// dynamic content. When specified, your distribution caches and serve only the
// content that is specified in the distribution's CacheBehaviorPerPath
// parameter. This behavior is ideal for websites or web applications that use
// cookies, headers, and query strings to personalize content for individual users.
Behavior BehaviorEnum
noSmithyDocumentSerde
}
// Describes the per-path cache behavior of an Amazon Lightsail content delivery
// network (CDN) distribution. A per-path cache behavior is used to override, or
// add an exception to, the default cache behavior of a distribution. For example,
// if the cacheBehavior is set to cache , then a per-path cache behavior can be
// used to specify a directory, file, or file type that your distribution will
// cache. Alternately, if the distribution's cacheBehavior is dont-cache , then a
// per-path cache behavior can be used to specify a directory, file, or file type
// that your distribution will not cache.
type CacheBehaviorPerPath struct {
// The cache behavior for the specified path. You can specify one of the following
// per-path cache behaviors:
// - cache - This behavior caches the specified path.
// - dont-cache - This behavior doesn't cache the specified path.
Behavior BehaviorEnum
// The path to a directory or file to cached, or not cache. Use an asterisk symbol
// to specify wildcard directories ( path/to/assets/* ), and file types ( *.html,
// *jpg, *js ). Directories and file paths are case-sensitive. Examples:
// - Specify the following to cache all files in the document root of an Apache
// web server running on a Lightsail instance. var/www/html/
// - Specify the following file to cache only the index page in the document
// root of an Apache web server. var/www/html/index.html
// - Specify the following to cache only the .html files in the document root of
// an Apache web server. var/www/html/*.html
// - Specify the following to cache only the .jpg, .png, and .gif files in the
// images sub-directory of the document root of an Apache web server.
// var/www/html/images/*.jpg var/www/html/images/*.png var/www/html/images/*.gif
// Specify the following to cache all files in the images sub-directory of the
// document root of an Apache web server. var/www/html/images/
Path *string
noSmithyDocumentSerde
}
// Describes the cache settings of an Amazon Lightsail content delivery network
// (CDN) distribution. These settings apply only to your distribution's
// cacheBehaviors (including the defaultCacheBehavior ) that have a behavior of
// cache .
type CacheSettings struct {
// The HTTP methods that are processed and forwarded to the distribution's origin.
// You can specify the following options:
// - GET,HEAD - The distribution forwards the GET and HEAD methods.
// - GET,HEAD,OPTIONS - The distribution forwards the GET , HEAD , and OPTIONS
// methods.
// - GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards the GET ,
// HEAD , OPTIONS , PUT , PATCH , POST , and DELETE methods.
// If you specify the third option, you might need to restrict access to your
// distribution's origin so users can't perform operations that you don't want them
// to. For example, you might not want users to have permission to delete objects
// from your origin.
AllowedHTTPMethods *string
// The HTTP method responses that are cached by your distribution. You can specify
// the following options:
// - GET,HEAD - The distribution caches responses to the GET and HEAD methods.
// - GET,HEAD,OPTIONS - The distribution caches responses to the GET , HEAD , and
// OPTIONS methods.
CachedHTTPMethods *string
// The default amount of time that objects stay in the distribution's cache before
// the distribution forwards another request to the origin to determine whether the
// content has been updated. The value specified applies only when the origin does
// not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage ,
// and Expires to objects.
DefaultTTL *int64
// An object that describes the cookies that are forwarded to the origin. Your
// content is cached based on the cookies that are forwarded.
ForwardedCookies *CookieObject
// An object that describes the headers that are forwarded to the origin. Your
// content is cached based on the headers that are forwarded.
ForwardedHeaders *HeaderObject
// An object that describes the query strings that are forwarded to the origin.
// Your content is cached based on the query strings that are forwarded.
ForwardedQueryStrings *QueryStringObject
// The maximum amount of time that objects stay in the distribution's cache before
// the distribution forwards another request to the origin to determine whether the
// object has been updated. The value specified applies only when the origin adds
// HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and
// Expires to objects.
MaximumTTL *int64
// The minimum amount of time that objects stay in the distribution's cache before
// the distribution forwards another request to the origin to determine whether the
// object has been updated. A value of 0 must be specified for minimumTTL if the
// distribution is configured to forward all headers to the origin.
MinimumTTL *int64
noSmithyDocumentSerde
}
// Describes the full details of an Amazon Lightsail SSL/TLS certificate. To get a
// summary of a certificate, use the GetCertificates action and omit
// includeCertificateDetails from your request. The response will include only the
// certificate Amazon Resource Name (ARN), certificate name, domain name, and tags.
type Certificate struct {
// The Amazon Resource Name (ARN) of the certificate.
Arn *string
// The timestamp when the certificate was created.
CreatedAt *time.Time
// The domain name of the certificate.
DomainName *string
// An array of objects that describe the domain validation records of the
// certificate.
DomainValidationRecords []DomainValidationRecord
// The renewal eligibility of the certificate.
EligibleToRenew *string
// The number of Lightsail resources that the certificate is attached to.
InUseResourceCount int32
// The timestamp when the certificate was issued.
IssuedAt *time.Time
// The certificate authority that issued the certificate.
IssuerCA *string
// The algorithm used to generate the key pair (the public and private key) of the
// certificate.
KeyAlgorithm *string
// The name of the certificate (e.g., my-certificate ).
Name *string
// The timestamp when the certificate expires.
NotAfter *time.Time
// The timestamp when the certificate is first valid.
NotBefore *time.Time
// An object that describes the status of the certificate renewal managed by
// Lightsail.
RenewalSummary *RenewalSummary
// The validation failure reason, if any, of the certificate. The following
// failure reasons are possible:
// - NO_AVAILABLE_CONTACTS - This failure applies to email validation, which is
// not available for Lightsail certificates.
// - ADDITIONAL_VERIFICATION_REQUIRED - Lightsail requires additional information
// to process this certificate request. This can happen as a fraud-protection
// measure, such as when the domain ranks within the Alexa top 1000 websites. To
// provide the required information, use the Amazon Web Services Support Center (https://console.aws.amazon.com/support/home)
// to contact Amazon Web Services Support. You cannot request a certificate for
// Amazon-owned domain names such as those ending in amazonaws.com, cloudfront.net,
// or elasticbeanstalk.com.
// - DOMAIN_NOT_ALLOWED - One or more of the domain names in the certificate
// request was reported as an unsafe domain by VirusTotal (https://www.virustotal.com/gui/home/url)
// . To correct the problem, search for your domain name on the VirusTotal (https://www.virustotal.com/gui/home/url)
// website. If your domain is reported as suspicious, see Google Help for Hacked
// Websites (https://developers.google.com/web/fundamentals/security/hacked) to
// learn what you can do. If you believe that the result is a false positive,
// notify the organization that is reporting the domain. VirusTotal is an aggregate
// of several antivirus and URL scanners and cannot remove your domain from a block
// list itself. After you correct the problem and the VirusTotal registry has been
// updated, request a new certificate. If you see this error and your domain is not
// included in the VirusTotal list, visit the Amazon Web Services Support Center (https://console.aws.amazon.com/support/home)
// and create a case.
// - INVALID_PUBLIC_DOMAIN - One or more of the domain names in the certificate
// request is not valid. Typically, this is because a domain name in the request is
// not a valid top-level domain. Try to request a certificate again, correcting any
// spelling errors or typos that were in the failed request, and ensure that all
// domain names in the request are for valid top-level domains. For example, you
// cannot request a certificate for example.invalidpublicdomain because
// invalidpublicdomain is not a valid top-level domain.
// - OTHER - Typically, this failure occurs when there is a typographical error
// in one or more of the domain names in the certificate request. Try to request a
// certificate again, correcting any spelling errors or typos that were in the
// failed request.
RequestFailureReason *string
// The reason the certificate was revoked. This value is present only when the
// certificate status is REVOKED .
RevocationReason *string
// The timestamp when the certificate was revoked. This value is present only when
// the certificate status is REVOKED .
RevokedAt *time.Time
// The serial number of the certificate.
SerialNumber *string
// The validation status of the certificate.
Status CertificateStatus
// An array of strings that specify the alternate domains (e.g., example2.com ) and
// subdomains (e.g., blog.example.com ) of the certificate.
SubjectAlternativeNames []string
// The support code. Include this code in your email to support when you have
// questions about your Lightsail certificate. This code enables our support team
// to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes an Amazon Lightsail SSL/TLS certificate.
type CertificateSummary struct {
// The Amazon Resource Name (ARN) of the certificate.
CertificateArn *string
// An object that describes a certificate in detail.
CertificateDetail *Certificate
// The name of the certificate.
CertificateName *string
// The domain name of the certificate.
DomainName *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes a CloudFormation stack record created as a result of the create cloud
// formation stack action. A CloudFormation stack record provides information about
// the AWS CloudFormation stack used to create a new Amazon Elastic Compute Cloud
// instance from an exported Lightsail instance snapshot.
type CloudFormationStackRecord struct {
// The Amazon Resource Name (ARN) of the CloudFormation stack record.
Arn *string
// The date when the CloudFormation stack record was created.
CreatedAt *time.Time
// A list of objects describing the destination service, which is AWS
// CloudFormation, and the Amazon Resource Name (ARN) of the AWS CloudFormation
// stack.
DestinationInfo *DestinationInfo
// A list of objects describing the Availability Zone and Amazon Web Services
// Region of the CloudFormation stack record.
Location *ResourceLocation
// The name of the CloudFormation stack record. It starts with
// CloudFormationStackRecord followed by a GUID.
Name *string
// The Lightsail resource type (e.g., CloudFormationStackRecord ).
ResourceType ResourceType
// A list of objects describing the source of the CloudFormation stack record.
SourceInfo []CloudFormationStackRecordSourceInfo
// The current state of the CloudFormation stack record.
State RecordState
noSmithyDocumentSerde
}
// Describes the source of a CloudFormation stack record (i.e., the export
// snapshot record).
type CloudFormationStackRecordSourceInfo struct {
// The Amazon Resource Name (ARN) of the export snapshot record.
Arn *string
// The name of the record.
Name *string
// The Lightsail resource type (e.g., ExportSnapshotRecord ).
ResourceType CloudFormationStackRecordSourceType
noSmithyDocumentSerde
}
// Describes a contact method. A contact method is a way to send you
// notifications. For more information, see Notifications in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-notifications)
// .
type ContactMethod struct {
// The Amazon Resource Name (ARN) of the contact method.
Arn *string
// The destination of the contact method, such as an email address or a mobile
// phone number.
ContactEndpoint *string
// The timestamp when the contact method was created.
CreatedAt *time.Time
// An object that describes the location of the contact method, such as the Amazon
// Web Services Region and Availability Zone.
Location *ResourceLocation
// The name of the contact method.
Name *string
// The protocol of the contact method, such as email or SMS (text messaging).
Protocol ContactProtocol
// The Lightsail resource type (e.g., ContactMethod ).
ResourceType ResourceType
// The current status of the contact method. A contact method has the following
// possible status:
// - PendingVerification - The contact method has not yet been verified, and the
// verification has not yet expired.
// - Valid - The contact method has been verified.
// - InValid - An attempt was made to verify the contact method, but the
// verification has expired.
Status ContactMethodStatus
// The support code. Include this code in your email to support when you have
// questions about your Lightsail contact method. This code enables our support
// team to look up your Lightsail information more easily.
SupportCode *string
noSmithyDocumentSerde
}
// Describes the settings of a container that will be launched, or that is
// launched, to an Amazon Lightsail container service.
type Container struct {
// The launch command for the container.
Command []string
// The environment variables of the container.
Environment map[string]string
// The name of the image used for the container. Container images sourced from
// your Lightsail container service, that are registered and stored on your
// service, start with a colon ( : ). For example, if your container service name
// is container-service-1 , the container image label is mystaticsite , and you
// want to use the third ( 3 ) version of the registered container image, then you
// should specify :container-service-1.mystaticsite.3 . To use the latest version
// of a container image, specify latest instead of a version number (for example,
// :container-service-1.mystaticsite.latest ). Lightsail will automatically use the
// highest numbered version of the registered container image. Container images
// sourced from a public registry like Docker Hub don't start with a colon. For
// example, nginx:latest or nginx .
Image *string
// The open firewall ports of the container.
Ports map[string]ContainerServiceProtocol
noSmithyDocumentSerde
}
// Describes a container image that is registered to an Amazon Lightsail container
// service.
type ContainerImage struct {
// The timestamp when the container image was created.
CreatedAt *time.Time
// The digest of the container image.
Digest *string
// The name of the container image.
Image *string
noSmithyDocumentSerde
}
// Describes an Amazon Lightsail container service.
type ContainerService struct {
// The Amazon Resource Name (ARN) of the container service.
Arn *string
// The name of the container service.
ContainerServiceName *string
// The timestamp when the container service was created.
CreatedAt *time.Time
// An object that describes the current container deployment of the container
// service.
CurrentDeployment *ContainerServiceDeployment
// A Boolean value indicating whether the container service is disabled.
IsDisabled *bool
// An object that describes the location of the container service, such as the
// Amazon Web Services Region and Availability Zone.
Location *ResourceLocation
// An object that describes the next deployment of the container service. This
// value is null when there is no deployment in a pending state.
NextDeployment *ContainerServiceDeployment
// The power specification of the container service. The power specifies the
// amount of RAM, the number of vCPUs, and the base price of the container service.
Power ContainerServicePowerName
// The ID of the power of the container service.
PowerId *string
// The principal ARN of the container service. The principal ARN can be used to
// create a trust relationship between your standard Amazon Web Services account
// and your Lightsail container service. This allows you to give your service
// permission to access resources in your standard Amazon Web Services account.
PrincipalArn *string
// The private domain name of the container service. The private domain name is
// accessible only by other resources within the default virtual private cloud
// (VPC) of your Lightsail account.
PrivateDomainName *string
// An object that describes the configuration for the container service to access
// private container image repositories, such as Amazon Elastic Container Registry
// (Amazon ECR) private repositories. For more information, see Configuring access
// to an Amazon ECR private repository for an Amazon Lightsail container service (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-container-service-ecr-private-repo-access)
// in the Amazon Lightsail Developer Guide.
PrivateRegistryAccess *PrivateRegistryAccess
// The public domain name of the container service, such as example.com and
// www.example.com . You can specify up to four public domain names for a container
// service. The domain names that you specify are used when you create a deployment
// with a container configured as the public endpoint of your container service. If
// you don't specify public domain names, then you can use the default domain of
// the container service. You must create and validate an SSL/TLS certificate
// before you can use public domain names with your container service. Use the
// CreateCertificate action to create a certificate for the public domain names you
// want to use with your container service. See CreateContainerService or
// UpdateContainerService for information about how to specify public domain names
// for your Lightsail container service.
PublicDomainNames map[string][]string
// The Lightsail resource type of the container service (i.e., ContainerService ).
ResourceType ResourceType
// The scale specification of the container service. The scale specifies the
// allocated compute nodes of the container service.
Scale *int32
// The current state of the container service. The following container service
// states are possible:
// - PENDING - The container service is being created.
// - READY - The container service is running but it does not have an active
// container deployment.
// - DEPLOYING - The container service is launching a container deployment.
// - RUNNING - The container service is running and it has an active container
// deployment.
// - UPDATING - The container service capacity or its custom domains are being
// updated.
// - DELETING - The container service is being deleted.
// - DISABLED - The container service is disabled, and its active deployment and
// containers, if any, are shut down.
State ContainerServiceState
// An object that describes the current state of the container service. The state
// detail is populated only when a container service is in a PENDING , DEPLOYING ,
// or UPDATING state.
StateDetail *ContainerServiceStateDetail
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
// The publicly accessible URL of the container service. If no public endpoint is
// specified in the currentDeployment , this URL returns a 404 response.
Url *string
noSmithyDocumentSerde
}
// Describes a container deployment configuration of an Amazon Lightsail container
// service. A deployment specifies the settings, such as the ports and launch
// command, of containers that are deployed to your container service.
type ContainerServiceDeployment struct {
// An object that describes the configuration for the containers of the deployment.
Containers map[string]Container
// The timestamp when the deployment was created.
CreatedAt *time.Time
// An object that describes the endpoint of the deployment.
PublicEndpoint *ContainerServiceEndpoint
// The state of the deployment. A deployment can be in one of the following
// states:
// - Activating - The deployment is being created.
// - Active - The deployment was successfully created, and it's currently running
// on the container service. The container service can have only one deployment in
// an active state at a time.
// - Inactive - The deployment was previously successfully created, but it is not
// currently running on the container service.
// - Failed - The deployment failed. Use the GetContainerLog action to view the
// log events for the containers in the deployment to try to determine the reason
// for the failure.
State ContainerServiceDeploymentState
// The version number of the deployment.
Version *int32
noSmithyDocumentSerde
}
// Describes a container deployment configuration of an Amazon Lightsail container
// service. A deployment specifies the settings, such as the ports and launch
// command, of containers that are deployed to your container service.
type ContainerServiceDeploymentRequest struct {
// An object that describes the configuration for the containers of the deployment.
Containers map[string]Container
// An object that describes the endpoint of the deployment.
PublicEndpoint *EndpointRequest
noSmithyDocumentSerde
}
// Describes the activation status of the role that you can use to grant an Amazon
// Lightsail container service access to Amazon Elastic Container Registry (Amazon
// ECR) private repositories. When activated, Lightsail creates an Identity and
// Access Management (IAM) role for the specified Lightsail container service. You
// can use the ARN of the role to create a trust relationship between your
// Lightsail container service and an Amazon ECR private repository in your Amazon
// Web Services account. This allows your container service to pull images from
// Amazon ECR private repositories. For more information, see Configuring access
// to an Amazon ECR private repository for an Amazon Lightsail container service (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-container-service-ecr-private-repo-access)
// in the Amazon Lightsail Developer Guide.
type ContainerServiceECRImagePullerRole struct {
// A Boolean value that indicates whether the role is activated.
IsActive *bool
// The Amazon Resource Name (ARN) of the role, if it is activated.
PrincipalArn *string
noSmithyDocumentSerde
}
// Describes a request to activate or deactivate the role that you can use to
// grant an Amazon Lightsail container service access to Amazon Elastic Container
// Registry (Amazon ECR) private repositories. When activated, Lightsail creates an
// Identity and Access Management (IAM) role for the specified Lightsail container
// service. You can use the ARN of the role to create a trust relationship between
// your Lightsail container service and an Amazon ECR private repository in your
// Amazon Web Services account. This allows your container service to pull images
// from Amazon ECR private repositories. For more information, see Configuring
// access to an Amazon ECR private repository for an Amazon Lightsail container
// service (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-container-service-ecr-private-repo-access)
// in the Amazon Lightsail Developer Guide.
type ContainerServiceECRImagePullerRoleRequest struct {
// A Boolean value that indicates whether to activate the role.
IsActive *bool
noSmithyDocumentSerde
}
// Describes the public endpoint configuration of a deployment of an Amazon
// Lightsail container service.
type ContainerServiceEndpoint struct {
// The name of the container entry of the deployment that the endpoint
// configuration applies to.
ContainerName *string
// The port of the specified container to which traffic is forwarded to.
ContainerPort *int32
// An object that describes the health check configuration of the container.
HealthCheck *ContainerServiceHealthCheckConfig
noSmithyDocumentSerde
}
// Describes the health check configuration of an Amazon Lightsail container
// service.
type ContainerServiceHealthCheckConfig struct {
// The number of consecutive health checks successes required before moving the
// container to the Healthy state. The default value is 2 .
HealthyThreshold *int32
// The approximate interval, in seconds, between health checks of an individual
// container. You can specify between 5 and 300 seconds. The default value is 5 .
IntervalSeconds *int32
// The path on the container on which to perform the health check. The default
// value is / .
Path *string
// The HTTP codes to use when checking for a successful response from a container.
// You can specify values between 200 and 499 . You can specify multiple values
// (for example, 200,202 ) or a range of values (for example, 200-299 ).
SuccessCodes *string
// The amount of time, in seconds, during which no response means a failed health
// check. You can specify between 2 and 60 seconds. The default value is 2 .
TimeoutSeconds *int32
// The number of consecutive health check failures required before moving the
// container to the Unhealthy state. The default value is 2 .
UnhealthyThreshold *int32
noSmithyDocumentSerde
}
// Describes the log events of a container of an Amazon Lightsail container
// service.
type ContainerServiceLogEvent struct {
// The timestamp when the container service log event was created.
CreatedAt *time.Time
// The message of the container service log event.
Message *string
noSmithyDocumentSerde
}
// Describes the powers that can be specified for an Amazon Lightsail container
// service. The power specifies the amount of RAM, the number of vCPUs, and the
// base price of the container service.
type ContainerServicePower struct {
// The number of vCPUs included in the power.
CpuCount *float32
// A Boolean value indicating whether the power is active and can be specified for
// container services.
IsActive *bool
// The friendly name of the power (e.g., nano ).
Name *string
// The ID of the power (e.g., nano-1 ).
PowerId *string
// The monthly price of the power in USD.
Price *float32
// The amount of RAM (in GB) of the power.
RamSizeInGb *float32
noSmithyDocumentSerde
}
// Describes the sign-in credentials for the container image registry of an Amazon
// Lightsail account.
type ContainerServiceRegistryLogin struct {
// The timestamp of when the container image registry sign-in credentials expire.
// The log in credentials expire 12 hours after they are created, at which point
// you will need to create a new set of log in credentials using the
// CreateContainerServiceRegistryLogin action.
ExpiresAt *time.Time
// The container service registry password to use to push container images to the
// container image registry of a Lightsail account
Password *string
// The address to use to push container images to the container image registry of
// a Lightsail account.
Registry *string
// The container service registry username to use to push container images to the
// container image registry of a Lightsail account.
Username *string
noSmithyDocumentSerde
}
// Describes the current state of a container service.
type ContainerServiceStateDetail struct {
// The state code of the container service. The following state codes are
// possible:
// - The following state codes are possible if your container service is in a
// DEPLOYING or UPDATING state:
// - CREATING_SYSTEM_RESOURCES - The system resources for your container service
// are being created.
// - CREATING_NETWORK_INFRASTRUCTURE - The network infrastructure for your
// container service are being created.
// - PROVISIONING_CERTIFICATE - The SSL/TLS certificate for your container
// service is being created.
// - PROVISIONING_SERVICE - Your container service is being provisioned.
// - CREATING_DEPLOYMENT - Your deployment is being created on your container
// service.
// - EVALUATING_HEALTH_CHECK - The health of your deployment is being evaluated.
// - ACTIVATING_DEPLOYMENT - Your deployment is being activated.
// - The following state codes are possible if your container service is in a
// PENDING state:
// - CERTIFICATE_LIMIT_EXCEEDED - The SSL/TLS certificate required for your
// container service exceeds the maximum number of certificates allowed for your
// account.
// - UNKNOWN_ERROR - An error was experienced when your container service was
// being created.
Code ContainerServiceStateDetailCode
// A message that provides more information for the state code. The state detail
// is populated only when a container service is in a PENDING , DEPLOYING , or
// UPDATING state.
Message *string
noSmithyDocumentSerde
}
// Describes whether an Amazon Lightsail content delivery network (CDN)
// distribution forwards cookies to the origin and, if so, which ones. For the
// cookies that you specify, your distribution caches separate versions of the
// specified content based on the cookie values in viewer requests.
type CookieObject struct {
// The specific cookies to forward to your distribution's origin.
CookiesAllowList []string
// Specifies which cookies to forward to the distribution's origin for a cache
// behavior: all , none , or allow-list to forward only the cookies specified in
// the cookiesAllowList parameter.
Option ForwardValues
noSmithyDocumentSerde
}
// Describes the estimated cost for resources in your Lightsail for Research
// account.
type CostEstimate struct {
// The cost estimate result that's associated with a time period.
ResultsByTime []EstimateByTime
// The types of usage that are included in the estimate, such as costs, usage, or
// data transfer.
UsageType *string
noSmithyDocumentSerde
}
// Describes the destination of a record.
type DestinationInfo struct {
// The ID of the resource created at the destination.
Id *string
// The destination service of the record.
Service *string
noSmithyDocumentSerde
}
// Describes a block storage disk.
type Disk struct {
// An array of objects representing the add-ons enabled on the disk.
AddOns []AddOn
// The Amazon Resource Name (ARN) of the disk.
Arn *string
// The resources to which the disk is attached.
AttachedTo *string
// (Deprecated) The attachment state of the disk. In releases prior to November
// 14, 2017, this parameter returned attached for system disks in the API
// response. It is now deprecated, but still included in the response. Use
// isAttached instead.
//
// Deprecated: This member has been deprecated.
AttachmentState *string
// The status of automatically mounting a storage disk to a virtual computer. This
// parameter only applies to Lightsail for Research resources.
AutoMountStatus AutoMountStatus
// The date when the disk was created.
CreatedAt *time.Time
// (Deprecated) The number of GB in use by the disk. In releases prior to November
// 14, 2017, this parameter was not included in the API response. It is now
// deprecated.
//
// Deprecated: This member has been deprecated.
GbInUse *int32
// The input/output operations per second (IOPS) of the disk.
Iops *int32
// A Boolean value indicating whether the disk is attached.
IsAttached *bool
// A Boolean value indicating whether this disk is a system disk (has an operating
// system loaded on it).
IsSystemDisk *bool
// The AWS Region and Availability Zone where the disk is located.
Location *ResourceLocation
// The unique name of the disk.
Name *string
// The disk path.
Path *string
// The Lightsail resource type (e.g., Disk ).
ResourceType ResourceType
// The size of the disk in GB.
SizeInGb *int32
// Describes the status of the disk.
State DiskState
// The support code. Include this code in your email to support when you have
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes a disk.
type DiskInfo struct {
// A Boolean value indicating whether this disk is a system disk (has an operating
// system loaded on it).
IsSystemDisk *bool
// The disk name.
Name *string
// The disk path.
Path *string
// The size of the disk in GB (e.g., 32 ).
SizeInGb *int32
noSmithyDocumentSerde
}
// Describes a block storage disk mapping.
type DiskMap struct {
// The new disk name (e.g., my-new-disk ).
NewDiskName *string
// The original disk path exposed to the instance (for example, /dev/sdh ).
OriginalDiskPath *string
noSmithyDocumentSerde
}
// Describes a block storage disk snapshot.
type DiskSnapshot struct {
// The Amazon Resource Name (ARN) of the disk snapshot.
Arn *string
// The date when the disk snapshot was created.
CreatedAt *time.Time
// The Amazon Resource Name (ARN) of the source disk from which the disk snapshot
// was created.
FromDiskArn *string
// The unique name of the source disk from which the disk snapshot was created.
FromDiskName *string
// The Amazon Resource Name (ARN) of the source instance from which the disk
// (system volume) snapshot was created.
FromInstanceArn *string
// The unique name of the source instance from which the disk (system volume)
// snapshot was created.
FromInstanceName *string
// A Boolean value indicating whether the snapshot was created from an automatic
// snapshot.
IsFromAutoSnapshot *bool
// The AWS Region and Availability Zone where the disk snapshot was created.
Location *ResourceLocation
// The name of the disk snapshot (e.g., my-disk-snapshot ).
Name *string
// The progress of the snapshot.
Progress *string
// The Lightsail resource type (e.g., DiskSnapshot ).
ResourceType ResourceType
// The size of the disk in GB.
SizeInGb *int32
// The status of the disk snapshot operation.
State DiskSnapshotState
// The support code. Include this code in your email to support when you have
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes a disk snapshot.
type DiskSnapshotInfo struct {
// The size of the disk in GB (e.g., 32 ).
SizeInGb *int32
noSmithyDocumentSerde
}
// Describes the specifications of a distribution bundle.
type DistributionBundle struct {
// The ID of the bundle.
BundleId *string
// Indicates whether the bundle is active, and can be specified for a new or
// existing distribution.
IsActive *bool
// The name of the distribution bundle.
Name *string
// The monthly price, in US dollars, of the bundle.
Price *float32
// The monthly network transfer quota of the bundle.
TransferPerMonthInGb *int32
noSmithyDocumentSerde
}
// Describes the creation state of the canonical name (CNAME) records that are
// automatically added by Amazon Lightsail to the DNS of a domain to validate
// domain ownership for an SSL/TLS certificate. When you create an SSL/TLS
// certificate for a Lightsail resource, you must add a set of CNAME records to the
// DNS of the domains for the certificate to validate that you own the domains.
// Lightsail can automatically add the CNAME records to the DNS of the domain if
// the DNS zone for the domain exists within your Lightsail account. If automatic
// record addition fails, or if you manage the DNS of your domain using a
// third-party service, then you must manually add the CNAME records to the DNS of
// your domain. For more information, see Verify an SSL/TLS certificate in Amazon
// Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/verify-tls-ssl-certificate-using-dns-cname-https)
// in the Amazon Lightsail Developer Guide.
type DnsRecordCreationState struct {
// The status code for the automated DNS record creation. Following are the
// possible values:
// - SUCCEEDED - The validation records were successfully added to the domain.
// - STARTED - The automatic DNS record creation has started.
// - FAILED - The validation records failed to be added to the domain.
Code DnsRecordCreationStateCode
// The message that describes the reason for the status code.
Message *string
noSmithyDocumentSerde
}
// Describes a domain where you are storing recordsets.
type Domain struct {
// The Amazon Resource Name (ARN) of the domain recordset (e.g.,
// arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE
// ).
Arn *string
// The date when the domain recordset was created.
CreatedAt *time.Time
// An array of key-value pairs containing information about the domain entries.
DomainEntries []DomainEntry
// The AWS Region and Availability Zones where the domain recordset was created.
Location *ResourceLocation
// The name of the domain.
Name *string
// An object that describes the state of the Route 53 domain delegation to a
// Lightsail DNS zone.
RegisteredDomainDelegationInfo *RegisteredDomainDelegationInfo
// The resource type.
ResourceType ResourceType
// The support code. Include this code in your email to support when you have
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes a domain recordset entry.
type DomainEntry struct {
// The ID of the domain recordset entry.
Id *string
// When true , specifies whether the domain entry is an alias used by the Lightsail
// load balancer, Lightsail container service, Lightsail content delivery network
// (CDN) distribution, or another Amazon Web Services resource. You can include an
// alias (A type) record in your request, which points to the DNS name of a load
// balancer, container service, CDN distribution, or other Amazon Web Services
// resource and routes traffic to that resource.
IsAlias *bool
// The name of the domain.
Name *string
// (Deprecated) The options for the domain entry. In releases prior to November
// 29, 2017, this parameter was not included in the API response. It is now
// deprecated.
//
// Deprecated: This member has been deprecated.
Options map[string]string
// The target IP address (e.g., 192.0.2.0 ), or AWS name server (e.g.,
// ns-111.awsdns-22.com. ). For Lightsail load balancers, the value looks like
// ab1234c56789c6b86aba6fb203d443bc-123456789.us-east-2.elb.amazonaws.com . For
// Lightsail distributions, the value looks like exampled1182ne.cloudfront.net .
// For Lightsail container services, the value looks like
// container-service-1.example23scljs.us-west-2.cs.amazonlightsail.com . Be sure to
// also set isAlias to true when setting up an A record for a Lightsail load
// balancer, distribution, or container service.
Target *string
// The type of domain entry, such as address for IPv4 (A), address for IPv6
// (AAAA), canonical name (CNAME), mail exchanger (MX), name server (NS), start of
// authority (SOA), service locator (SRV), or text (TXT). The following domain
// entry types can be used:
// - A
// - AAAA
// - CNAME
// - MX
// - NS
// - SOA
// - SRV
// - TXT
Type *string
noSmithyDocumentSerde
}
// Describes the domain name system (DNS) records that you must add to the DNS of
// your registered domain to validate ownership for an Amazon Lightsail SSL/TLS
// certificate.
type DomainValidationRecord struct {
// An object that describes the state of the canonical name (CNAME) records that
// are automatically added by Lightsail to the DNS of the domain to validate domain
// ownership.
DnsRecordCreationState *DnsRecordCreationState
// The domain name of the certificate validation record. For example, example.com
// or www.example.com .
DomainName *string
// An object that describes the DNS records to add to your domain's DNS to
// validate it for the certificate.
ResourceRecord *ResourceRecord
// The validation status of the record.
ValidationStatus CertificateDomainValidationStatus
noSmithyDocumentSerde
}
// Describes the settings of a public endpoint for an Amazon Lightsail container
// service.
type EndpointRequest struct {
// The name of the container for the endpoint.
//
// This member is required.
ContainerName *string
// The port of the container to which traffic is forwarded to.
//
// This member is required.
ContainerPort *int32
// An object that describes the health check configuration of the container.
HealthCheck *ContainerServiceHealthCheckConfig
noSmithyDocumentSerde
}
// An estimate that's associated with a time period.
type EstimateByTime struct {
// The currency of the estimate in USD.
Currency Currency
// The unit of measurement that's used for the cost estimate.
PricingUnit PricingUnit
// The period of time, in days, that an estimate covers. The period has a start
// date and an end date. The start date must come before the end date.
TimePeriod *TimePeriod
// The number of pricing units used to calculate the total number of hours. For
// example, 1 unit equals 1 hour.
Unit *float64
// The amount of cost or usage that's measured for the cost estimate.
UsageCost *float64
noSmithyDocumentSerde
}
// Describes an export snapshot record.
type ExportSnapshotRecord struct {
// The Amazon Resource Name (ARN) of the export snapshot record.
Arn *string
// The date when the export snapshot record was created.
CreatedAt *time.Time
// A list of objects describing the destination of the export snapshot record.
DestinationInfo *DestinationInfo
// The AWS Region and Availability Zone where the export snapshot record is
// located.
Location *ResourceLocation
// The export snapshot record name.
Name *string
// The Lightsail resource type (e.g., ExportSnapshotRecord ).
ResourceType ResourceType
// A list of objects describing the source of the export snapshot record.
SourceInfo *ExportSnapshotRecordSourceInfo
// The state of the export snapshot record.
State RecordState
noSmithyDocumentSerde
}
// Describes the source of an export snapshot record.
type ExportSnapshotRecordSourceInfo struct {
// The Amazon Resource Name (ARN) of the source instance or disk snapshot.
Arn *string
// The date when the source instance or disk snapshot was created.
CreatedAt *time.Time
// A list of objects describing a disk snapshot.
DiskSnapshotInfo *DiskSnapshotInfo
// The Amazon Resource Name (ARN) of the snapshot's source instance or disk.
FromResourceArn *string
// The name of the snapshot's source instance or disk.
FromResourceName *string
// A list of objects describing an instance snapshot.
InstanceSnapshotInfo *InstanceSnapshotInfo
// The name of the source instance or disk snapshot.
Name *string
// The Lightsail resource type (e.g., InstanceSnapshot or DiskSnapshot ).
ResourceType ExportSnapshotRecordSourceType
noSmithyDocumentSerde
}
// Describes the request headers that a Lightsail distribution bases caching on.
// For the headers that you specify, your distribution caches separate versions of
// the specified content based on the header values in viewer requests. For
// example, suppose viewer requests for logo.jpg contain a custom product header
// that has a value of either acme or apex , and you configure your distribution to
// cache your content based on values in the product header. Your distribution
// forwards the product header to the origin and caches the response from the
// origin once for each header value.
type HeaderObject struct {
// The specific headers to forward to your distribution's origin.
HeadersAllowList []HeaderEnum
// The headers that you want your distribution to forward to your origin and base
// caching on. You can configure your distribution to do one of the following:
// - all - Forward all headers to your origin.
// - none - Forward only the default headers.
// - allow-list - Forward only the headers you specify using the headersAllowList
// parameter.
Option ForwardValues
noSmithyDocumentSerde
}
// Describes the public SSH host keys or the RDP certificate.
type HostKeyAttributes struct {
// The SSH host key algorithm or the RDP certificate format. For SSH host keys,
// the algorithm may be ssh-rsa , ecdsa-sha2-nistp256 , ssh-ed25519 , etc. For RDP
// certificates, the algorithm is always x509-cert .
Algorithm *string
// The SHA-1 fingerprint of the returned SSH host key or RDP certificate.
// - Example of an SHA-1 SSH fingerprint: SHA1:1CHH6FaAaXjtFOsR/t83vf91SR0
// - Example of an SHA-1 RDP fingerprint:
// af:34:51:fe:09:f0:e0:da:b8:4e:56:ca:60:c2:10:ff:38:06:db:45
FingerprintSHA1 *string
// The SHA-256 fingerprint of the returned SSH host key or RDP certificate.
// - Example of an SHA-256 SSH fingerprint:
// SHA256:KTsMnRBh1IhD17HpdfsbzeGA4jOijm5tyXsMjKVbB8o
// - Example of an SHA-256 RDP fingerprint:
// 03:9b:36:9f:4b:de:4e:61:70:fc:7c:c9:78:e7:d2:1a:1c:25:a8:0c:91:f6:7c:e4:d6:a0:85:c8:b4:53:99:68
FingerprintSHA256 *string
// The returned RDP certificate is not valid after this point in time. This value
// is listed only for RDP certificates.
NotValidAfter *time.Time
// The returned RDP certificate is valid after this point in time. This value is
// listed only for RDP certificates.
NotValidBefore *time.Time
// The public SSH host key or the RDP certificate.
PublicKey *string
// The time that the SSH host key or RDP certificate was recorded by Lightsail.
WitnessedAt *time.Time
noSmithyDocumentSerde
}
// Describes the origin resource of an Amazon Lightsail content delivery network
// (CDN) distribution. An origin can be a Lightsail instance, bucket, or load
// balancer. A distribution pulls content from an origin, caches it, and serves it
// to viewers via a worldwide network of edge servers.
type InputOrigin struct {
// The name of the origin resource.
Name *string
// The protocol that your Amazon Lightsail distribution uses when establishing a
// connection with your origin to pull content.
ProtocolPolicy OriginProtocolPolicyEnum
// The AWS Region name of the origin resource.
RegionName RegionName
noSmithyDocumentSerde
}
// Describes an instance (a virtual private server).
type Instance struct {
// An array of objects representing the add-ons enabled on the instance.
AddOns []AddOn
// The Amazon Resource Name (ARN) of the instance (e.g.,
// arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE
// ).
Arn *string
// The blueprint ID (e.g., os_amlinux_2016_03 ).
BlueprintId *string
// The friendly name of the blueprint (e.g., Amazon Linux ).
BlueprintName *string
// The bundle for the instance (e.g., micro_1_0 ).
BundleId *string
// The timestamp when the instance was created (e.g., 1479734909.17 ) in Unix time
// format.
CreatedAt *time.Time
// The size of the vCPU and the amount of RAM for the instance.
Hardware *InstanceHardware
// The IP address type of the instance. The possible values are ipv4 for IPv4
// only, and dualstack for IPv4 and IPv6.
IpAddressType IpAddressType
// The IPv6 addresses of the instance.
Ipv6Addresses []string
// A Boolean value indicating whether this instance has a static IP assigned to it.
IsStaticIp *bool
// The region name and Availability Zone where the instance is located.
Location *ResourceLocation
// The metadata options for the Amazon Lightsail instance.
MetadataOptions *InstanceMetadataOptions
// The name the user gave the instance (e.g., Amazon_Linux-1GB-Ohio-1 ).
Name *string
// Information about the public ports and monthly data transfer rates for the
// instance.
Networking *InstanceNetworking
// The private IP address of the instance.
PrivateIpAddress *string
// The public IP address of the instance.
PublicIpAddress *string
// The type of resource (usually Instance ).
ResourceType ResourceType
// The name of the SSH key being used to connect to the instance (e.g.,
// LightsailDefaultKeyPair ).
SshKeyName *string
// The status code and the state (e.g., running ) for the instance.
State *InstanceState
// The support code. Include this code in your email to support when you have
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
// The user name for connecting to the instance (e.g., ec2-user ).
Username *string
noSmithyDocumentSerde
}
// The parameters for gaining temporary access to one of your Amazon Lightsail
// instances.
type InstanceAccessDetails struct {
// For SSH access, the public key to use when accessing your instance For OpenSSH
// clients (e.g., command line SSH), you should save this value to tempkey-cert.pub
// .
CertKey *string
// For SSH access, the date on which the temporary keys expire.
ExpiresAt *time.Time
// Describes the public SSH host keys or the RDP certificate.
HostKeys []HostKeyAttributes
// The name of this Amazon Lightsail instance.
InstanceName *string
// The public IP address of the Amazon Lightsail instance.
IpAddress *string
// For RDP access, the password for your Amazon Lightsail instance. Password will
// be an empty string if the password for your new instance is not ready yet. When
// you create an instance, it can take up to 15 minutes for the instance to be
// ready. If you create an instance using any key pair other than the default (
// LightsailDefaultKeyPair ), password will always be an empty string. If you
// change the Administrator password on the instance, Lightsail will continue to
// return the original password value. When accessing the instance using RDP, you
// need to manually enter the Administrator password after changing it from the
// default.
Password *string
// For a Windows Server-based instance, an object with the data you can use to
// retrieve your password. This is only needed if password is empty and the
// instance is not new (and therefore the password is not ready yet). When you
// create an instance, it can take up to 15 minutes for the instance to be ready.
PasswordData *PasswordData
// For SSH access, the temporary private key. For OpenSSH clients (e.g., command
// line SSH), you should save this value to tempkey ).
PrivateKey *string
// The protocol for these Amazon Lightsail instance access details.
Protocol InstanceAccessProtocol
// The user name to use when logging in to the Amazon Lightsail instance.
Username *string
noSmithyDocumentSerde
}
// Describes the Amazon Elastic Compute Cloud instance and related resources to be
// created using the create cloud formation stack operation.
type InstanceEntry struct {
// The Availability Zone for the new Amazon EC2 instance.
//
// This member is required.
AvailabilityZone *string
// The instance type (e.g., t2.micro ) to use for the new Amazon EC2 instance.
//
// This member is required.
InstanceType *string
// The port configuration to use for the new Amazon EC2 instance. The following
// configuration options are available:
// - DEFAULT - Use the default firewall settings from the Lightsail instance
// blueprint. If this is specified, then IPv4 and IPv6 will be configured for the
// new instance that is created in Amazon EC2.
// - INSTANCE - Use the configured firewall settings from the source Lightsail
// instance. If this is specified, the new instance that is created in Amazon EC2
// will be configured to match the configuration of the source Lightsail instance.
// For example, if the source instance is configured for dual-stack (IPv4 and
// IPv6), then IPv4 and IPv6 will be configured for the new instance that is
// created in Amazon EC2. If the source instance is configured for IPv4 only, then
// only IPv4 will be configured for the new instance that is created in Amazon EC2.
//
// - NONE - Use the default Amazon EC2 security group. If this is specified, then
// only IPv4 will be configured for the new instance that is created in Amazon EC2.
//
// - CLOSED - All ports closed. If this is specified, then only IPv4 will be
// configured for the new instance that is created in Amazon EC2.
// If you configured lightsail-connect as a cidrListAliases on your instance, or
// if you chose to allow the Lightsail browser-based SSH or RDP clients to connect
// to your instance, that configuration is not carried over to your new Amazon EC2
// instance.
//
// This member is required.
PortInfoSource PortInfoSourceType
// The name of the export snapshot record, which contains the exported Lightsail
// instance snapshot that will be used as the source of the new Amazon EC2
// instance. Use the get export snapshot records operation to get a list of export
// snapshot records that you can use to create a CloudFormation stack.
//
// This member is required.
SourceName *string
// A launch script you can create that configures a server with additional user
// data. For example, you might want to run apt-get -y update . Depending on the
// machine image you choose, the command to get software on your instance varies.
// Amazon Linux and CentOS use yum , Debian and Ubuntu use apt-get , and FreeBSD
// uses pkg .
UserData *string
noSmithyDocumentSerde
}
// Describes the hardware for the instance.
type InstanceHardware struct {
// The number of vCPUs the instance has.
CpuCount *int32
// The disks attached to the instance.
Disks []Disk
// The amount of RAM in GB on the instance (e.g., 1.0 ).
RamSizeInGb *float32
noSmithyDocumentSerde
}
// Describes information about the health of the instance.
type InstanceHealthSummary struct {
// Describes the overall instance health. Valid values are below.
InstanceHealth InstanceHealthState
// More information about the instance health. If the instanceHealth is healthy ,
// then an instanceHealthReason value is not provided. If instanceHealth is initial
// , the instanceHealthReason value can be one of the following:
// - Lb.RegistrationInProgress - The target instance is in the process of being
// registered with the load balancer.
// - Lb.InitialHealthChecking - The Lightsail load balancer is still sending the
// target instance the minimum number of health checks required to determine its
// health status.
// If instanceHealth is unhealthy , the instanceHealthReason value can be one of
// the following:
// - Instance.ResponseCodeMismatch - The health checks did not return an expected
// HTTP code.
// - Instance.Timeout - The health check requests timed out.
// - Instance.FailedHealthChecks - The health checks failed because the
// connection to the target instance timed out, the target instance response was
// malformed, or the target instance failed the health check for an unknown reason.
//
// - Lb.InternalError - The health checks failed due to an internal error.
// If instanceHealth is unused , the instanceHealthReason value can be one of the
// following:
// - Instance.NotRegistered - The target instance is not registered with the
// target group.
// - Instance.NotInUse - The target group is not used by any load balancer, or
// the target instance is in an Availability Zone that is not enabled for its load
// balancer.
// - Instance.IpUnusable - The target IP address is reserved for use by a
// Lightsail load balancer.
// - Instance.InvalidState - The target is in the stopped or terminated state.
// If instanceHealth is draining , the instanceHealthReason value can be one of
// the following:
// - Instance.DeregistrationInProgress - The target instance is in the process of
// being deregistered and the deregistration delay period has not expired.
InstanceHealthReason InstanceHealthReason
// The name of the Lightsail instance for which you are requesting health check
// data.
InstanceName *string
noSmithyDocumentSerde
}
// The metadata options for the instance.
type InstanceMetadataOptions struct {
// Indicates whether the HTTP metadata endpoint on your instances is enabled or
// disabled. If the value is disabled , you cannot access your instance metadata.
HttpEndpoint HttpEndpoint
// Indicates whether the IPv6 endpoint for the instance metadata service is
// enabled or disabled.
HttpProtocolIpv6 HttpProtocolIpv6
// The desired HTTP PUT response hop limit for instance metadata requests. A
// larger number means that the instance metadata requests can travel farther.
HttpPutResponseHopLimit *int32
// The state of token usage for your instance metadata requests. If the state is
// optional , you can choose whether to retrieve instance metadata with a signed
// token header on your request. If you retrieve the IAM role credentials without a
// token, the version 1.0 role credentials are returned. If you retrieve the IAM
// role credentials by using a valid signed token, the version 2.0 role credentials
// are returned. If the state is required , you must send a signed token header
// with all instance metadata retrieval requests. In this state, retrieving the IAM
// role credential always returns the version 2.0 credentials. The version 1.0
// credentials are not available. Not all instance blueprints in Lightsail support
// version 2.0 credentials. Use the MetadataNoToken instance metric to track the
// number of calls to the instance metadata service that are using version 1.0
// credentials. For more information, see Viewing instance metrics in Amazon
// Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-viewing-instance-health-metrics)
// in the Amazon Lightsail Developer Guide.
HttpTokens HttpTokens
// The state of the metadata option changes. The following states are possible:
// - pending - The metadata options are being updated. The instance is not yet
// ready to process metadata traffic with the new selection.
// - applied - The metadata options have been successfully applied to the
// instance.
State InstanceMetadataState
noSmithyDocumentSerde
}
// Describes monthly data transfer rates and port information for an instance.
type InstanceNetworking struct {
// The amount of data in GB allocated for monthly data transfers.
MonthlyTransfer *MonthlyTransfer
// An array of key-value pairs containing information about the ports on the
// instance.
Ports []InstancePortInfo
noSmithyDocumentSerde
}
// Describes information about ports for an Amazon Lightsail instance.
type InstancePortInfo struct {
// The access direction ( inbound or outbound ). Lightsail currently supports only
// inbound access direction.
AccessDirection AccessDirection
// The location from which access is allowed. For example, Anywhere (0.0.0.0/0) ,
// or Custom if a specific IP address or range of IP addresses is allowed.
AccessFrom *string
// The type of access ( Public or Private ).
AccessType PortAccessType
// An alias that defines access for a preconfigured range of IP addresses. The
// only alias currently supported is lightsail-connect , which allows IP addresses
// of the browser-based RDP/SSH client in the Lightsail console to connect to your
// instance.
CidrListAliases []string
// The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are
// allowed to connect to an instance through the ports, and the protocol. The
// ipv6Cidrs parameter lists the IPv6 addresses that are allowed to connect to an
// instance. For more information about CIDR block notation, see Classless
// Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation)
// on Wikipedia.
Cidrs []string
// The common name of the port information.
CommonName *string
// The first port in a range of open ports on an instance. Allowed ports:
// - TCP and UDP - 0 to 65535
// - ICMP - The ICMP type for IPv4 addresses. For example, specify 8 as the
// fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping.
// For more information, see Control Messages (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages)
// on Wikipedia.
// - ICMPv6 - The ICMP type for IPv6 addresses. For example, specify 128 as the
// fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code). For more information,
// see Internet Control Message Protocol for IPv6 (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol_for_IPv6)
// .
FromPort int32
// The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are
// allowed to connect to an instance through the ports, and the protocol. Only
// devices with an IPv6 address can connect to an instance through IPv6; otherwise,
// IPv4 should be used. The cidrs parameter lists the IPv4 addresses that are
// allowed to connect to an instance. For more information about CIDR block
// notation, see Classless Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation)
// on Wikipedia.
Ipv6Cidrs []string
// The IP protocol name. The name can be one of the following:
// - tcp - Transmission Control Protocol (TCP) provides reliable, ordered, and
// error-checked delivery of streamed data between applications running on hosts
// communicating by an IP network. If you have an application that doesn't require
// reliable data stream service, use UDP instead.
// - all - All transport layer protocol types. For more general information, see
// Transport layer (https://en.wikipedia.org/wiki/Transport_layer) on Wikipedia.
// - udp - With User Datagram Protocol (UDP), computer applications can send
// messages (or datagrams) to other hosts on an Internet Protocol (IP) network.
// Prior communications are not required to set up transmission channels or data
// paths. Applications that don't require reliable data stream service can use UDP,
// which provides a connectionless datagram service that emphasizes reduced latency
// over reliability. If you do require reliable data stream service, use TCP
// instead.
// - icmp - Internet Control Message Protocol (ICMP) is used to send error
// messages and operational information indicating success or failure when
// communicating with an instance. For example, an error is indicated when an
// instance could not be reached. When you specify icmp as the protocol , you
// must specify the ICMP type using the fromPort parameter, and ICMP code using
// the toPort parameter.
Protocol NetworkProtocol
// The last port in a range of open ports on an instance. Allowed ports:
// - TCP and UDP - 0 to 65535
// - ICMP - The ICMP code for IPv4 addresses. For example, specify 8 as the
// fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping.
// For more information, see Control Messages (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages)
// on Wikipedia.
// - ICMPv6 - The ICMP code for IPv6 addresses. For example, specify 128 as the
// fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code). For more information,
// see Internet Control Message Protocol for IPv6 (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol_for_IPv6)
// .
ToPort int32
noSmithyDocumentSerde
}
// Describes open ports on an instance, the IP addresses allowed to connect to the
// instance through the ports, and the protocol.
type InstancePortState struct {
// An alias that defines access for a preconfigured range of IP addresses. The
// only alias currently supported is lightsail-connect , which allows IP addresses
// of the browser-based RDP/SSH client in the Lightsail console to connect to your
// instance.
CidrListAliases []string
// The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are
// allowed to connect to an instance through the ports, and the protocol. The
// ipv6Cidrs parameter lists the IPv6 addresses that are allowed to connect to an
// instance. For more information about CIDR block notation, see Classless
// Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation)
// on Wikipedia.
Cidrs []string
// The first port in a range of open ports on an instance. Allowed ports:
// - TCP and UDP - 0 to 65535
// - ICMP - The ICMP type for IPv4 addresses. For example, specify 8 as the
// fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping.
// For more information, see Control Messages (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages)
// on Wikipedia.
// - ICMPv6 - The ICMP type for IPv6 addresses. For example, specify 128 as the
// fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code). For more information,
// see Internet Control Message Protocol for IPv6 (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol_for_IPv6)
// .
FromPort int32
// The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are
// allowed to connect to an instance through the ports, and the protocol. Only
// devices with an IPv6 address can connect to an instance through IPv6; otherwise,
// IPv4 should be used. The cidrs parameter lists the IPv4 addresses that are
// allowed to connect to an instance. For more information about CIDR block
// notation, see Classless Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation)
// on Wikipedia.
Ipv6Cidrs []string
// The IP protocol name. The name can be one of the following:
// - tcp - Transmission Control Protocol (TCP) provides reliable, ordered, and
// error-checked delivery of streamed data between applications running on hosts
// communicating by an IP network. If you have an application that doesn't require
// reliable data stream service, use UDP instead.
// - all - All transport layer protocol types. For more general information, see
// Transport layer (https://en.wikipedia.org/wiki/Transport_layer) on Wikipedia.
// - udp - With User Datagram Protocol (UDP), computer applications can send
// messages (or datagrams) to other hosts on an Internet Protocol (IP) network.
// Prior communications are not required to set up transmission channels or data
// paths. Applications that don't require reliable data stream service can use UDP,
// which provides a connectionless datagram service that emphasizes reduced latency
// over reliability. If you do require reliable data stream service, use TCP
// instead.
// - icmp - Internet Control Message Protocol (ICMP) is used to send error
// messages and operational information indicating success or failure when
// communicating with an instance. For example, an error is indicated when an
// instance could not be reached. When you specify icmp as the protocol , you
// must specify the ICMP type using the fromPort parameter, and ICMP code using
// the toPort parameter.
Protocol NetworkProtocol
// Specifies whether the instance port is open or closed . The port state for
// Lightsail instances is always open .
State PortState
// The last port in a range of open ports on an instance. Allowed ports:
// - TCP and UDP - 0 to 65535
// - ICMP - The ICMP code for IPv4 addresses. For example, specify 8 as the
// fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping.
// For more information, see Control Messages (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages)
// on Wikipedia.
// - ICMPv6 - The ICMP code for IPv6 addresses. For example, specify 128 as the
// fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code). For more information,
// see Internet Control Message Protocol for IPv6 (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol_for_IPv6)
// .
ToPort int32
noSmithyDocumentSerde
}
// Describes an instance snapshot.
type InstanceSnapshot struct {
// The Amazon Resource Name (ARN) of the snapshot (e.g.,
// arn:aws:lightsail:us-east-2:123456789101:InstanceSnapshot/d23b5706-3322-4d83-81e5-12345EXAMPLE
// ).
Arn *string
// The timestamp when the snapshot was created (e.g., 1479907467.024 ).
CreatedAt *time.Time
// An array of disk objects containing information about all block storage disks.
FromAttachedDisks []Disk
// The blueprint ID from which you created the snapshot (e.g., os_debian_8_3 ). A
// blueprint is a virtual private server (or instance) image used to create
// instances quickly.
FromBlueprintId *string
// The bundle ID from which you created the snapshot (e.g., micro_1_0 ).
FromBundleId *string
// The Amazon Resource Name (ARN) of the instance from which the snapshot was
// created (e.g.,
// arn:aws:lightsail:us-east-2:123456789101:Instance/64b8404c-ccb1-430b-8daf-12345EXAMPLE
// ).
FromInstanceArn *string
// The instance from which the snapshot was created.
FromInstanceName *string
// A Boolean value indicating whether the snapshot was created from an automatic
// snapshot.
IsFromAutoSnapshot *bool
// The region name and Availability Zone where you created the snapshot.
Location *ResourceLocation
// The name of the snapshot.
Name *string
// The progress of the snapshot. This is populated only for disk snapshots, and is
// null for instance snapshots.
Progress *string
// The type of resource (usually InstanceSnapshot ).
ResourceType ResourceType
// The size in GB of the SSD.
SizeInGb *int32
// The state the snapshot is in.
State InstanceSnapshotState
// The support code. Include this code in your email to support when you have
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes an instance snapshot.
type InstanceSnapshotInfo struct {
// The blueprint ID from which the source instance (e.g., os_debian_8_3 ).
FromBlueprintId *string
// The bundle ID from which the source instance was created (e.g., micro_1_0 ).
FromBundleId *string
// A list of objects describing the disks that were attached to the source
// instance.
FromDiskInfo []DiskInfo
noSmithyDocumentSerde
}
// Describes the virtual private server (or instance) status.
type InstanceState struct {
// The status code for the instance.
Code *int32
// The state of the instance (e.g., running or pending ).
Name *string
noSmithyDocumentSerde
}
// Describes an SSH key pair.
type KeyPair struct {
// The Amazon Resource Name (ARN) of the key pair (e.g.,
// arn:aws:lightsail:us-east-2:123456789101:KeyPair/05859e3d-331d-48ba-9034-12345EXAMPLE
// ).
Arn *string
// The timestamp when the key pair was created (e.g., 1479816991.349 ).
CreatedAt *time.Time
// The RSA fingerprint of the key pair.
Fingerprint *string
// The region name and Availability Zone where the key pair was created.
Location *ResourceLocation
// The friendly name of the SSH key pair.
Name *string
// The resource type (usually KeyPair ).
ResourceType ResourceType
// The support code. Include this code in your email to support when you have
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes an Amazon Lightsail content delivery network (CDN) distribution.
type LightsailDistribution struct {
// Indicates whether the bundle that is currently applied to your distribution,
// specified using the distributionName parameter, can be changed to another
// bundle. Use the UpdateDistributionBundle action to change your distribution's
// bundle.
AbleToUpdateBundle *bool
// The alternate domain names of the distribution.
AlternativeDomainNames []string
// The Amazon Resource Name (ARN) of the distribution.
Arn *string
// The ID of the bundle currently applied to the distribution.
BundleId *string
// An object that describes the cache behavior settings of the distribution.
CacheBehaviorSettings *CacheSettings
// An array of objects that describe the per-path cache behavior of the
// distribution.
CacheBehaviors []CacheBehaviorPerPath
// The name of the SSL/TLS certificate attached to the distribution, if any.
CertificateName *string
// The timestamp when the distribution was created.
CreatedAt *time.Time
// An object that describes the default cache behavior of the distribution.
DefaultCacheBehavior *CacheBehavior
// The domain name of the distribution.
DomainName *string
// The IP address type of the distribution. The possible values are ipv4 for IPv4
// only, and dualstack for IPv4 and IPv6.
IpAddressType IpAddressType
// Indicates whether the distribution is enabled.
IsEnabled *bool
// An object that describes the location of the distribution, such as the Amazon
// Web Services Region and Availability Zone. Lightsail distributions are global
// resources that can reference an origin in any Amazon Web Services Region, and
// distribute its content globally. However, all distributions are located in the
// us-east-1 Region.
Location *ResourceLocation
// The name of the distribution.
Name *string
// An object that describes the origin resource of the distribution, such as a
// Lightsail instance, bucket, or load balancer. The distribution pulls, caches,
// and serves content from the origin.
Origin *Origin
// The public DNS of the origin.
OriginPublicDNS *string
// The Lightsail resource type (e.g., Distribution ).
ResourceType ResourceType
// The status of the distribution.
Status *string
// The support code. Include this code in your email to support when you have
// questions about your Lightsail distribution. This code enables our support team
// to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes a load balancer.
type LoadBalancer struct {
// The Amazon Resource Name (ARN) of the load balancer.
Arn *string
// A string to string map of the configuration options for your load balancer.
// Valid values are listed below.
ConfigurationOptions map[string]string
// The date when your load balancer was created.
CreatedAt *time.Time
// The DNS name of your Lightsail load balancer.
DnsName *string
// The path you specified to perform your health checks. If no path is specified,
// the load balancer tries to make a request to the default (root) page.
HealthCheckPath *string
// A Boolean value that indicates whether HTTPS redirection is enabled for the
// load balancer.
HttpsRedirectionEnabled *bool
// An array of InstanceHealthSummary objects describing the health of the load
// balancer.
InstanceHealthSummary []InstanceHealthSummary
// The port where the load balancer will direct traffic to your Lightsail
// instances. For HTTP traffic, it's port 80. For HTTPS traffic, it's port 443.
InstancePort *int32
// The IP address type of the load balancer. The possible values are ipv4 for IPv4
// only, and dualstack for IPv4 and IPv6.
IpAddressType IpAddressType
// The AWS Region where your load balancer was created (e.g., us-east-2a ).
// Lightsail automatically creates your load balancer across Availability Zones.
Location *ResourceLocation
// The name of the load balancer (e.g., my-load-balancer ).
Name *string
// The protocol you have enabled for your load balancer. Valid values are below.
// You can't just have HTTP_HTTPS , but you can have just HTTP .
Protocol LoadBalancerProtocol
// An array of public port settings for your load balancer. For HTTP, use port 80.
// For HTTPS, use port 443.
PublicPorts []int32
// The resource type (e.g., LoadBalancer .
ResourceType ResourceType
// The status of your load balancer. Valid values are below.
State LoadBalancerState
// The support code. Include this code in your email to support when you have
// questions about your Lightsail load balancer. This code enables our support team
// to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
// An array of LoadBalancerTlsCertificateSummary objects that provide additional
// information about the SSL/TLS certificates. For example, if true , the
// certificate is attached to the load balancer.
TlsCertificateSummaries []LoadBalancerTlsCertificateSummary
// The name of the TLS security policy for the load balancer.
TlsPolicyName *string
noSmithyDocumentSerde
}
// Describes a load balancer SSL/TLS certificate. TLS is just an updated, more
// secure version of Secure Socket Layer (SSL).
type LoadBalancerTlsCertificate struct {
// The Amazon Resource Name (ARN) of the SSL/TLS certificate.
Arn *string
// The time when you created your SSL/TLS certificate.
CreatedAt *time.Time
// The domain name for your SSL/TLS certificate.
DomainName *string
// An array of LoadBalancerTlsCertificateDomainValidationRecord objects describing
// the records.
DomainValidationRecords []LoadBalancerTlsCertificateDomainValidationRecord
// The validation failure reason, if any, of the certificate. The following
// failure reasons are possible:
// - NO_AVAILABLE_CONTACTS - This failure applies to email validation, which is
// not available for Lightsail certificates.
// - ADDITIONAL_VERIFICATION_REQUIRED - Lightsail requires additional information
// to process this certificate request. This can happen as a fraud-protection
// measure, such as when the domain ranks within the Alexa top 1000 websites. To
// provide the required information, use the AWS Support Center (https://console.aws.amazon.com/support/home)
// to contact AWS Support. You cannot request a certificate for Amazon-owned domain
// names such as those ending in amazonaws.com, cloudfront.net, or
// elasticbeanstalk.com.
// - DOMAIN_NOT_ALLOWED - One or more of the domain names in the certificate
// request was reported as an unsafe domain by VirusTotal (https://www.virustotal.com/gui/home/url)
// . To correct the problem, search for your domain name on the VirusTotal (https://www.virustotal.com/gui/home/url)
// website. If your domain is reported as suspicious, see Google Help for Hacked
// Websites (https://developers.google.com/web/fundamentals/security/hacked) to
// learn what you can do. If you believe that the result is a false positive,
// notify the organization that is reporting the domain. VirusTotal is an aggregate
// of several antivirus and URL scanners and cannot remove your domain from a block
// list itself. After you correct the problem and the VirusTotal registry has been
// updated, request a new certificate. If you see this error and your domain is not
// included in the VirusTotal list, visit the AWS Support Center (https://console.aws.amazon.com/support/home)
// and create a case.
// - INVALID_PUBLIC_DOMAIN - One or more of the domain names in the certificate
// request is not valid. Typically, this is because a domain name in the request is
// not a valid top-level domain. Try to request a certificate again, correcting any
// spelling errors or typos that were in the failed request, and ensure that all
// domain names in the request are for valid top-level domains. For example, you
// cannot request a certificate for example.invalidpublicdomain because
// invalidpublicdomain is not a valid top-level domain.
// - OTHER - Typically, this failure occurs when there is a typographical error
// in one or more of the domain names in the certificate request. Try to request a
// certificate again, correcting any spelling errors or typos that were in the
// failed request.
FailureReason LoadBalancerTlsCertificateFailureReason
// When true , the SSL/TLS certificate is attached to the Lightsail load balancer.
IsAttached *bool
// The time when the SSL/TLS certificate was issued.
IssuedAt *time.Time
// The issuer of the certificate.
Issuer *string
// The algorithm used to generate the key pair (the public and private key).
KeyAlgorithm *string
// The load balancer name where your SSL/TLS certificate is attached.
LoadBalancerName *string
// The Amazon Web Services Region and Availability Zone where you created your
// certificate.
Location *ResourceLocation
// The name of the SSL/TLS certificate (e.g., my-certificate ).
Name *string
// The timestamp when the SSL/TLS certificate expires.
NotAfter *time.Time
// The timestamp when the SSL/TLS certificate is first valid.
NotBefore *time.Time
// An object that describes the status of the certificate renewal managed by
// Lightsail.
RenewalSummary *LoadBalancerTlsCertificateRenewalSummary
// The resource type (e.g., LoadBalancerTlsCertificate ).
// - Instance - A Lightsail instance (a virtual private server)
// - StaticIp - A static IP address
// - KeyPair - The key pair used to connect to a Lightsail instance
// - InstanceSnapshot - A Lightsail instance snapshot
// - Domain - A DNS zone
// - PeeredVpc - A peered VPC
// - LoadBalancer - A Lightsail load balancer
// - LoadBalancerTlsCertificate - An SSL/TLS certificate associated with a
// Lightsail load balancer
// - Disk - A Lightsail block storage disk
// - DiskSnapshot - A block storage disk snapshot
ResourceType ResourceType
// The reason the certificate was revoked. This value is present only when the
// certificate status is REVOKED .
RevocationReason LoadBalancerTlsCertificateRevocationReason
// The timestamp when the certificate was revoked. This value is present only when
// the certificate status is REVOKED .
RevokedAt *time.Time
// The serial number of the certificate.
Serial *string
// The algorithm that was used to sign the certificate.
SignatureAlgorithm *string
// The validation status of the SSL/TLS certificate. Valid values are below.
Status LoadBalancerTlsCertificateStatus
// The name of the entity that is associated with the public key contained in the
// certificate.
Subject *string
// An array of strings that specify the alternate domains (e.g., example2.com ) and
// subdomains (e.g., blog.example.com ) for the certificate.
SubjectAlternativeNames []string
// The support code. Include this code in your email to support when you have
// questions about your Lightsail load balancer or SSL/TLS certificate. This code
// enables our support team to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// An object that describes the state of the canonical name (CNAME) records that
// are automatically added by Lightsail to the DNS of the domain to validate domain
// ownership.
type LoadBalancerTlsCertificateDnsRecordCreationState struct {
// The status code for the automated DNS record creation. Following are the
// possible values:
// - SUCCEEDED - The validation records were successfully added.
// - STARTED - The automatic DNS record creation has started.
// - FAILED - The validation record addition failed.
Code LoadBalancerTlsCertificateDnsRecordCreationStateCode
// The message that describes the reason for the status code.
Message *string
noSmithyDocumentSerde
}
// Contains information about the domain names on an SSL/TLS certificate that you
// will use to validate domain ownership.
type LoadBalancerTlsCertificateDomainValidationOption struct {
// The fully qualified domain name in the certificate request.
DomainName *string
// The status of the domain validation. Valid values are listed below.
ValidationStatus LoadBalancerTlsCertificateDomainStatus
noSmithyDocumentSerde
}
// Describes the validation record of each domain name in the SSL/TLS certificate.
type LoadBalancerTlsCertificateDomainValidationRecord struct {
// An object that describes the state of the canonical name (CNAME) records that
// are automatically added by Lightsail to the DNS of a domain to validate domain
// ownership.
DnsRecordCreationState *LoadBalancerTlsCertificateDnsRecordCreationState
// The domain name against which your SSL/TLS certificate was validated.
DomainName *string
// A fully qualified domain name in the certificate. For example, example.com .
Name *string
// The type of validation record. For example, CNAME for domain validation.
Type *string
// The validation status. Valid values are listed below.
ValidationStatus LoadBalancerTlsCertificateDomainStatus
// The value for that type.
Value *string
noSmithyDocumentSerde
}
// Contains information about the status of Lightsail's managed renewal for the
// certificate. The renewal status of the certificate. The following renewal status
// are possible:
// - PendingAutoRenewal - Lightsail is attempting to automatically validate the
// domain names in the certificate. No further action is required.
// - PendingValidation - Lightsail couldn't automatically validate one or more
// domain names in the certificate. You must take action to validate these domain
// names or the certificate won't be renewed. If you used DNS validation, check to
// make sure your certificate's domain validation records exist in your domain's
// DNS, and that your certificate remains in use.
// - Success - All domain names in the certificate are validated, and Lightsail
// renewed the certificate. No further action is required.
// - Failed - One or more domain names were not validated before the certificate
// expired, and Lightsail did not renew the certificate. You can request a new
// certificate using the CreateCertificate action.
type LoadBalancerTlsCertificateRenewalSummary struct {
// Contains information about the validation of each domain name in the
// certificate, as it pertains to Lightsail's managed renewal. This is different
// from the initial validation that occurs as a result of the RequestCertificate
// request.
DomainValidationOptions []LoadBalancerTlsCertificateDomainValidationOption
// The renewal status of the certificate. The following renewal status are
// possible:
// - PendingAutoRenewal - Lightsail is attempting to automatically validate the
// domain names of the certificate. No further action is required.
// - PendingValidation - Lightsail couldn't automatically validate one or more
// domain names of the certificate. You must take action to validate these domain
// names or the certificate won't be renewed. Check to make sure your certificate's
// domain validation records exist in your domain's DNS, and that your certificate
// remains in use.
// - Success - All domain names in the certificate are validated, and Lightsail
// renewed the certificate. No further action is required.
// - Failed - One or more domain names were not validated before the certificate
// expired, and Lightsail did not renew the certificate. You can request a new
// certificate using the CreateCertificate action.
RenewalStatus LoadBalancerTlsCertificateRenewalStatus
noSmithyDocumentSerde
}
// Provides a summary of SSL/TLS certificate metadata.
type LoadBalancerTlsCertificateSummary struct {
// When true , the SSL/TLS certificate is attached to the Lightsail load balancer.
IsAttached *bool
// The name of the SSL/TLS certificate.
Name *string
noSmithyDocumentSerde
}
// Describes the TLS security policies that are available for Lightsail load
// balancers. For more information about load balancer TLS security policies, see
// Configuring TLS security policies on your Amazon Lightsail load balancers (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configure-load-balancer-tls-security-policy)
// in the Amazon Lightsail Developer Guide.
type LoadBalancerTlsPolicy struct {
// The ciphers used by the TLS security policy. The ciphers are listed in order of
// preference.
Ciphers []string
// The description of the TLS security policy.
Description *string
// A Boolean value that indicates whether the TLS security policy is the default.
IsDefault *bool
// The name of the TLS security policy.
Name *string
// The protocols used in a given TLS security policy.
Protocols []string
noSmithyDocumentSerde
}
// Describes a database log event.
type LogEvent struct {
// The timestamp when the database log event was created.
CreatedAt *time.Time
// The message of the database log event.
Message *string
noSmithyDocumentSerde
}
// Describes the metric data point.
type MetricDatapoint struct {
// The average.
Average *float64
// The maximum.
Maximum *float64
// The minimum.
Minimum *float64
// The sample count.
SampleCount *float64
// The sum.
Sum *float64
// The timestamp (e.g., 1479816991.349 ).
Timestamp *time.Time
// The unit.
Unit MetricUnit
noSmithyDocumentSerde
}
// Describes resource being monitored by an alarm. An alarm is a way to monitor
// your Amazon Lightsail resource metrics. For more information, see Alarms in
// Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-alarms)
// .
type MonitoredResourceInfo struct {
// The Amazon Resource Name (ARN) of the resource being monitored.
Arn *string
// The name of the Lightsail resource being monitored.
Name *string
// The Lightsail resource type of the resource being monitored. Instances, load
// balancers, and relational databases are the only Lightsail resources that can
// currently be monitored by alarms.
ResourceType ResourceType
noSmithyDocumentSerde
}
// Describes the monthly data transfer in and out of your virtual private server
// (or instance).
type MonthlyTransfer struct {
// The amount allocated per month (in GB).
GbPerMonthAllocated *int32
noSmithyDocumentSerde
}
// Describes the state of the name server records update made by Amazon Lightsail
// to an Amazon Route 53 registered domain. For more information, see DNS in
// Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/understanding-dns-in-amazon-lightsail)
// in the Amazon Lightsail Developer Guide.
type NameServersUpdateState struct {
// The status code for the name servers update. Following are the possible values:
// - SUCCEEDED - The name server records were successfully updated.
// - PENDING - The name server record update is in progress.
// - FAILED - The name server record update failed.
// - STARTED - The automatic name server record update started.
Code NameServersUpdateStateCode
// The message that describes the reason for the status code.
Message *string
noSmithyDocumentSerde
}
// Describes the API operation.
type Operation struct {
// The timestamp when the operation was initialized (e.g., 1479816991.349 ).
CreatedAt *time.Time
// The error code.
ErrorCode *string
// The error details.
ErrorDetails *string
// The ID of the operation.
Id *string
// A Boolean value indicating whether the operation is terminal.
IsTerminal *bool
// The Amazon Web Services Region and Availability Zone.
Location *ResourceLocation
// Details about the operation (e.g., Debian-1GB-Ohio-1 ).
OperationDetails *string
// The type of operation.
OperationType OperationType
// The resource name.
ResourceName *string
// The resource type.
ResourceType ResourceType
// The status of the operation.
Status OperationStatus
// The timestamp when the status was changed (e.g., 1479816991.349 ).
StatusChangedAt *time.Time
noSmithyDocumentSerde
}
// Describes the origin resource of an Amazon Lightsail content delivery network
// (CDN) distribution. An origin can be a Lightsail instance, bucket, or load
// balancer. A distribution pulls content from an origin, caches it, and serves it
// to viewers via a worldwide network of edge servers.
type Origin struct {
// The name of the origin resource.
Name *string
// The protocol that your Amazon Lightsail distribution uses when establishing a
// connection with your origin to pull content.
ProtocolPolicy OriginProtocolPolicyEnum
// The AWS Region name of the origin resource.
RegionName RegionName
// The resource type of the origin resource (e.g., Instance).
ResourceType ResourceType
noSmithyDocumentSerde
}
// The password data for the Windows Server-based instance, including the
// ciphertext and the key pair name.
type PasswordData struct {
// The encrypted password. Ciphertext will be an empty string if access to your
// new instance is not ready yet. When you create an instance, it can take up to 15
// minutes for the instance to be ready. If you use the default key pair (
// LightsailDefaultKeyPair ), the decrypted password will be available in the
// password field. If you are using a custom key pair, you need to use your own
// means of decryption. If you change the Administrator password on the instance,
// Lightsail will continue to return the original ciphertext value. When accessing
// the instance using RDP, you need to manually enter the Administrator password
// after changing it from the default.
Ciphertext *string
// The name of the key pair that you used when creating your instance. If no key
// pair name was specified when creating the instance, Lightsail uses the default
// key pair ( LightsailDefaultKeyPair ). If you are using a custom key pair, you
// need to use your own means of decrypting your password using the ciphertext .
// Lightsail creates the ciphertext by encrypting your password with the public key
// part of this key pair.
KeyPairName *string
noSmithyDocumentSerde
}
// Describes a pending database maintenance action.
type PendingMaintenanceAction struct {
// The type of pending database maintenance action.
Action *string
// The effective date of the pending database maintenance action.
CurrentApplyDate *time.Time
// Additional detail about the pending database maintenance action.
Description *string
noSmithyDocumentSerde
}
// Describes a pending database value modification.
type PendingModifiedRelationalDatabaseValues struct {
// A Boolean value indicating whether automated backup retention is enabled.
BackupRetentionEnabled *bool
// The database engine version.
EngineVersion *string
// The password for the master user of the database.
MasterUserPassword *string
noSmithyDocumentSerde
}
// Describes ports to open on an instance, the IP addresses allowed to connect to
// the instance through the ports, and the protocol.
type PortInfo struct {
// An alias that defines access for a preconfigured range of IP addresses. The
// only alias currently supported is lightsail-connect , which allows IP addresses
// of the browser-based RDP/SSH client in the Lightsail console to connect to your
// instance.
CidrListAliases []string
// The IPv4 address, or range of IPv4 addresses (in CIDR notation) that are
// allowed to connect to an instance through the ports, and the protocol. The
// ipv6Cidrs parameter lists the IPv6 addresses that are allowed to connect to an
// instance. Examples:
// - To allow the IP address 192.0.2.44 , specify 192.0.2.44 or 192.0.2.44/32 .
// - To allow the IP addresses 192.0.2.0 to 192.0.2.255 , specify 192.0.2.0/24 .
// For more information about CIDR block notation, see Classless Inter-Domain
// Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation)
// on Wikipedia.
Cidrs []string
// The first port in a range of open ports on an instance. Allowed ports:
// - TCP and UDP - 0 to 65535
// - ICMP - The ICMP type for IPv4 addresses. For example, specify 8 as the
// fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping.
// For more information, see Control Messages (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages)
// on Wikipedia.
// - ICMPv6 - The ICMP type for IPv6 addresses. For example, specify 128 as the
// fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code). For more information,
// see Internet Control Message Protocol for IPv6 (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol_for_IPv6)
// .
FromPort int32
// The IPv6 address, or range of IPv6 addresses (in CIDR notation) that are
// allowed to connect to an instance through the ports, and the protocol. Only
// devices with an IPv6 address can connect to an instance through IPv6; otherwise,
// IPv4 should be used. The cidrs parameter lists the IPv4 addresses that are
// allowed to connect to an instance. For more information about CIDR block
// notation, see Classless Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation)
// on Wikipedia.
Ipv6Cidrs []string
// The IP protocol name. The name can be one of the following:
// - tcp - Transmission Control Protocol (TCP) provides reliable, ordered, and
// error-checked delivery of streamed data between applications running on hosts
// communicating by an IP network. If you have an application that doesn't require
// reliable data stream service, use UDP instead.
// - all - All transport layer protocol types. For more general information, see
// Transport layer (https://en.wikipedia.org/wiki/Transport_layer) on Wikipedia.
// - udp - With User Datagram Protocol (UDP), computer applications can send
// messages (or datagrams) to other hosts on an Internet Protocol (IP) network.
// Prior communications are not required to set up transmission channels or data
// paths. Applications that don't require reliable data stream service can use UDP,
// which provides a connectionless datagram service that emphasizes reduced latency
// over reliability. If you do require reliable data stream service, use TCP
// instead.
// - icmp - Internet Control Message Protocol (ICMP) is used to send error
// messages and operational information indicating success or failure when
// communicating with an instance. For example, an error is indicated when an
// instance could not be reached. When you specify icmp as the protocol , you
// must specify the ICMP type using the fromPort parameter, and ICMP code using
// the toPort parameter.
Protocol NetworkProtocol
// The last port in a range of open ports on an instance. Allowed ports:
// - TCP and UDP - 0 to 65535
// - ICMP - The ICMP code for IPv4 addresses. For example, specify 8 as the
// fromPort (ICMP type), and -1 as the toPort (ICMP code), to enable ICMP Ping.
// For more information, see Control Messages (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol#Control_messages)
// on Wikipedia.
// - ICMPv6 - The ICMP code for IPv6 addresses. For example, specify 128 as the
// fromPort (ICMPv6 type), and 0 as toPort (ICMPv6 code). For more information,
// see Internet Control Message Protocol for IPv6 (https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol_for_IPv6)
// .
ToPort int32
noSmithyDocumentSerde
}
// Describes the configuration for an Amazon Lightsail container service to access
// private container image repositories, such as Amazon Elastic Container Registry
// (Amazon ECR) private repositories. For more information, see Configuring access
// to an Amazon ECR private repository for an Amazon Lightsail container service (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-container-service-ecr-private-repo-access)
// in the Amazon Lightsail Developer Guide.
type PrivateRegistryAccess struct {
// An object that describes the activation status of the role that you can use to
// grant a Lightsail container service access to Amazon ECR private repositories.
// If the role is activated, the Amazon Resource Name (ARN) of the role is also
// listed.
EcrImagePullerRole *ContainerServiceECRImagePullerRole
noSmithyDocumentSerde
}
// Describes a request to configure an Amazon Lightsail container service to
// access private container image repositories, such as Amazon Elastic Container
// Registry (Amazon ECR) private repositories. For more information, see
// Configuring access to an Amazon ECR private repository for an Amazon Lightsail
// container service (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-container-service-ecr-private-repo-access)
// in the Amazon Lightsail Developer Guide.
type PrivateRegistryAccessRequest struct {
// An object to describe a request to activate or deactivate the role that you can
// use to grant an Amazon Lightsail container service access to Amazon Elastic
// Container Registry (Amazon ECR) private repositories.
EcrImagePullerRole *ContainerServiceECRImagePullerRoleRequest
noSmithyDocumentSerde
}
// Describes the query string parameters that an Amazon Lightsail content delivery
// network (CDN) distribution to bases caching on. For the query strings that you
// specify, your distribution caches separate versions of the specified content
// based on the query string values in viewer requests.
type QueryStringObject struct {
// Indicates whether the distribution forwards and caches based on query strings.
Option *bool
// The specific query strings that the distribution forwards to the origin. Your
// distribution will cache content based on the specified query strings. If the
// option parameter is true, then your distribution forwards all query strings,
// regardless of what you specify using the queryStringsAllowList parameter.
QueryStringsAllowList []string
noSmithyDocumentSerde
}
// Describes the deletion state of an Amazon Route 53 hosted zone for a domain
// that is being automatically delegated to an Amazon Lightsail DNS zone.
type R53HostedZoneDeletionState struct {
// The status code for the deletion state. Following are the possible values:
// - SUCCEEDED - The hosted zone was successfully deleted.
// - PENDING - The hosted zone deletion is in progress.
// - FAILED - The hosted zone deletion failed.
// - STARTED - The hosted zone deletion started.
Code R53HostedZoneDeletionStateCode
// The message that describes the reason for the status code.
Message *string
noSmithyDocumentSerde
}
// Describes the Amazon Web Services Region.
type Region struct {
// The Availability Zones. Follows the format us-east-2a (case-sensitive).
AvailabilityZones []AvailabilityZone
// The continent code (e.g., NA , meaning North America).
ContinentCode *string
// The description of the Amazon Web Services Region (e.g., This region is
// recommended to serve users in the eastern United States and eastern Canada ).
Description *string
// The display name (e.g., Ohio ).
DisplayName *string
// The region name (e.g., us-east-2 ).
Name RegionName
// The Availability Zones for databases. Follows the format us-east-2a
// (case-sensitive).
RelationalDatabaseAvailabilityZones []AvailabilityZone
noSmithyDocumentSerde
}
// Describes the delegation state of an Amazon Route 53 registered domain to
// Amazon Lightsail. When you delegate an Amazon Route 53 registered domain to
// Lightsail, you can manage the DNS of the domain using a Lightsail DNS zone. You
// no longer use the Route 53 hosted zone to manage the DNS of the domain. To
// delegate the domain, Lightsail automatically updates the domain's name servers
// in Route 53 to the name servers of the Lightsail DNS zone. Then, Lightsail
// automatically deletes the Route 53 hosted zone for the domain. All of the
// following conditions must be true for automatic domain delegation to be
// successful:
// - The registered domain must be in the same Amazon Web Services account as
// the Lightsail account making the request.
// - The user or entity making the request must have permission to manage
// domains in Route 53.
// - The Route 53 hosted zone for the domain must be empty. It cannot contain
// DNS records other than start of authority (SOA) and name server records.
//
// If automatic domain delegation fails, or if you manage the DNS of your domain
// using a service other than Route 53, then you must manually add the Lightsail
// DNS zone name servers to your domain in order to delegate management of its DNS
// to Lightsail. For more information, see Creating a DNS zone to manage your
// domain’s records in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-create-dns-entry)
// in the Amazon Lightsail Developer Guide.
type RegisteredDomainDelegationInfo struct {
// An object that describes the state of the name server records that are
// automatically added to the Route 53 domain by Lightsail.
NameServersUpdateState *NameServersUpdateState
// Describes the deletion state of an Amazon Route 53 hosted zone for a domain
// that is being automatically delegated to an Amazon Lightsail DNS zone.
R53HostedZoneDeletionState *R53HostedZoneDeletionState
noSmithyDocumentSerde
}
// Describes a database.
type RelationalDatabase struct {
// The Amazon Resource Name (ARN) of the database.
Arn *string
// A Boolean value indicating whether automated backup retention is enabled for
// the database.
BackupRetentionEnabled *bool
// The certificate associated with the database.
CaCertificateIdentifier *string
// The timestamp when the database was created. Formatted in Unix time.
CreatedAt *time.Time
// The database software (for example, MySQL ).
Engine *string
// The database engine version (for example, 5.7.23 ).
EngineVersion *string
// Describes the hardware of the database.
Hardware *RelationalDatabaseHardware
// The latest point in time to which the database can be restored. Formatted in
// Unix time.
LatestRestorableTime *time.Time
// The Region name and Availability Zone where the database is located.
Location *ResourceLocation
// The name of the master database created when the Lightsail database resource is
// created.
MasterDatabaseName *string
// The master endpoint for the database.
MasterEndpoint *RelationalDatabaseEndpoint
// The master user name of the database.
MasterUsername *string
// The unique name of the database resource in Lightsail.
Name *string
// The status of parameter updates for the database.
ParameterApplyStatus *string
// Describes the pending maintenance actions for the database.
PendingMaintenanceActions []PendingMaintenanceAction
// Describes pending database value modifications.
PendingModifiedValues *PendingModifiedRelationalDatabaseValues
// The daily time range during which automated backups are created for the
// database (for example, 16:00-16:30 ).
PreferredBackupWindow *string
// The weekly time range during which system maintenance can occur on the
// database. In the format ddd:hh24:mi-ddd:hh24:mi . For example,
// Tue:17:00-Tue:17:30 .
PreferredMaintenanceWindow *string
// A Boolean value indicating whether the database is publicly accessible.
PubliclyAccessible *bool
// The blueprint ID for the database. A blueprint describes the major engine
// version of a database.
RelationalDatabaseBlueprintId *string
// The bundle ID for the database. A bundle describes the performance
// specifications for your database.
RelationalDatabaseBundleId *string
// The Lightsail resource type for the database (for example, RelationalDatabase ).
ResourceType ResourceType
// Describes the secondary Availability Zone of a high availability database. The
// secondary database is used for failover support of a high availability database.
SecondaryAvailabilityZone *string
// Describes the current state of the database.
State *string
// The support code for the database. Include this code in your email to support
// when you have questions about a database in Lightsail. This code enables our
// support team to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes a database image, or blueprint. A blueprint describes the major
// engine version of a database.
type RelationalDatabaseBlueprint struct {
// The ID for the database blueprint.
BlueprintId *string
// The database software of the database blueprint (for example, MySQL ).
Engine RelationalDatabaseEngine
// The description of the database engine for the database blueprint.
EngineDescription *string
// The database engine version for the database blueprint (for example, 5.7.23 ).
EngineVersion *string
// The description of the database engine version for the database blueprint.
EngineVersionDescription *string
// A Boolean value indicating whether the engine version is the default for the
// database blueprint.
IsEngineDefault *bool
noSmithyDocumentSerde
}
// Describes a database bundle. A bundle describes the performance specifications
// of the database.
type RelationalDatabaseBundle struct {
// The ID for the database bundle.
BundleId *string
// The number of virtual CPUs (vCPUs) for the database bundle.
CpuCount *int32
// The size of the disk for the database bundle.
DiskSizeInGb *int32
// A Boolean value indicating whether the database bundle is active.
IsActive *bool
// A Boolean value indicating whether the database bundle is encrypted.
IsEncrypted *bool
// The name for the database bundle.
Name *string
// The cost of the database bundle in US currency.
Price *float32
// The amount of RAM in GB (for example, 2.0 ) for the database bundle.
RamSizeInGb *float32
// The data transfer rate per month in GB for the database bundle.
TransferPerMonthInGb *int32
noSmithyDocumentSerde
}
// Describes an endpoint for a database.
type RelationalDatabaseEndpoint struct {
// Specifies the DNS address of the database.
Address *string
// Specifies the port that the database is listening on.
Port *int32
noSmithyDocumentSerde
}
// Describes an event for a database.
type RelationalDatabaseEvent struct {
// The timestamp when the database event was created.
CreatedAt *time.Time
// The category that the database event belongs to.
EventCategories []string
// The message of the database event.
Message *string
// The database that the database event relates to.
Resource *string
noSmithyDocumentSerde
}
// Describes the hardware of a database.
type RelationalDatabaseHardware struct {
// The number of vCPUs for the database.
CpuCount *int32
// The size of the disk for the database.
DiskSizeInGb *int32
// The amount of RAM in GB for the database.
RamSizeInGb *float32
noSmithyDocumentSerde
}
// Describes the parameters of a database.
type RelationalDatabaseParameter struct {
// Specifies the valid range of values for the parameter.
AllowedValues *string
// Indicates when parameter updates are applied. Can be immediate or pending-reboot
// .
ApplyMethod *string
// Specifies the engine-specific parameter type.
ApplyType *string
// Specifies the valid data type for the parameter.
DataType *string
// Provides a description of the parameter.
Description *string
// A Boolean value indicating whether the parameter can be modified.
IsModifiable *bool
// Specifies the name of the parameter.
ParameterName *string
// Specifies the value of the parameter.
ParameterValue *string
noSmithyDocumentSerde
}
// Describes a database snapshot.
type RelationalDatabaseSnapshot struct {
// The Amazon Resource Name (ARN) of the database snapshot.
Arn *string
// The timestamp when the database snapshot was created.
CreatedAt *time.Time
// The software of the database snapshot (for example, MySQL )
Engine *string
// The database engine version for the database snapshot (for example, 5.7.23 ).
EngineVersion *string
// The Amazon Resource Name (ARN) of the database from which the database snapshot
// was created.
FromRelationalDatabaseArn *string
// The blueprint ID of the database from which the database snapshot was created.
// A blueprint describes the major engine version of a database.
FromRelationalDatabaseBlueprintId *string
// The bundle ID of the database from which the database snapshot was created.
FromRelationalDatabaseBundleId *string
// The name of the source database from which the database snapshot was created.
FromRelationalDatabaseName *string
// The Region name and Availability Zone where the database snapshot is located.
Location *ResourceLocation
// The name of the database snapshot.
Name *string
// The Lightsail resource type.
ResourceType ResourceType
// The size of the disk in GB (for example, 32 ) for the database snapshot.
SizeInGb *int32
// The state of the database snapshot.
State *string
// The support code for the database snapshot. Include this code in your email to
// support when you have questions about a database snapshot in Lightsail. This
// code enables our support team to look up your Lightsail information more easily.
SupportCode *string
// The tag keys and optional values for the resource. For more information about
// tags in Lightsail, see the Amazon Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
Tags []Tag
noSmithyDocumentSerde
}
// Describes the status of a SSL/TLS certificate renewal managed by Amazon
// Lightsail.
type RenewalSummary struct {
// An array of objects that describe the domain validation records of the
// certificate.
DomainValidationRecords []DomainValidationRecord
// The renewal status of the certificate. The following renewal status are
// possible:
// - PendingAutoRenewal - Lightsail is attempting to automatically validate the
// domain names of the certificate. No further action is required.
// - PendingValidation - Lightsail couldn't automatically validate one or more
// domain names of the certificate. You must take action to validate these domain
// names or the certificate won't be renewed. Check to make sure your certificate's
// domain validation records exist in your domain's DNS, and that your certificate
// remains in use.
// - Success - All domain names in the certificate are validated, and Lightsail
// renewed the certificate. No further action is required.
// - Failed - One or more domain names were not validated before the certificate
// expired, and Lightsail did not renew the certificate. You can request a new
// certificate using the CreateCertificate action.
RenewalStatus RenewalStatus
// The reason for the renewal status of the certificate.
RenewalStatusReason *string
// The timestamp when the certificate was last updated.
UpdatedAt *time.Time
noSmithyDocumentSerde
}
// Describes the estimated cost or usage that a budget tracks.
type ResourceBudgetEstimate struct {
// The cost estimate for the specified budget.
CostEstimates []CostEstimate
// The estimate end time.
EndTime *time.Time
// The resource name.
ResourceName *string
// The type of resource the budget will track.
ResourceType ResourceType
// The estimate start time.
StartTime *time.Time
noSmithyDocumentSerde
}
// Describes the resource location.
type ResourceLocation struct {
// The Availability Zone. Follows the format us-east-2a (case-sensitive).
AvailabilityZone *string
// The Amazon Web Services Region name.
RegionName RegionName
noSmithyDocumentSerde
}
// Describes an Amazon Lightsail instance that has access to a Lightsail bucket.
type ResourceReceivingAccess struct {
// The name of the Lightsail instance.
Name *string
// The Lightsail resource type (for example, Instance ).
ResourceType *string
noSmithyDocumentSerde
}
// Describes the domain name system (DNS) records to add to your domain's DNS to
// validate it for an Amazon Lightsail certificate.
type ResourceRecord struct {
// The name of the record.
Name *string
// The DNS record type.
Type *string
// The value for the DNS record.
Value *string
noSmithyDocumentSerde
}
// Describes a web-based, remote graphical user interface (GUI), NICE DCV session.
// The session is used to access a virtual computer’s operating system or
// application.
type Session struct {
// When true, this Boolean value indicates the primary session for the specified
// resource.
IsPrimary *bool
// The session name.
Name *string
// The session URL.
Url *string
noSmithyDocumentSerde
}
// Describes a static IP.
type StaticIp struct {
// The Amazon Resource Name (ARN) of the static IP (e.g.,
// arn:aws:lightsail:us-east-2:123456789101:StaticIp/9cbb4a9e-f8e3-4dfe-b57e-12345EXAMPLE
// ).
Arn *string
// The instance where the static IP is attached (e.g., Amazon_Linux-1GB-Ohio-1 ).
AttachedTo *string
// The timestamp when the static IP was created (e.g., 1479735304.222 ).
CreatedAt *time.Time
// The static IP address.
IpAddress *string
// A Boolean value indicating whether the static IP is attached.
IsAttached *bool
// The region and Availability Zone where the static IP was created.
Location *ResourceLocation
// The name of the static IP (e.g., StaticIP-Ohio-EXAMPLE ).
Name *string
// The resource type (usually StaticIp ).
ResourceType ResourceType
// The support code. Include this code in your email to support when you have
// questions about an instance or another resource in Lightsail. This code enables
// our support team to look up your Lightsail information more easily.
SupportCode *string
noSmithyDocumentSerde
}
// Describes a request to create or edit the StopInstanceOnIdle add-on. This
// add-on only applies to Lightsail for Research resources.
type StopInstanceOnIdleRequest struct {
// The amount of idle time in minutes after which your virtual computer will
// automatically stop.
Duration *string
// The value to compare with the duration.
Threshold *string
noSmithyDocumentSerde
}
// Describes a tag key and optional value assigned to an Amazon Lightsail
// resource. For more information about tags in Lightsail, see the Amazon
// Lightsail Developer Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags)
// .
type Tag struct {
// The key of the tag. Constraints: Tag keys accept a maximum of 128 letters,
// numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
Key *string
// The value of the tag. Constraints: Tag values accept a maximum of 256 letters,
// numbers, spaces in UTF-8, or the following characters: + - = . _ : / @
Value *string
noSmithyDocumentSerde
}
// Sets the start date and end date for retrieving a cost estimate. The start date
// is inclusive, but the end date is exclusive. For example, if start is 2017-01-01
// and end is 2017-05-01 , then the cost and usage data is retrieved from
// 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01 .
type TimePeriod struct {
// The end of the time period. The end date is exclusive. For example, if end is
// 2017-05-01 , Lightsail for Research retrieves cost and usage data from the start
// date up to, but not including, 2017-05-01 .
End *time.Time
// The beginning of the time period. The start date is inclusive. For example, if
// start is 2017-01-01 , Lightsail for Research retrieves cost and usage data
// starting at 2017-01-01 up to the end date. The start date must be equal to or
// no later than the current date to avoid a validation error.
Start *time.Time
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 3,900 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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 = "Location"
const ServiceAPIVersion = "2020-11-19"
// Client provides the API client to make operations call for Amazon Location
// 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, "location", 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 location
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 location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an association between a geofence collection and a tracker resource.
// This allows the tracker resource to communicate location data to the linked
// geofence collection. You can associate up to five geofence collections to each
// tracker resource. Currently not supported — Cross-account configurations, such
// as creating associations between a tracker resource in one account and a
// geofence collection in another account.
func (c *Client) AssociateTrackerConsumer(ctx context.Context, params *AssociateTrackerConsumerInput, optFns ...func(*Options)) (*AssociateTrackerConsumerOutput, error) {
if params == nil {
params = &AssociateTrackerConsumerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateTrackerConsumer", params, optFns, c.addOperationAssociateTrackerConsumerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateTrackerConsumerOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateTrackerConsumerInput struct {
// The Amazon Resource Name (ARN) for the geofence collection to be associated to
// tracker resource. Used when you need to specify a resource across all Amazon Web
// Services.
// - Format example:
// arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollectionConsumer
//
// This member is required.
ConsumerArn *string
// The name of the tracker resource to be associated with a geofence collection.
//
// This member is required.
TrackerName *string
noSmithyDocumentSerde
}
type AssociateTrackerConsumerOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateTrackerConsumerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateTrackerConsumer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateTrackerConsumer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opAssociateTrackerConsumerMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateTrackerConsumerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateTrackerConsumer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opAssociateTrackerConsumerMiddleware struct {
}
func (*endpointPrefix_opAssociateTrackerConsumerMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opAssociateTrackerConsumerMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opAssociateTrackerConsumerMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opAssociateTrackerConsumerMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opAssociateTrackerConsumer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "AssociateTrackerConsumer",
}
}
| 165 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a batch of geofences from a geofence collection. This operation deletes
// the resource permanently.
func (c *Client) BatchDeleteGeofence(ctx context.Context, params *BatchDeleteGeofenceInput, optFns ...func(*Options)) (*BatchDeleteGeofenceOutput, error) {
if params == nil {
params = &BatchDeleteGeofenceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchDeleteGeofence", params, optFns, c.addOperationBatchDeleteGeofenceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchDeleteGeofenceOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchDeleteGeofenceInput struct {
// The geofence collection storing the geofences to be deleted.
//
// This member is required.
CollectionName *string
// The batch of geofences to be deleted.
//
// This member is required.
GeofenceIds []string
noSmithyDocumentSerde
}
type BatchDeleteGeofenceOutput struct {
// Contains error details for each geofence that failed to delete.
//
// This member is required.
Errors []types.BatchDeleteGeofenceError
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchDeleteGeofenceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchDeleteGeofence{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchDeleteGeofence{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opBatchDeleteGeofenceMiddleware(stack); err != nil {
return err
}
if err = addOpBatchDeleteGeofenceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteGeofence(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opBatchDeleteGeofenceMiddleware struct {
}
func (*endpointPrefix_opBatchDeleteGeofenceMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opBatchDeleteGeofenceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opBatchDeleteGeofenceMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opBatchDeleteGeofenceMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opBatchDeleteGeofence(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "BatchDeleteGeofence",
}
}
| 164 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Evaluates device positions against the geofence geometries from a given
// geofence collection. This operation always returns an empty response because
// geofences are asynchronously evaluated. The evaluation determines if the device
// has entered or exited a geofenced area, and then publishes one of the following
// events to Amazon EventBridge:
// - ENTER if Amazon Location determines that the tracked device has entered a
// geofenced area.
// - EXIT if Amazon Location determines that the tracked device has exited a
// geofenced area.
//
// The last geofence that a device was observed within is tracked for 30 days
// after the most recent device position update. Geofence evaluation uses the given
// device position. It does not account for the optional Accuracy of a
// DevicePositionUpdate . The DeviceID is used as a string to represent the
// device. You do not need to have a Tracker associated with the DeviceID .
func (c *Client) BatchEvaluateGeofences(ctx context.Context, params *BatchEvaluateGeofencesInput, optFns ...func(*Options)) (*BatchEvaluateGeofencesOutput, error) {
if params == nil {
params = &BatchEvaluateGeofencesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchEvaluateGeofences", params, optFns, c.addOperationBatchEvaluateGeofencesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchEvaluateGeofencesOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchEvaluateGeofencesInput struct {
// The geofence collection used in evaluating the position of devices against its
// geofences.
//
// This member is required.
CollectionName *string
// Contains device details for each device to be evaluated against the given
// geofence collection.
//
// This member is required.
DevicePositionUpdates []types.DevicePositionUpdate
noSmithyDocumentSerde
}
type BatchEvaluateGeofencesOutput struct {
// Contains error details for each device that failed to evaluate its position
// against the given geofence collection.
//
// This member is required.
Errors []types.BatchEvaluateGeofencesError
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchEvaluateGeofencesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchEvaluateGeofences{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchEvaluateGeofences{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opBatchEvaluateGeofencesMiddleware(stack); err != nil {
return err
}
if err = addOpBatchEvaluateGeofencesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchEvaluateGeofences(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opBatchEvaluateGeofencesMiddleware struct {
}
func (*endpointPrefix_opBatchEvaluateGeofencesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opBatchEvaluateGeofencesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opBatchEvaluateGeofencesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opBatchEvaluateGeofencesMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opBatchEvaluateGeofences(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "BatchEvaluateGeofences",
}
}
| 180 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the latest device positions for requested devices.
func (c *Client) BatchGetDevicePosition(ctx context.Context, params *BatchGetDevicePositionInput, optFns ...func(*Options)) (*BatchGetDevicePositionOutput, error) {
if params == nil {
params = &BatchGetDevicePositionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchGetDevicePosition", params, optFns, c.addOperationBatchGetDevicePositionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchGetDevicePositionOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchGetDevicePositionInput struct {
// Devices whose position you want to retrieve.
// - For example, for two devices: device-ids=DeviceId1&device-ids=DeviceId2
//
// This member is required.
DeviceIds []string
// The tracker resource retrieving the device position.
//
// This member is required.
TrackerName *string
noSmithyDocumentSerde
}
type BatchGetDevicePositionOutput struct {
// Contains device position details such as the device ID, position, and
// timestamps for when the position was received and sampled.
//
// This member is required.
DevicePositions []types.DevicePosition
// Contains error details for each device that failed to send its position to the
// tracker resource.
//
// This member is required.
Errors []types.BatchGetDevicePositionError
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchGetDevicePositionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchGetDevicePosition{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchGetDevicePosition{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opBatchGetDevicePositionMiddleware(stack); err != nil {
return err
}
if err = addOpBatchGetDevicePositionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetDevicePosition(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opBatchGetDevicePositionMiddleware struct {
}
func (*endpointPrefix_opBatchGetDevicePositionMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opBatchGetDevicePositionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opBatchGetDevicePositionMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opBatchGetDevicePositionMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opBatchGetDevicePosition(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "BatchGetDevicePosition",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// A batch request for storing geofence geometries into a given geofence
// collection, or updates the geometry of an existing geofence if a geofence ID is
// included in the request.
func (c *Client) BatchPutGeofence(ctx context.Context, params *BatchPutGeofenceInput, optFns ...func(*Options)) (*BatchPutGeofenceOutput, error) {
if params == nil {
params = &BatchPutGeofenceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchPutGeofence", params, optFns, c.addOperationBatchPutGeofenceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchPutGeofenceOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchPutGeofenceInput struct {
// The geofence collection storing the geofences.
//
// This member is required.
CollectionName *string
// The batch of geofences to be stored in a geofence collection.
//
// This member is required.
Entries []types.BatchPutGeofenceRequestEntry
noSmithyDocumentSerde
}
type BatchPutGeofenceOutput struct {
// Contains additional error details for each geofence that failed to be stored in
// a geofence collection.
//
// This member is required.
Errors []types.BatchPutGeofenceError
// Contains each geofence that was successfully stored in a geofence collection.
//
// This member is required.
Successes []types.BatchPutGeofenceSuccess
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchPutGeofenceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchPutGeofence{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchPutGeofence{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opBatchPutGeofenceMiddleware(stack); err != nil {
return err
}
if err = addOpBatchPutGeofenceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchPutGeofence(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opBatchPutGeofenceMiddleware struct {
}
func (*endpointPrefix_opBatchPutGeofenceMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opBatchPutGeofenceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opBatchPutGeofenceMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opBatchPutGeofenceMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opBatchPutGeofence(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "BatchPutGeofence",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Uploads position update data for one or more devices to a tracker resource (up
// to 10 devices per batch). Amazon Location uses the data when it reports the last
// known device position and position history. Amazon Location retains location
// data for 30 days. Position updates are handled based on the PositionFiltering
// property of the tracker. When PositionFiltering is set to TimeBased , updates
// are evaluated against linked geofence collections, and location data is stored
// at a maximum of one position per 30 second interval. If your update frequency is
// more often than every 30 seconds, only one update per 30 seconds is stored for
// each unique device ID. When PositionFiltering is set to DistanceBased
// filtering, location data is stored and evaluated against linked geofence
// collections only if the device has moved more than 30 m (98.4 ft). When
// PositionFiltering is set to AccuracyBased filtering, location data is stored
// and evaluated against linked geofence collections only if the device has moved
// more than the measured accuracy. For example, if two consecutive updates from a
// device have a horizontal accuracy of 5 m and 10 m, the second update is neither
// stored or evaluated if the device has moved less than 15 m. If PositionFiltering
// is set to AccuracyBased filtering, Amazon Location uses the default value {
// "Horizontal": 0} when accuracy is not provided on a DevicePositionUpdate .
func (c *Client) BatchUpdateDevicePosition(ctx context.Context, params *BatchUpdateDevicePositionInput, optFns ...func(*Options)) (*BatchUpdateDevicePositionOutput, error) {
if params == nil {
params = &BatchUpdateDevicePositionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchUpdateDevicePosition", params, optFns, c.addOperationBatchUpdateDevicePositionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchUpdateDevicePositionOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchUpdateDevicePositionInput struct {
// The name of the tracker resource to update.
//
// This member is required.
TrackerName *string
// Contains the position update details for each device, up to 10 devices.
//
// This member is required.
Updates []types.DevicePositionUpdate
noSmithyDocumentSerde
}
type BatchUpdateDevicePositionOutput struct {
// Contains error details for each device that failed to update its position.
//
// This member is required.
Errors []types.BatchUpdateDevicePositionError
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchUpdateDevicePositionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchUpdateDevicePosition{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchUpdateDevicePosition{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opBatchUpdateDevicePositionMiddleware(stack); err != nil {
return err
}
if err = addOpBatchUpdateDevicePositionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchUpdateDevicePosition(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opBatchUpdateDevicePositionMiddleware struct {
}
func (*endpointPrefix_opBatchUpdateDevicePositionMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opBatchUpdateDevicePositionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opBatchUpdateDevicePositionMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opBatchUpdateDevicePositionMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opBatchUpdateDevicePosition(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "BatchUpdateDevicePosition",
}
}
| 180 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Calculates a route (https://docs.aws.amazon.com/location/latest/developerguide/calculate-route.html)
// given the following required parameters: DeparturePosition and
// DestinationPosition . Requires that you first create a route calculator resource (https://docs.aws.amazon.com/location-routes/latest/APIReference/API_CreateRouteCalculator.html)
// . By default, a request that doesn't specify a departure time uses the best time
// of day to travel with the best traffic conditions when calculating the route.
// Additional options include:
// - Specifying a departure time (https://docs.aws.amazon.com/location/latest/developerguide/departure-time.html)
// using either DepartureTime or DepartNow . This calculates a route based on
// predictive traffic data at the given time. You can't specify both
// DepartureTime and DepartNow in a single request. Specifying both parameters
// returns a validation error.
// - Specifying a travel mode (https://docs.aws.amazon.com/location/latest/developerguide/travel-mode.html)
// using TravelMode sets the transportation mode used to calculate the routes. This
// also lets you specify additional route preferences in CarModeOptions if
// traveling by Car , or TruckModeOptions if traveling by Truck . If you specify
// walking for the travel mode and your data provider is Esri, the start and
// destination must be within 40km.
func (c *Client) CalculateRoute(ctx context.Context, params *CalculateRouteInput, optFns ...func(*Options)) (*CalculateRouteOutput, error) {
if params == nil {
params = &CalculateRouteInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CalculateRoute", params, optFns, c.addOperationCalculateRouteMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CalculateRouteOutput)
out.ResultMetadata = metadata
return out, nil
}
type CalculateRouteInput struct {
// The name of the route calculator resource that you want to use to calculate the
// route.
//
// This member is required.
CalculatorName *string
// The start position for the route. Defined in World Geodetic System (WGS 84) (https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84)
// format: [longitude, latitude] .
// - For example, [-123.115, 49.285]
// If you specify a departure that's not located on a road, Amazon Location moves
// the position to the nearest road (https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html)
// . If Esri is the provider for your route calculator, specifying a route that is
// longer than 400 km returns a 400 RoutesValidationException error. Valid Values:
// [-180 to 180,-90 to 90]
//
// This member is required.
DeparturePosition []float64
// The finish position for the route. Defined in World Geodetic System (WGS 84) (https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84)
// format: [longitude, latitude] .
// - For example, [-122.339, 47.615]
// If you specify a destination that's not located on a road, Amazon Location
// moves the position to the nearest road (https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html)
// . Valid Values: [-180 to 180,-90 to 90]
//
// This member is required.
DestinationPosition []float64
// Specifies route preferences when traveling by Car , such as avoiding routes that
// use ferries or tolls. Requirements: TravelMode must be specified as Car .
CarModeOptions *types.CalculateRouteCarModeOptions
// Sets the time of departure as the current time. Uses the current time to
// calculate a route. Otherwise, the best time of day to travel with the best
// traffic conditions is used to calculate the route. Default Value: false Valid
// Values: false | true
DepartNow *bool
// Specifies the desired time of departure. Uses the given time to calculate the
// route. Otherwise, the best time of day to travel with the best traffic
// conditions is used to calculate the route. Setting a departure time in the past
// returns a 400 ValidationException error.
// - In ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html) format:
// YYYY-MM-DDThh:mm:ss.sssZ . For example, 2020–07-2T12:15:20.000Z+01:00
DepartureTime *time.Time
// Set the unit system to specify the distance. Default Value: Kilometers
DistanceUnit types.DistanceUnit
// Set to include the geometry details in the result for each path between a pair
// of positions. Default Value: false Valid Values: false | true
IncludeLegGeometry *bool
// Specifies the mode of transport when calculating a route. Used in estimating
// the speed of travel and road compatibility. You can choose Car , Truck , Walking
// , Bicycle or Motorcycle as options for the TravelMode . Bicycle and Motorcycle
// are only valid when using Grab as a data provider, and only within Southeast
// Asia. Truck is not available for Grab. For more details on the using Grab for
// routing, including areas of coverage, see GrabMaps (https://docs.aws.amazon.com/location/latest/developerguide/grab.html)
// in the Amazon Location Service Developer Guide. The TravelMode you specify also
// determines how you specify route preferences:
// - If traveling by Car use the CarModeOptions parameter.
// - If traveling by Truck use the TruckModeOptions parameter.
// Default Value: Car
TravelMode types.TravelMode
// Specifies route preferences when traveling by Truck , such as avoiding routes
// that use ferries or tolls, and truck specifications to consider when choosing an
// optimal road. Requirements: TravelMode must be specified as Truck .
TruckModeOptions *types.CalculateRouteTruckModeOptions
// Specifies an ordered list of up to 23 intermediate positions to include along a
// route between the departure position and destination position.
// - For example, from the DeparturePosition [-123.115, 49.285] , the route
// follows the order that the waypoint positions are given [[-122.757,
// 49.0021],[-122.349, 47.620]]
// If you specify a waypoint position that's not located on a road, Amazon
// Location moves the position to the nearest road (https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html)
// . Specifying more than 23 waypoints returns a 400 ValidationException error. If
// Esri is the provider for your route calculator, specifying a route that is
// longer than 400 km returns a 400 RoutesValidationException error. Valid Values:
// [-180 to 180,-90 to 90]
WaypointPositions [][]float64
noSmithyDocumentSerde
}
// Returns the result of the route calculation. Metadata includes legs and route
// summary.
type CalculateRouteOutput struct {
// Contains details about each path between a pair of positions included along a
// route such as: StartPosition , EndPosition , Distance , DurationSeconds ,
// Geometry , and Steps . The number of legs returned corresponds to one fewer than
// the total number of positions in the request. For example, a route with a
// departure position and destination position returns one leg with the positions
// snapped to a nearby road (https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html)
// :
// - The StartPosition is the departure position.
// - The EndPosition is the destination position.
// A route with a waypoint between the departure and destination position returns
// two legs with the positions snapped to a nearby road:
// - Leg 1: The StartPosition is the departure position . The EndPosition is the
// waypoint positon.
// - Leg 2: The StartPosition is the waypoint position. The EndPosition is the
// destination position.
//
// This member is required.
Legs []types.Leg
// Contains information about the whole route, such as: RouteBBox , DataSource ,
// Distance , DistanceUnit , and DurationSeconds .
//
// This member is required.
Summary *types.CalculateRouteSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCalculateRouteMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCalculateRoute{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCalculateRoute{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opCalculateRouteMiddleware(stack); err != nil {
return err
}
if err = addOpCalculateRouteValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCalculateRoute(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opCalculateRouteMiddleware struct {
}
func (*endpointPrefix_opCalculateRouteMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opCalculateRouteMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "routes." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opCalculateRouteMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opCalculateRouteMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opCalculateRoute(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "CalculateRoute",
}
}
| 276 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Calculates a route matrix (https://docs.aws.amazon.com/location/latest/developerguide/calculate-route-matrix.html)
//
// given the following required parameters: DeparturePositions and
// DestinationPositions . CalculateRouteMatrix calculates routes and returns the
// travel time and travel distance from each departure position to each destination
// position in the request. For example, given departure positions A and B, and
// destination positions X and Y, CalculateRouteMatrix will return time and
// distance for routes from A to X, A to Y, B to X, and B to Y (in that order). The
// number of results returned (and routes calculated) will be the number of
// DeparturePositions times the number of DestinationPositions . Your account is
// charged for each route calculated, not the number of requests. Requires that you
// first create a route calculator resource (https://docs.aws.amazon.com/location-routes/latest/APIReference/API_CreateRouteCalculator.html)
// . By default, a request that doesn't specify a departure time uses the best time
// of day to travel with the best traffic conditions when calculating routes.
// Additional options include:
// - Specifying a departure time (https://docs.aws.amazon.com/location/latest/developerguide/departure-time.html)
// using either DepartureTime or DepartNow . This calculates routes based on
// predictive traffic data at the given time. You can't specify both
// DepartureTime and DepartNow in a single request. Specifying both parameters
// returns a validation error.
// - Specifying a travel mode (https://docs.aws.amazon.com/location/latest/developerguide/travel-mode.html)
// using TravelMode sets the transportation mode used to calculate the routes. This
// also lets you specify additional route preferences in CarModeOptions if
// traveling by Car , or TruckModeOptions if traveling by Truck .
func (c *Client) CalculateRouteMatrix(ctx context.Context, params *CalculateRouteMatrixInput, optFns ...func(*Options)) (*CalculateRouteMatrixOutput, error) {
if params == nil {
params = &CalculateRouteMatrixInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CalculateRouteMatrix", params, optFns, c.addOperationCalculateRouteMatrixMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CalculateRouteMatrixOutput)
out.ResultMetadata = metadata
return out, nil
}
type CalculateRouteMatrixInput struct {
// The name of the route calculator resource that you want to use to calculate the
// route matrix.
//
// This member is required.
CalculatorName *string
// The list of departure (origin) positions for the route matrix. An array of
// points, each of which is itself a 2-value array defined in WGS 84 (https://earth-info.nga.mil/GandG/wgs84/index.html)
// format: [longitude, latitude] . For example, [-123.115, 49.285] . Depending on
// the data provider selected in the route calculator resource there may be
// additional restrictions on the inputs you can choose. See Position restrictions (https://docs.aws.amazon.com/location/latest/developerguide/calculate-route-matrix.html#matrix-routing-position-limits)
// in the Amazon Location Service Developer Guide. For route calculators that use
// Esri as the data provider, if you specify a departure that's not located on a
// road, Amazon Location moves the position to the nearest road (https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html)
// . The snapped value is available in the result in SnappedDeparturePositions .
// Valid Values: [-180 to 180,-90 to 90]
//
// This member is required.
DeparturePositions [][]float64
// The list of destination positions for the route matrix. An array of points,
// each of which is itself a 2-value array defined in WGS 84 (https://earth-info.nga.mil/GandG/wgs84/index.html)
// format: [longitude, latitude] . For example, [-122.339, 47.615] Depending on
// the data provider selected in the route calculator resource there may be
// additional restrictions on the inputs you can choose. See Position restrictions (https://docs.aws.amazon.com/location/latest/developerguide/calculate-route-matrix.html#matrix-routing-position-limits)
// in the Amazon Location Service Developer Guide. For route calculators that use
// Esri as the data provider, if you specify a destination that's not located on a
// road, Amazon Location moves the position to the nearest road (https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html)
// . The snapped value is available in the result in SnappedDestinationPositions .
// Valid Values: [-180 to 180,-90 to 90]
//
// This member is required.
DestinationPositions [][]float64
// Specifies route preferences when traveling by Car , such as avoiding routes that
// use ferries or tolls. Requirements: TravelMode must be specified as Car .
CarModeOptions *types.CalculateRouteCarModeOptions
// Sets the time of departure as the current time. Uses the current time to
// calculate the route matrix. You can't set both DepartureTime and DepartNow . If
// neither is set, the best time of day to travel with the best traffic conditions
// is used to calculate the route matrix. Default Value: false Valid Values: false
// | true
DepartNow *bool
// Specifies the desired time of departure. Uses the given time to calculate the
// route matrix. You can't set both DepartureTime and DepartNow . If neither is
// set, the best time of day to travel with the best traffic conditions is used to
// calculate the route matrix. Setting a departure time in the past returns a 400
// ValidationException error.
// - In ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html) format:
// YYYY-MM-DDThh:mm:ss.sssZ . For example, 2020–07-2T12:15:20.000Z+01:00
DepartureTime *time.Time
// Set the unit system to specify the distance. Default Value: Kilometers
DistanceUnit types.DistanceUnit
// Specifies the mode of transport when calculating a route. Used in estimating
// the speed of travel and road compatibility. The TravelMode you specify also
// determines how you specify route preferences:
// - If traveling by Car use the CarModeOptions parameter.
// - If traveling by Truck use the TruckModeOptions parameter.
// Bicycle or Motorcycle are only valid when using Grab as a data provider, and
// only within Southeast Asia. Truck is not available for Grab. For more
// information about using Grab as a data provider, see GrabMaps (https://docs.aws.amazon.com/location/latest/developerguide/grab.html)
// in the Amazon Location Service Developer Guide. Default Value: Car
TravelMode types.TravelMode
// Specifies route preferences when traveling by Truck , such as avoiding routes
// that use ferries or tolls, and truck specifications to consider when choosing an
// optimal road. Requirements: TravelMode must be specified as Truck .
TruckModeOptions *types.CalculateRouteTruckModeOptions
noSmithyDocumentSerde
}
// Returns the result of the route matrix calculation.
type CalculateRouteMatrixOutput struct {
// The calculated route matrix containing the results for all pairs of
// DeparturePositions to DestinationPositions . Each row corresponds to one entry
// in DeparturePositions . Each entry in the row corresponds to the route from that
// entry in DeparturePositions to an entry in DestinationPositions .
//
// This member is required.
RouteMatrix [][]types.RouteMatrixEntry
// Contains information about the route matrix, DataSource , DistanceUnit ,
// RouteCount and ErrorCount .
//
// This member is required.
Summary *types.CalculateRouteMatrixSummary
// For routes calculated using an Esri route calculator resource, departure
// positions are snapped to the closest road. For Esri route calculator resources,
// this returns the list of departure/origin positions used for calculation of the
// RouteMatrix .
SnappedDeparturePositions [][]float64
// The list of destination positions for the route matrix used for calculation of
// the RouteMatrix .
SnappedDestinationPositions [][]float64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCalculateRouteMatrixMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCalculateRouteMatrix{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCalculateRouteMatrix{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opCalculateRouteMatrixMiddleware(stack); err != nil {
return err
}
if err = addOpCalculateRouteMatrixValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCalculateRouteMatrix(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opCalculateRouteMatrixMiddleware struct {
}
func (*endpointPrefix_opCalculateRouteMatrixMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opCalculateRouteMatrixMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "routes." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opCalculateRouteMatrixMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opCalculateRouteMatrixMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opCalculateRouteMatrix(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "CalculateRouteMatrix",
}
}
| 270 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a geofence collection, which manages and stores geofences.
func (c *Client) CreateGeofenceCollection(ctx context.Context, params *CreateGeofenceCollectionInput, optFns ...func(*Options)) (*CreateGeofenceCollectionOutput, error) {
if params == nil {
params = &CreateGeofenceCollectionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateGeofenceCollection", params, optFns, c.addOperationCreateGeofenceCollectionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateGeofenceCollectionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateGeofenceCollectionInput struct {
// A custom name for the geofence collection. Requirements:
// - Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods
// (.), and underscores (_).
// - Must be a unique geofence collection name.
// - No spaces allowed. For example, ExampleGeofenceCollection .
//
// This member is required.
CollectionName *string
// An optional description for the geofence collection.
Description *string
// A key identifier for an Amazon Web Services KMS customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html)
// . Enter a key ID, key ARN, alias name, or alias ARN.
KmsKeyId *string
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
// This parameter is no longer used.
//
// Deprecated: Deprecated. No longer allowed.
PricingPlanDataSource *string
// Applies one or more tags to the geofence collection. A tag is a key-value pair
// helps manage, identify, search, and filter your resources by labelling them.
// Format: "key" : "value" Restrictions:
// - Maximum 50 tags per resource
// - Each resource tag must be unique with a maximum of one value.
// - Maximum key length: 128 Unicode characters in UTF-8
// - Maximum value length: 256 Unicode characters in UTF-8
// - Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
// characters: + - = . _ : / @.
// - Cannot use "aws:" as a prefix for a key.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateGeofenceCollectionOutput struct {
// The Amazon Resource Name (ARN) for the geofence collection resource. Used when
// you need to specify a resource across all Amazon Web Services.
// - Format example:
// arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollection
//
// This member is required.
CollectionArn *string
// The name for the geofence collection.
//
// This member is required.
CollectionName *string
// The timestamp for when the geofence collection was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
CreateTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateGeofenceCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateGeofenceCollection{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateGeofenceCollection{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opCreateGeofenceCollectionMiddleware(stack); err != nil {
return err
}
if err = addOpCreateGeofenceCollectionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateGeofenceCollection(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opCreateGeofenceCollectionMiddleware struct {
}
func (*endpointPrefix_opCreateGeofenceCollectionMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opCreateGeofenceCollectionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opCreateGeofenceCollectionMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opCreateGeofenceCollectionMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opCreateGeofenceCollection(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "CreateGeofenceCollection",
}
}
| 207 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an API key resource in your Amazon Web Services account, which lets you
// grant geo:GetMap* actions for Amazon Location Map resources to the API key
// bearer. The API keys feature is in preview. We may add, change, or remove
// features before announcing general availability. For more information, see
// Using API keys (https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html)
// .
func (c *Client) CreateKey(ctx context.Context, params *CreateKeyInput, optFns ...func(*Options)) (*CreateKeyOutput, error) {
if params == nil {
params = &CreateKeyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateKey", params, optFns, c.addOperationCreateKeyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateKeyOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateKeyInput struct {
// A custom name for the API key resource. Requirements:
// - Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods
// (.), and underscores (_).
// - Must be a unique API key name.
// - No spaces allowed. For example, ExampleAPIKey .
//
// This member is required.
KeyName *string
// The API key restrictions for the API key resource.
//
// This member is required.
Restrictions *types.ApiKeyRestrictions
// An optional description for the API key resource.
Description *string
// The optional timestamp for when the API key resource will expire in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ . One of NoExpiry or ExpireTime must be set.
ExpireTime *time.Time
// Optionally set to true to set no expiration time for the API key. One of
// NoExpiry or ExpireTime must be set.
NoExpiry *bool
// Applies one or more tags to the map resource. A tag is a key-value pair that
// helps manage, identify, search, and filter your resources by labelling them.
// Format: "key" : "value" Restrictions:
// - Maximum 50 tags per resource
// - Each resource tag must be unique with a maximum of one value.
// - Maximum key length: 128 Unicode characters in UTF-8
// - Maximum value length: 256 Unicode characters in UTF-8
// - Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
// characters: + - = . _ : / @.
// - Cannot use "aws:" as a prefix for a key.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateKeyOutput struct {
// The timestamp for when the API key resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The key value/string of an API key. This value is used when making API calls to
// authorize the call. For example, see GetMapGlyphs (https://docs.aws.amazon.com/location/latest/APIReference/API_GetMapGlyphs.html)
// .
//
// This member is required.
Key *string
// The Amazon Resource Name (ARN) for the API key resource. Used when you need to
// specify a resource across all Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:key/ExampleKey
//
// This member is required.
KeyArn *string
// The name of the API key resource.
//
// This member is required.
KeyName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateKeyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateKey{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateKey{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opCreateKeyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateKeyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opCreateKeyMiddleware struct {
}
func (*endpointPrefix_opCreateKeyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opCreateKeyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "metadata." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opCreateKeyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opCreateKeyMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opCreateKey(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "CreateKey",
}
}
| 216 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a map resource in your Amazon Web Services account, which provides map
// tiles of different styles sourced from global location data providers. If your
// application is tracking or routing assets you use in your business, such as
// delivery vehicles or employees, you must not use Esri as your geolocation
// provider. See section 82 of the Amazon Web Services service terms (http://aws.amazon.com/service-terms)
// for more details.
func (c *Client) CreateMap(ctx context.Context, params *CreateMapInput, optFns ...func(*Options)) (*CreateMapOutput, error) {
if params == nil {
params = &CreateMapInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateMap", params, optFns, c.addOperationCreateMapMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateMapOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateMapInput struct {
// Specifies the MapConfiguration , including the map style, for the map resource
// that you create. The map style defines the look of maps and the data provider
// for your map resource.
//
// This member is required.
Configuration *types.MapConfiguration
// The name for the map resource. Requirements:
// - Must contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-),
// periods (.), and underscores (_).
// - Must be a unique map resource name.
// - No spaces allowed. For example, ExampleMap .
//
// This member is required.
MapName *string
// An optional description for the map resource.
Description *string
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
// Applies one or more tags to the map resource. A tag is a key-value pair helps
// manage, identify, search, and filter your resources by labelling them. Format:
// "key" : "value" Restrictions:
// - Maximum 50 tags per resource
// - Each resource tag must be unique with a maximum of one value.
// - Maximum key length: 128 Unicode characters in UTF-8
// - Maximum value length: 256 Unicode characters in UTF-8
// - Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
// characters: + - = . _ : / @.
// - Cannot use "aws:" as a prefix for a key.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateMapOutput struct {
// The timestamp for when the map resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The Amazon Resource Name (ARN) for the map resource. Used to specify a resource
// across all Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:map/ExampleMap
//
// This member is required.
MapArn *string
// The name of the map resource.
//
// This member is required.
MapName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateMapMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateMap{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateMap{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opCreateMapMiddleware(stack); err != nil {
return err
}
if err = addOpCreateMapValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMap(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opCreateMapMiddleware struct {
}
func (*endpointPrefix_opCreateMapMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opCreateMapMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "maps." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opCreateMapMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opCreateMapMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opCreateMap(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "CreateMap",
}
}
| 209 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a place index resource in your Amazon Web Services account. Use a place
// index resource to geocode addresses and other text queries by using the
// SearchPlaceIndexForText operation, and reverse geocode coordinates by using the
// SearchPlaceIndexForPosition operation, and enable autosuggestions by using the
// SearchPlaceIndexForSuggestions operation. If your application is tracking or
// routing assets you use in your business, such as delivery vehicles or employees,
// you must not use Esri as your geolocation provider. See section 82 of the
// Amazon Web Services service terms (http://aws.amazon.com/service-terms) for more
// details.
func (c *Client) CreatePlaceIndex(ctx context.Context, params *CreatePlaceIndexInput, optFns ...func(*Options)) (*CreatePlaceIndexOutput, error) {
if params == nil {
params = &CreatePlaceIndexInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreatePlaceIndex", params, optFns, c.addOperationCreatePlaceIndexMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreatePlaceIndexOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreatePlaceIndexInput struct {
// Specifies the geospatial data provider for the new place index. This field is
// case-sensitive. Enter the valid values as shown. For example, entering HERE
// returns an error. Valid values include:
// - Esri – For additional information about Esri (https://docs.aws.amazon.com/location/latest/developerguide/esri.html)
// 's coverage in your region of interest, see Esri details on geocoding coverage (https://developers.arcgis.com/rest/geocode/api-reference/geocode-coverage.htm)
// .
// - Grab – Grab provides place index functionality for Southeast Asia. For
// additional information about GrabMaps (https://docs.aws.amazon.com/location/latest/developerguide/grab.html)
// ' coverage, see GrabMaps countries and areas covered (https://docs.aws.amazon.com/location/latest/developerguide/grab.html#grab-coverage-area)
// .
// - Here – For additional information about HERE Technologies (https://docs.aws.amazon.com/location/latest/developerguide/HERE.html)
// ' coverage in your region of interest, see HERE details on goecoding coverage (https://developer.here.com/documentation/geocoder/dev_guide/topics/coverage-geocoder.html)
// . If you specify HERE Technologies ( Here ) as the data provider, you may not
// store results (https://docs.aws.amazon.com/location-places/latest/APIReference/API_DataSourceConfiguration.html)
// for locations in Japan. For more information, see the Amazon Web Services
// Service Terms (http://aws.amazon.com/service-terms/) for Amazon Location
// Service.
// For additional information , see Data providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// on the Amazon Location Service Developer Guide.
//
// This member is required.
DataSource *string
// The name of the place index resource. Requirements:
// - Contain only alphanumeric characters (A–Z, a–z, 0–9), hyphens (-), periods
// (.), and underscores (_).
// - Must be a unique place index resource name.
// - No spaces allowed. For example, ExamplePlaceIndex .
//
// This member is required.
IndexName *string
// Specifies the data storage option requesting Places.
DataSourceConfiguration *types.DataSourceConfiguration
// The optional description for the place index resource.
Description *string
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
// Applies one or more tags to the place index resource. A tag is a key-value pair
// that helps you manage, identify, search, and filter your resources. Format:
// "key" : "value" Restrictions:
// - Maximum 50 tags per resource.
// - Each tag key must be unique and must have exactly one associated value.
// - Maximum key length: 128 Unicode characters in UTF-8.
// - Maximum value length: 256 Unicode characters in UTF-8.
// - Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
// characters: + - = . _ : / @
// - Cannot use "aws:" as a prefix for a key.
Tags map[string]string
noSmithyDocumentSerde
}
type CreatePlaceIndexOutput struct {
// The timestamp for when the place index resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The Amazon Resource Name (ARN) for the place index resource. Used to specify a
// resource across Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:place-index/ExamplePlaceIndex
//
// This member is required.
IndexArn *string
// The name for the place index resource.
//
// This member is required.
IndexName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreatePlaceIndexMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePlaceIndex{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePlaceIndex{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opCreatePlaceIndexMiddleware(stack); err != nil {
return err
}
if err = addOpCreatePlaceIndexValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePlaceIndex(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opCreatePlaceIndexMiddleware struct {
}
func (*endpointPrefix_opCreatePlaceIndexMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opCreatePlaceIndexMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "places." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opCreatePlaceIndexMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opCreatePlaceIndexMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opCreatePlaceIndex(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "CreatePlaceIndex",
}
}
| 231 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a route calculator resource in your Amazon Web Services account. You
// can send requests to a route calculator resource to estimate travel time,
// distance, and get directions. A route calculator sources traffic and road
// network data from your chosen data provider. If your application is tracking or
// routing assets you use in your business, such as delivery vehicles or employees,
// you must not use Esri as your geolocation provider. See section 82 of the
// Amazon Web Services service terms (http://aws.amazon.com/service-terms) for more
// details.
func (c *Client) CreateRouteCalculator(ctx context.Context, params *CreateRouteCalculatorInput, optFns ...func(*Options)) (*CreateRouteCalculatorOutput, error) {
if params == nil {
params = &CreateRouteCalculatorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateRouteCalculator", params, optFns, c.addOperationCreateRouteCalculatorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateRouteCalculatorOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateRouteCalculatorInput struct {
// The name of the route calculator resource. Requirements:
// - Can use alphanumeric characters (A–Z, a–z, 0–9) , hyphens (-), periods (.),
// and underscores (_).
// - Must be a unique Route calculator resource name.
// - No spaces allowed. For example, ExampleRouteCalculator .
//
// This member is required.
CalculatorName *string
// Specifies the data provider of traffic and road network data. This field is
// case-sensitive. Enter the valid values as shown. For example, entering HERE
// returns an error. Valid values include:
// - Esri – For additional information about Esri (https://docs.aws.amazon.com/location/latest/developerguide/esri.html)
// 's coverage in your region of interest, see Esri details on street networks
// and traffic coverage (https://doc.arcgis.com/en/arcgis-online/reference/network-coverage.htm)
// . Route calculators that use Esri as a data source only calculate routes that
// are shorter than 400 km.
// - Grab – Grab provides routing functionality for Southeast Asia. For
// additional information about GrabMaps (https://docs.aws.amazon.com/location/latest/developerguide/grab.html)
// ' coverage, see GrabMaps countries and areas covered (https://docs.aws.amazon.com/location/latest/developerguide/grab.html#grab-coverage-area)
// .
// - Here – For additional information about HERE Technologies (https://docs.aws.amazon.com/location/latest/developerguide/HERE.html)
// ' coverage in your region of interest, see HERE car routing coverage (https://developer.here.com/documentation/routing-api/dev_guide/topics/coverage/car-routing.html)
// and HERE truck routing coverage (https://developer.here.com/documentation/routing-api/dev_guide/topics/coverage/truck-routing.html)
// .
// For additional information , see Data providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// on the Amazon Location Service Developer Guide.
//
// This member is required.
DataSource *string
// The optional description for the route calculator resource.
Description *string
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
// Applies one or more tags to the route calculator resource. A tag is a key-value
// pair helps manage, identify, search, and filter your resources by labelling
// them.
// - For example: { "tag1" : "value1" , "tag2" : "value2" }
// Format: "key" : "value" Restrictions:
// - Maximum 50 tags per resource
// - Each resource tag must be unique with a maximum of one value.
// - Maximum key length: 128 Unicode characters in UTF-8
// - Maximum value length: 256 Unicode characters in UTF-8
// - Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
// characters: + - = . _ : / @.
// - Cannot use "aws:" as a prefix for a key.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateRouteCalculatorOutput struct {
// The Amazon Resource Name (ARN) for the route calculator resource. Use the ARN
// when you specify a resource across all Amazon Web Services.
// - Format example:
// arn:aws:geo:region:account-id:route-calculator/ExampleCalculator
//
// This member is required.
CalculatorArn *string
// The name of the route calculator resource.
// - For example, ExampleRouteCalculator .
//
// This member is required.
CalculatorName *string
// The timestamp when the route calculator resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
// - For example, 2020–07-2T12:15:20.000Z+01:00
//
// This member is required.
CreateTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateRouteCalculatorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateRouteCalculator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateRouteCalculator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opCreateRouteCalculatorMiddleware(stack); err != nil {
return err
}
if err = addOpCreateRouteCalculatorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRouteCalculator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opCreateRouteCalculatorMiddleware struct {
}
func (*endpointPrefix_opCreateRouteCalculatorMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opCreateRouteCalculatorMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "routes." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opCreateRouteCalculatorMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opCreateRouteCalculatorMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opCreateRouteCalculator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "CreateRouteCalculator",
}
}
| 231 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a tracker resource in your Amazon Web Services account, which lets you
// retrieve current and historical location of devices.
func (c *Client) CreateTracker(ctx context.Context, params *CreateTrackerInput, optFns ...func(*Options)) (*CreateTrackerOutput, error) {
if params == nil {
params = &CreateTrackerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateTracker", params, optFns, c.addOperationCreateTrackerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateTrackerOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateTrackerInput struct {
// The name for the tracker resource. Requirements:
// - Contain only alphanumeric characters (A-Z, a-z, 0-9) , hyphens (-), periods
// (.), and underscores (_).
// - Must be a unique tracker resource name.
// - No spaces allowed. For example, ExampleTracker .
//
// This member is required.
TrackerName *string
// An optional description for the tracker resource.
Description *string
// A key identifier for an Amazon Web Services KMS customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html)
// . Enter a key ID, key ARN, alias name, or alias ARN.
KmsKeyId *string
// Specifies the position filtering for the tracker resource. Valid values:
// - TimeBased - Location updates are evaluated against linked geofence
// collections, but not every location update is stored. If your update frequency
// is more often than 30 seconds, only one update per 30 seconds is stored for each
// unique device ID.
// - DistanceBased - If the device has moved less than 30 m (98.4 ft), location
// updates are ignored. Location updates within this area are neither evaluated
// against linked geofence collections, nor stored. This helps control costs by
// reducing the number of geofence evaluations and historical device positions to
// paginate through. Distance-based filtering can also reduce the effects of GPS
// noise when displaying device trajectories on a map.
// - AccuracyBased - If the device has moved less than the measured accuracy,
// location updates are ignored. For example, if two consecutive updates from a
// device have a horizontal accuracy of 5 m and 10 m, the second update is ignored
// if the device has moved less than 15 m. Ignored location updates are neither
// evaluated against linked geofence collections, nor stored. This can reduce the
// effects of GPS noise when displaying device trajectories on a map, and can help
// control your costs by reducing the number of geofence evaluations.
// This field is optional. If not specified, the default value is TimeBased .
PositionFiltering types.PositionFiltering
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
// This parameter is no longer used.
//
// Deprecated: Deprecated. No longer allowed.
PricingPlanDataSource *string
// Applies one or more tags to the tracker resource. A tag is a key-value pair
// helps manage, identify, search, and filter your resources by labelling them.
// Format: "key" : "value" Restrictions:
// - Maximum 50 tags per resource
// - Each resource tag must be unique with a maximum of one value.
// - Maximum key length: 128 Unicode characters in UTF-8
// - Maximum value length: 256 Unicode characters in UTF-8
// - Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
// characters: + - = . _ : / @.
// - Cannot use "aws:" as a prefix for a key.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateTrackerOutput struct {
// The timestamp for when the tracker resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The Amazon Resource Name (ARN) for the tracker resource. Used when you need to
// specify a resource across all Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:tracker/ExampleTracker
//
// This member is required.
TrackerArn *string
// The name of the tracker resource.
//
// This member is required.
TrackerName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateTrackerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTracker{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTracker{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opCreateTrackerMiddleware(stack); err != nil {
return err
}
if err = addOpCreateTrackerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTracker(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opCreateTrackerMiddleware struct {
}
func (*endpointPrefix_opCreateTrackerMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opCreateTrackerMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opCreateTrackerMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opCreateTrackerMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opCreateTracker(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "CreateTracker",
}
}
| 228 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a geofence collection from your Amazon Web Services account. This
// operation deletes the resource permanently. If the geofence collection is the
// target of a tracker resource, the devices will no longer be monitored.
func (c *Client) DeleteGeofenceCollection(ctx context.Context, params *DeleteGeofenceCollectionInput, optFns ...func(*Options)) (*DeleteGeofenceCollectionOutput, error) {
if params == nil {
params = &DeleteGeofenceCollectionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteGeofenceCollection", params, optFns, c.addOperationDeleteGeofenceCollectionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteGeofenceCollectionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteGeofenceCollectionInput struct {
// The name of the geofence collection to be deleted.
//
// This member is required.
CollectionName *string
noSmithyDocumentSerde
}
type DeleteGeofenceCollectionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteGeofenceCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteGeofenceCollection{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteGeofenceCollection{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDeleteGeofenceCollectionMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteGeofenceCollectionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteGeofenceCollection(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDeleteGeofenceCollectionMiddleware struct {
}
func (*endpointPrefix_opDeleteGeofenceCollectionMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDeleteGeofenceCollectionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDeleteGeofenceCollectionMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDeleteGeofenceCollectionMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDeleteGeofenceCollection(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DeleteGeofenceCollection",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified API key. The API key must have been deactivated more than
// 90 days previously.
func (c *Client) DeleteKey(ctx context.Context, params *DeleteKeyInput, optFns ...func(*Options)) (*DeleteKeyOutput, error) {
if params == nil {
params = &DeleteKeyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteKey", params, optFns, c.addOperationDeleteKeyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteKeyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteKeyInput struct {
// The name of the API key to delete.
//
// This member is required.
KeyName *string
noSmithyDocumentSerde
}
type DeleteKeyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteKeyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteKey{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteKey{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDeleteKeyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteKeyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDeleteKeyMiddleware struct {
}
func (*endpointPrefix_opDeleteKeyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDeleteKeyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "metadata." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDeleteKeyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDeleteKeyMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDeleteKey(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DeleteKey",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a map resource from your Amazon Web Services account. This operation
// deletes the resource permanently. If the map is being used in an application,
// the map may not render.
func (c *Client) DeleteMap(ctx context.Context, params *DeleteMapInput, optFns ...func(*Options)) (*DeleteMapOutput, error) {
if params == nil {
params = &DeleteMapInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteMap", params, optFns, c.addOperationDeleteMapMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteMapOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteMapInput struct {
// The name of the map resource to be deleted.
//
// This member is required.
MapName *string
noSmithyDocumentSerde
}
type DeleteMapOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteMapMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteMap{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteMap{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDeleteMapMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteMapValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMap(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDeleteMapMiddleware struct {
}
func (*endpointPrefix_opDeleteMapMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDeleteMapMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "maps." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDeleteMapMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDeleteMapMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDeleteMap(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DeleteMap",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a place index resource from your Amazon Web Services account. This
// operation deletes the resource permanently.
func (c *Client) DeletePlaceIndex(ctx context.Context, params *DeletePlaceIndexInput, optFns ...func(*Options)) (*DeletePlaceIndexOutput, error) {
if params == nil {
params = &DeletePlaceIndexInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeletePlaceIndex", params, optFns, c.addOperationDeletePlaceIndexMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeletePlaceIndexOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeletePlaceIndexInput struct {
// The name of the place index resource to be deleted.
//
// This member is required.
IndexName *string
noSmithyDocumentSerde
}
type DeletePlaceIndexOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeletePlaceIndexMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePlaceIndex{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePlaceIndex{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDeletePlaceIndexMiddleware(stack); err != nil {
return err
}
if err = addOpDeletePlaceIndexValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePlaceIndex(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDeletePlaceIndexMiddleware struct {
}
func (*endpointPrefix_opDeletePlaceIndexMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDeletePlaceIndexMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "places." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDeletePlaceIndexMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDeletePlaceIndexMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDeletePlaceIndex(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DeletePlaceIndex",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a route calculator resource from your Amazon Web Services account. This
// operation deletes the resource permanently.
func (c *Client) DeleteRouteCalculator(ctx context.Context, params *DeleteRouteCalculatorInput, optFns ...func(*Options)) (*DeleteRouteCalculatorOutput, error) {
if params == nil {
params = &DeleteRouteCalculatorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteRouteCalculator", params, optFns, c.addOperationDeleteRouteCalculatorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteRouteCalculatorOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteRouteCalculatorInput struct {
// The name of the route calculator resource to be deleted.
//
// This member is required.
CalculatorName *string
noSmithyDocumentSerde
}
type DeleteRouteCalculatorOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteRouteCalculatorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteRouteCalculator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteRouteCalculator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDeleteRouteCalculatorMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteRouteCalculatorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRouteCalculator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDeleteRouteCalculatorMiddleware struct {
}
func (*endpointPrefix_opDeleteRouteCalculatorMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDeleteRouteCalculatorMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "routes." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDeleteRouteCalculatorMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDeleteRouteCalculatorMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDeleteRouteCalculator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DeleteRouteCalculator",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a tracker resource from your Amazon Web Services account. This
// operation deletes the resource permanently. If the tracker resource is in use,
// you may encounter an error. Make sure that the target resource isn't a
// dependency for your applications.
func (c *Client) DeleteTracker(ctx context.Context, params *DeleteTrackerInput, optFns ...func(*Options)) (*DeleteTrackerOutput, error) {
if params == nil {
params = &DeleteTrackerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteTracker", params, optFns, c.addOperationDeleteTrackerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteTrackerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteTrackerInput struct {
// The name of the tracker resource to be deleted.
//
// This member is required.
TrackerName *string
noSmithyDocumentSerde
}
type DeleteTrackerOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteTrackerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteTracker{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteTracker{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDeleteTrackerMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteTrackerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTracker(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDeleteTrackerMiddleware struct {
}
func (*endpointPrefix_opDeleteTrackerMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDeleteTrackerMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDeleteTrackerMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDeleteTrackerMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDeleteTracker(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DeleteTracker",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves the geofence collection details.
func (c *Client) DescribeGeofenceCollection(ctx context.Context, params *DescribeGeofenceCollectionInput, optFns ...func(*Options)) (*DescribeGeofenceCollectionOutput, error) {
if params == nil {
params = &DescribeGeofenceCollectionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeGeofenceCollection", params, optFns, c.addOperationDescribeGeofenceCollectionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeGeofenceCollectionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeGeofenceCollectionInput struct {
// The name of the geofence collection.
//
// This member is required.
CollectionName *string
noSmithyDocumentSerde
}
type DescribeGeofenceCollectionOutput struct {
// The Amazon Resource Name (ARN) for the geofence collection resource. Used when
// you need to specify a resource across all Amazon Web Services.
// - Format example:
// arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollection
//
// This member is required.
CollectionArn *string
// The name of the geofence collection.
//
// This member is required.
CollectionName *string
// The timestamp for when the geofence resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
CreateTime *time.Time
// The optional description for the geofence collection.
//
// This member is required.
Description *string
// The timestamp for when the geofence collection was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
UpdateTime *time.Time
// A key identifier for an Amazon Web Services KMS customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html)
// assigned to the Amazon Location resource
KmsKeyId *string
// No longer used. Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan types.PricingPlan
// No longer used. Always returns an empty string.
//
// Deprecated: Deprecated. Unused.
PricingPlanDataSource *string
// Displays the key, value pairs of tags associated with this resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeGeofenceCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeGeofenceCollection{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeGeofenceCollection{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDescribeGeofenceCollectionMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeGeofenceCollectionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeGeofenceCollection(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDescribeGeofenceCollectionMiddleware struct {
}
func (*endpointPrefix_opDescribeGeofenceCollectionMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeGeofenceCollectionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeGeofenceCollectionMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeGeofenceCollectionMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeGeofenceCollection(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DescribeGeofenceCollection",
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves the API key resource details. The API keys feature is in preview. We
// may add, change, or remove features before announcing general availability. For
// more information, see Using API keys (https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html)
// .
func (c *Client) DescribeKey(ctx context.Context, params *DescribeKeyInput, optFns ...func(*Options)) (*DescribeKeyOutput, error) {
if params == nil {
params = &DescribeKeyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeKey", params, optFns, c.addOperationDescribeKeyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeKeyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeKeyInput struct {
// The name of the API key resource.
//
// This member is required.
KeyName *string
noSmithyDocumentSerde
}
type DescribeKeyOutput struct {
// The timestamp for when the API key resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The timestamp for when the API key resource will expire in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
ExpireTime *time.Time
// The key value/string of an API key.
//
// This member is required.
Key *string
// The Amazon Resource Name (ARN) for the API key resource. Used when you need to
// specify a resource across all Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:key/ExampleKey
//
// This member is required.
KeyArn *string
// The name of the API key resource.
//
// This member is required.
KeyName *string
// API Restrictions on the allowed actions, resources, and referers for an API key
// resource.
//
// This member is required.
Restrictions *types.ApiKeyRestrictions
// The timestamp for when the API key resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// The optional description for the API key resource.
Description *string
// Tags associated with the API key resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeKeyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeKey{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeKey{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDescribeKeyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeKeyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDescribeKeyMiddleware struct {
}
func (*endpointPrefix_opDescribeKeyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeKeyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "metadata." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeKeyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeKeyMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeKey(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DescribeKey",
}
}
| 204 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves the map resource details.
func (c *Client) DescribeMap(ctx context.Context, params *DescribeMapInput, optFns ...func(*Options)) (*DescribeMapOutput, error) {
if params == nil {
params = &DescribeMapInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeMap", params, optFns, c.addOperationDescribeMapMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeMapOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeMapInput struct {
// The name of the map resource.
//
// This member is required.
MapName *string
noSmithyDocumentSerde
}
type DescribeMapOutput struct {
// Specifies the map tile style selected from a partner data provider.
//
// This member is required.
Configuration *types.MapConfiguration
// The timestamp for when the map resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// Specifies the data provider for the associated map tiles.
//
// This member is required.
DataSource *string
// The optional description for the map resource.
//
// This member is required.
Description *string
// The Amazon Resource Name (ARN) for the map resource. Used to specify a resource
// across all Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:map/ExampleMap
//
// This member is required.
MapArn *string
// The map style selected from an available provider.
//
// This member is required.
MapName *string
// The timestamp for when the map resource was last update in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// No longer used. Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan types.PricingPlan
// Tags associated with the map resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeMapMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeMap{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeMap{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDescribeMapMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeMapValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMap(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDescribeMapMiddleware struct {
}
func (*endpointPrefix_opDescribeMapMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeMapMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "maps." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeMapMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeMapMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeMap(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DescribeMap",
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves the place index resource details.
func (c *Client) DescribePlaceIndex(ctx context.Context, params *DescribePlaceIndexInput, optFns ...func(*Options)) (*DescribePlaceIndexOutput, error) {
if params == nil {
params = &DescribePlaceIndexInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribePlaceIndex", params, optFns, c.addOperationDescribePlaceIndexMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribePlaceIndexOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribePlaceIndexInput struct {
// The name of the place index resource.
//
// This member is required.
IndexName *string
noSmithyDocumentSerde
}
type DescribePlaceIndexOutput struct {
// The timestamp for when the place index resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The data provider of geospatial data. Values can be one of the following:
// - Esri
// - Grab
// - Here
// For more information about data providers, see Amazon Location Service data
// providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// .
//
// This member is required.
DataSource *string
// The specified data storage option for requesting Places.
//
// This member is required.
DataSourceConfiguration *types.DataSourceConfiguration
// The optional description for the place index resource.
//
// This member is required.
Description *string
// The Amazon Resource Name (ARN) for the place index resource. Used to specify a
// resource across Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:place-index/ExamplePlaceIndex
//
// This member is required.
IndexArn *string
// The name of the place index resource being described.
//
// This member is required.
IndexName *string
// The timestamp for when the place index resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// No longer used. Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan types.PricingPlan
// Tags associated with place index resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribePlaceIndexMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribePlaceIndex{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribePlaceIndex{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDescribePlaceIndexMiddleware(stack); err != nil {
return err
}
if err = addOpDescribePlaceIndexValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePlaceIndex(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDescribePlaceIndexMiddleware struct {
}
func (*endpointPrefix_opDescribePlaceIndexMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribePlaceIndexMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "places." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribePlaceIndexMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribePlaceIndexMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribePlaceIndex(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DescribePlaceIndex",
}
}
| 207 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves the route calculator resource details.
func (c *Client) DescribeRouteCalculator(ctx context.Context, params *DescribeRouteCalculatorInput, optFns ...func(*Options)) (*DescribeRouteCalculatorOutput, error) {
if params == nil {
params = &DescribeRouteCalculatorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeRouteCalculator", params, optFns, c.addOperationDescribeRouteCalculatorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeRouteCalculatorOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeRouteCalculatorInput struct {
// The name of the route calculator resource.
//
// This member is required.
CalculatorName *string
noSmithyDocumentSerde
}
type DescribeRouteCalculatorOutput struct {
// The Amazon Resource Name (ARN) for the Route calculator resource. Use the ARN
// when you specify a resource across Amazon Web Services.
// - Format example:
// arn:aws:geo:region:account-id:route-calculator/ExampleCalculator
//
// This member is required.
CalculatorArn *string
// The name of the route calculator resource being described.
//
// This member is required.
CalculatorName *string
// The timestamp when the route calculator resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
// - For example, 2020–07-2T12:15:20.000Z+01:00
//
// This member is required.
CreateTime *time.Time
// The data provider of traffic and road network data. Indicates one of the
// available providers:
// - Esri
// - Grab
// - Here
// For more information about data providers, see Amazon Location Service data
// providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// .
//
// This member is required.
DataSource *string
// The optional description of the route calculator resource.
//
// This member is required.
Description *string
// The timestamp when the route calculator resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
// - For example, 2020–07-2T12:15:20.000Z+01:00
//
// This member is required.
UpdateTime *time.Time
// Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan types.PricingPlan
// Tags associated with route calculator resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeRouteCalculatorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeRouteCalculator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeRouteCalculator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDescribeRouteCalculatorMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeRouteCalculatorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRouteCalculator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDescribeRouteCalculatorMiddleware struct {
}
func (*endpointPrefix_opDescribeRouteCalculatorMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeRouteCalculatorMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "routes." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeRouteCalculatorMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeRouteCalculatorMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeRouteCalculator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DescribeRouteCalculator",
}
}
| 206 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves the tracker resource details.
func (c *Client) DescribeTracker(ctx context.Context, params *DescribeTrackerInput, optFns ...func(*Options)) (*DescribeTrackerOutput, error) {
if params == nil {
params = &DescribeTrackerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTracker", params, optFns, c.addOperationDescribeTrackerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTrackerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTrackerInput struct {
// The name of the tracker resource.
//
// This member is required.
TrackerName *string
noSmithyDocumentSerde
}
type DescribeTrackerOutput struct {
// The timestamp for when the tracker resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The optional description for the tracker resource.
//
// This member is required.
Description *string
// The Amazon Resource Name (ARN) for the tracker resource. Used when you need to
// specify a resource across all Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:tracker/ExampleTracker
//
// This member is required.
TrackerArn *string
// The name of the tracker resource.
//
// This member is required.
TrackerName *string
// The timestamp for when the tracker resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// A key identifier for an Amazon Web Services KMS customer managed key (https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html)
// assigned to the Amazon Location resource.
KmsKeyId *string
// The position filtering method of the tracker resource.
PositionFiltering types.PositionFiltering
// Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan types.PricingPlan
// No longer used. Always returns an empty string.
//
// Deprecated: Deprecated. Unused.
PricingPlanDataSource *string
// The tags associated with the tracker resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTrackerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeTracker{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeTracker{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDescribeTrackerMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeTrackerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTracker(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDescribeTrackerMiddleware struct {
}
func (*endpointPrefix_opDescribeTrackerMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeTrackerMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeTrackerMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeTrackerMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeTracker(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DescribeTracker",
}
}
| 203 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes the association between a tracker resource and a geofence collection.
// Once you unlink a tracker resource from a geofence collection, the tracker
// positions will no longer be automatically evaluated against geofences.
func (c *Client) DisassociateTrackerConsumer(ctx context.Context, params *DisassociateTrackerConsumerInput, optFns ...func(*Options)) (*DisassociateTrackerConsumerOutput, error) {
if params == nil {
params = &DisassociateTrackerConsumerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateTrackerConsumer", params, optFns, c.addOperationDisassociateTrackerConsumerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateTrackerConsumerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateTrackerConsumerInput struct {
// The Amazon Resource Name (ARN) for the geofence collection to be disassociated
// from the tracker resource. Used when you need to specify a resource across all
// Amazon Web Services.
// - Format example:
// arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollectionConsumer
//
// This member is required.
ConsumerArn *string
// The name of the tracker resource to be dissociated from the consumer.
//
// This member is required.
TrackerName *string
noSmithyDocumentSerde
}
type DisassociateTrackerConsumerOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateTrackerConsumerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateTrackerConsumer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateTrackerConsumer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opDisassociateTrackerConsumerMiddleware(stack); err != nil {
return err
}
if err = addOpDisassociateTrackerConsumerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateTrackerConsumer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opDisassociateTrackerConsumerMiddleware struct {
}
func (*endpointPrefix_opDisassociateTrackerConsumerMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDisassociateTrackerConsumerMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDisassociateTrackerConsumerMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDisassociateTrackerConsumerMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDisassociateTrackerConsumer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "DisassociateTrackerConsumer",
}
}
| 162 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves a device's most recent position according to its sample time. Device
// positions are deleted after 30 days.
func (c *Client) GetDevicePosition(ctx context.Context, params *GetDevicePositionInput, optFns ...func(*Options)) (*GetDevicePositionOutput, error) {
if params == nil {
params = &GetDevicePositionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDevicePosition", params, optFns, c.addOperationGetDevicePositionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDevicePositionOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetDevicePositionInput struct {
// The device whose position you want to retrieve.
//
// This member is required.
DeviceId *string
// The tracker resource receiving the position update.
//
// This member is required.
TrackerName *string
noSmithyDocumentSerde
}
type GetDevicePositionOutput struct {
// The last known device position.
//
// This member is required.
Position []float64
// The timestamp for when the tracker resource received the device position in
// ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html) format:
// YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
ReceivedTime *time.Time
// The timestamp at which the device's position was determined. Uses ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
SampleTime *time.Time
// The accuracy of the device position.
Accuracy *types.PositionalAccuracy
// The device whose position you retrieved.
DeviceId *string
// The properties associated with the position.
PositionProperties map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDevicePositionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDevicePosition{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDevicePosition{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opGetDevicePositionMiddleware(stack); err != nil {
return err
}
if err = addOpGetDevicePositionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDevicePosition(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetDevicePositionMiddleware struct {
}
func (*endpointPrefix_opGetDevicePositionMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetDevicePositionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetDevicePositionMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetDevicePositionMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetDevicePosition(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "GetDevicePosition",
}
}
| 187 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves the device position history from a tracker resource within a
// specified range of time. Device positions are deleted after 30 days.
func (c *Client) GetDevicePositionHistory(ctx context.Context, params *GetDevicePositionHistoryInput, optFns ...func(*Options)) (*GetDevicePositionHistoryOutput, error) {
if params == nil {
params = &GetDevicePositionHistoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDevicePositionHistory", params, optFns, c.addOperationGetDevicePositionHistoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDevicePositionHistoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetDevicePositionHistoryInput struct {
// The device whose position history you want to retrieve.
//
// This member is required.
DeviceId *string
// The tracker resource receiving the request for the device position history.
//
// This member is required.
TrackerName *string
// Specify the end time for the position history in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ . By default, the value will be the time that
// the request is made. Requirement:
// - The time specified for EndTimeExclusive must be after the time for
// StartTimeInclusive .
EndTimeExclusive *time.Time
// An optional limit for the number of device positions returned in a single call.
// Default value: 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// value: null
NextToken *string
// Specify the start time for the position history in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ . By default, the value will be 24 hours prior
// to the time that the request is made. Requirement:
// - The time specified for StartTimeInclusive must be before EndTimeExclusive .
StartTimeInclusive *time.Time
noSmithyDocumentSerde
}
type GetDevicePositionHistoryOutput struct {
// Contains the position history details for the requested device.
//
// This member is required.
DevicePositions []types.DevicePosition
// A pagination token indicating there are additional pages available. You can use
// the token in a following request to fetch the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDevicePositionHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDevicePositionHistory{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDevicePositionHistory{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opGetDevicePositionHistoryMiddleware(stack); err != nil {
return err
}
if err = addOpGetDevicePositionHistoryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDevicePositionHistory(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetDevicePositionHistoryMiddleware struct {
}
func (*endpointPrefix_opGetDevicePositionHistoryMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetDevicePositionHistoryMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetDevicePositionHistoryMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetDevicePositionHistoryMiddleware{}, `OperationSerializer`, middleware.After)
}
// GetDevicePositionHistoryAPIClient is a client that implements the
// GetDevicePositionHistory operation.
type GetDevicePositionHistoryAPIClient interface {
GetDevicePositionHistory(context.Context, *GetDevicePositionHistoryInput, ...func(*Options)) (*GetDevicePositionHistoryOutput, error)
}
var _ GetDevicePositionHistoryAPIClient = (*Client)(nil)
// GetDevicePositionHistoryPaginatorOptions is the paginator options for
// GetDevicePositionHistory
type GetDevicePositionHistoryPaginatorOptions struct {
// An optional limit for the number of device positions returned in a single call.
// Default value: 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// GetDevicePositionHistoryPaginator is a paginator for GetDevicePositionHistory
type GetDevicePositionHistoryPaginator struct {
options GetDevicePositionHistoryPaginatorOptions
client GetDevicePositionHistoryAPIClient
params *GetDevicePositionHistoryInput
nextToken *string
firstPage bool
}
// NewGetDevicePositionHistoryPaginator returns a new
// GetDevicePositionHistoryPaginator
func NewGetDevicePositionHistoryPaginator(client GetDevicePositionHistoryAPIClient, params *GetDevicePositionHistoryInput, optFns ...func(*GetDevicePositionHistoryPaginatorOptions)) *GetDevicePositionHistoryPaginator {
if params == nil {
params = &GetDevicePositionHistoryInput{}
}
options := GetDevicePositionHistoryPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetDevicePositionHistoryPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetDevicePositionHistoryPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetDevicePositionHistory page.
func (p *GetDevicePositionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDevicePositionHistoryOutput, 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.GetDevicePositionHistory(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_opGetDevicePositionHistory(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "GetDevicePositionHistory",
}
}
| 284 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves the geofence details from a geofence collection.
func (c *Client) GetGeofence(ctx context.Context, params *GetGeofenceInput, optFns ...func(*Options)) (*GetGeofenceOutput, error) {
if params == nil {
params = &GetGeofenceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetGeofence", params, optFns, c.addOperationGetGeofenceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetGeofenceOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetGeofenceInput struct {
// The geofence collection storing the target geofence.
//
// This member is required.
CollectionName *string
// The geofence you're retrieving details for.
//
// This member is required.
GeofenceId *string
noSmithyDocumentSerde
}
type GetGeofenceOutput struct {
// The timestamp for when the geofence collection was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
CreateTime *time.Time
// The geofence identifier.
//
// This member is required.
GeofenceId *string
// Contains the geofence geometry details describing a polygon or a circle.
//
// This member is required.
Geometry *types.GeofenceGeometry
// Identifies the state of the geofence. A geofence will hold one of the following
// states:
// - ACTIVE — The geofence has been indexed by the system.
// - PENDING — The geofence is being processed by the system.
// - FAILED — The geofence failed to be indexed by the system.
// - DELETED — The geofence has been deleted from the system index.
// - DELETING — The geofence is being deleted from the system index.
//
// This member is required.
Status *string
// The timestamp for when the geofence collection was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
UpdateTime *time.Time
// Contains additional user-defined properties stored with the geofence. An array
// of key-value pairs.
GeofenceProperties map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetGeofenceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetGeofence{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetGeofence{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opGetGeofenceMiddleware(stack); err != nil {
return err
}
if err = addOpGetGeofenceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetGeofence(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetGeofenceMiddleware struct {
}
func (*endpointPrefix_opGetGeofenceMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetGeofenceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetGeofenceMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetGeofenceMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetGeofence(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "GetGeofence",
}
}
| 196 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a vector data tile from the map resource. Map tiles are used by
// clients to render a map. they're addressed using a grid arrangement with an X
// coordinate, Y coordinate, and Z (zoom) level. The origin (0, 0) is the top left
// of the map. Increasing the zoom level by 1 doubles both the X and Y dimensions,
// so a tile containing data for the entire world at (0/0/0) will be split into 4
// tiles at zoom 1 (1/0/0, 1/0/1, 1/1/0, 1/1/1).
func (c *Client) GetMapTile(ctx context.Context, params *GetMapTileInput, optFns ...func(*Options)) (*GetMapTileOutput, error) {
if params == nil {
params = &GetMapTileInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetMapTile", params, optFns, c.addOperationGetMapTileMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetMapTileOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetMapTileInput struct {
// The map resource to retrieve the map tiles from.
//
// This member is required.
MapName *string
// The X axis value for the map tile.
//
// This member is required.
X *string
// The Y axis value for the map tile.
//
// This member is required.
Y *string
// The zoom value for the map tile.
//
// This member is required.
Z *string
// The optional API key (https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html)
// to authorize the request.
Key *string
noSmithyDocumentSerde
}
type GetMapTileOutput struct {
// Contains Mapbox Vector Tile (MVT) data.
Blob []byte
// The HTTP Cache-Control directive for the value.
CacheControl *string
// The map tile's content type. For example, application/vnd.mapbox-vector-tile .
ContentType *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetMapTileMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMapTile{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMapTile{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opGetMapTileMiddleware(stack); err != nil {
return err
}
if err = addOpGetMapTileValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMapTile(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetMapTileMiddleware struct {
}
func (*endpointPrefix_opGetMapTileMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetMapTileMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "maps." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetMapTileMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetMapTileMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetMapTile(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "GetMapTile",
}
}
| 185 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Finds a place by its unique ID. A PlaceId is returned by other search
// operations. A PlaceId is valid only if all of the following are the same in the
// original search request and the call to GetPlace .
// - Customer Amazon Web Services account
// - Amazon Web Services Region
// - Data provider specified in the place index resource
func (c *Client) GetPlace(ctx context.Context, params *GetPlaceInput, optFns ...func(*Options)) (*GetPlaceOutput, error) {
if params == nil {
params = &GetPlaceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetPlace", params, optFns, c.addOperationGetPlaceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetPlaceOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetPlaceInput struct {
// The name of the place index resource that you want to use for the search.
//
// This member is required.
IndexName *string
// The identifier of the place to find.
//
// This member is required.
PlaceId *string
// The preferred language used to return results. The value must be a valid BCP 47 (https://tools.ietf.org/search/bcp47)
// language tag, for example, en for English. This setting affects the languages
// used in the results, but not the results themselves. If no language is
// specified, or not supported for a particular result, the partner automatically
// chooses a language for the result. For an example, we'll use the Greek language.
// You search for a location around Athens, Greece, with the language parameter
// set to en . The city in the results will most likely be returned as Athens . If
// you set the language parameter to el , for Greek, then the city in the results
// will more likely be returned as Αθήνα . If the data provider does not have a
// value for Greek, the result will be in a language that the provider does
// support.
Language *string
noSmithyDocumentSerde
}
type GetPlaceOutput struct {
// Details about the result, such as its address and position.
//
// This member is required.
Place *types.Place
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetPlaceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPlace{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPlace{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opGetPlaceMiddleware(stack); err != nil {
return err
}
if err = addOpGetPlaceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPlace(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opGetPlaceMiddleware struct {
}
func (*endpointPrefix_opGetPlaceMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetPlaceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "places." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetPlaceMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetPlaceMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetPlace(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "GetPlace",
}
}
| 181 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// A batch request to retrieve all device positions.
func (c *Client) ListDevicePositions(ctx context.Context, params *ListDevicePositionsInput, optFns ...func(*Options)) (*ListDevicePositionsOutput, error) {
if params == nil {
params = &ListDevicePositionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDevicePositions", params, optFns, c.addOperationListDevicePositionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDevicePositionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListDevicePositionsInput struct {
// The tracker resource containing the requested devices.
//
// This member is required.
TrackerName *string
// An optional limit for the number of entries returned in a single call. Default
// value: 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// value: null
NextToken *string
noSmithyDocumentSerde
}
type ListDevicePositionsOutput struct {
// Contains details about each device's last known position. These details
// includes the device ID, the time when the position was sampled on the device,
// the time that the service received the update, and the most recent coordinates.
//
// This member is required.
Entries []types.ListDevicePositionsResponseEntry
// A pagination token indicating there are additional pages available. You can use
// the token in a following request to fetch the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDevicePositionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListDevicePositions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDevicePositions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListDevicePositionsMiddleware(stack); err != nil {
return err
}
if err = addOpListDevicePositionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDevicePositions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListDevicePositionsMiddleware struct {
}
func (*endpointPrefix_opListDevicePositionsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListDevicePositionsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListDevicePositionsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListDevicePositionsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListDevicePositionsAPIClient is a client that implements the
// ListDevicePositions operation.
type ListDevicePositionsAPIClient interface {
ListDevicePositions(context.Context, *ListDevicePositionsInput, ...func(*Options)) (*ListDevicePositionsOutput, error)
}
var _ ListDevicePositionsAPIClient = (*Client)(nil)
// ListDevicePositionsPaginatorOptions is the paginator options for
// ListDevicePositions
type ListDevicePositionsPaginatorOptions struct {
// An optional limit for the number of entries returned in a single call. Default
// value: 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListDevicePositionsPaginator is a paginator for ListDevicePositions
type ListDevicePositionsPaginator struct {
options ListDevicePositionsPaginatorOptions
client ListDevicePositionsAPIClient
params *ListDevicePositionsInput
nextToken *string
firstPage bool
}
// NewListDevicePositionsPaginator returns a new ListDevicePositionsPaginator
func NewListDevicePositionsPaginator(client ListDevicePositionsAPIClient, params *ListDevicePositionsInput, optFns ...func(*ListDevicePositionsPaginatorOptions)) *ListDevicePositionsPaginator {
if params == nil {
params = &ListDevicePositionsInput{}
}
options := ListDevicePositionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListDevicePositionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListDevicePositionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListDevicePositions page.
func (p *ListDevicePositionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevicePositionsOutput, 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.ListDevicePositions(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_opListDevicePositions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListDevicePositions",
}
}
| 265 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists geofence collections in your Amazon Web Services account.
func (c *Client) ListGeofenceCollections(ctx context.Context, params *ListGeofenceCollectionsInput, optFns ...func(*Options)) (*ListGeofenceCollectionsOutput, error) {
if params == nil {
params = &ListGeofenceCollectionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListGeofenceCollections", params, optFns, c.addOperationListGeofenceCollectionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListGeofenceCollectionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListGeofenceCollectionsInput struct {
// An optional limit for the number of resources returned in a single call.
// Default value: 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// value: null
NextToken *string
noSmithyDocumentSerde
}
type ListGeofenceCollectionsOutput struct {
// Lists the geofence collections that exist in your Amazon Web Services account.
//
// This member is required.
Entries []types.ListGeofenceCollectionsResponseEntry
// A pagination token indicating there are additional pages available. You can use
// the token in a following request to fetch the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListGeofenceCollectionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListGeofenceCollections{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListGeofenceCollections{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListGeofenceCollectionsMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListGeofenceCollections(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListGeofenceCollectionsMiddleware struct {
}
func (*endpointPrefix_opListGeofenceCollectionsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListGeofenceCollectionsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListGeofenceCollectionsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListGeofenceCollectionsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListGeofenceCollectionsAPIClient is a client that implements the
// ListGeofenceCollections operation.
type ListGeofenceCollectionsAPIClient interface {
ListGeofenceCollections(context.Context, *ListGeofenceCollectionsInput, ...func(*Options)) (*ListGeofenceCollectionsOutput, error)
}
var _ ListGeofenceCollectionsAPIClient = (*Client)(nil)
// ListGeofenceCollectionsPaginatorOptions is the paginator options for
// ListGeofenceCollections
type ListGeofenceCollectionsPaginatorOptions struct {
// An optional limit for the number of resources returned in a single call.
// Default value: 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListGeofenceCollectionsPaginator is a paginator for ListGeofenceCollections
type ListGeofenceCollectionsPaginator struct {
options ListGeofenceCollectionsPaginatorOptions
client ListGeofenceCollectionsAPIClient
params *ListGeofenceCollectionsInput
nextToken *string
firstPage bool
}
// NewListGeofenceCollectionsPaginator returns a new
// ListGeofenceCollectionsPaginator
func NewListGeofenceCollectionsPaginator(client ListGeofenceCollectionsAPIClient, params *ListGeofenceCollectionsInput, optFns ...func(*ListGeofenceCollectionsPaginatorOptions)) *ListGeofenceCollectionsPaginator {
if params == nil {
params = &ListGeofenceCollectionsInput{}
}
options := ListGeofenceCollectionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListGeofenceCollectionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListGeofenceCollectionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListGeofenceCollections page.
func (p *ListGeofenceCollectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGeofenceCollectionsOutput, 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.ListGeofenceCollections(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_opListGeofenceCollections(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListGeofenceCollections",
}
}
| 256 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists geofences stored in a given geofence collection.
func (c *Client) ListGeofences(ctx context.Context, params *ListGeofencesInput, optFns ...func(*Options)) (*ListGeofencesOutput, error) {
if params == nil {
params = &ListGeofencesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListGeofences", params, optFns, c.addOperationListGeofencesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListGeofencesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListGeofencesInput struct {
// The name of the geofence collection storing the list of geofences.
//
// This member is required.
CollectionName *string
// An optional limit for the number of geofences returned in a single call.
// Default value: 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// value: null
NextToken *string
noSmithyDocumentSerde
}
type ListGeofencesOutput struct {
// Contains a list of geofences stored in the geofence collection.
//
// This member is required.
Entries []types.ListGeofenceResponseEntry
// A pagination token indicating there are additional pages available. You can use
// the token in a following request to fetch the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListGeofencesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListGeofences{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListGeofences{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListGeofencesMiddleware(stack); err != nil {
return err
}
if err = addOpListGeofencesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListGeofences(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListGeofencesMiddleware struct {
}
func (*endpointPrefix_opListGeofencesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListGeofencesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListGeofencesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListGeofencesMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListGeofencesAPIClient is a client that implements the ListGeofences operation.
type ListGeofencesAPIClient interface {
ListGeofences(context.Context, *ListGeofencesInput, ...func(*Options)) (*ListGeofencesOutput, error)
}
var _ ListGeofencesAPIClient = (*Client)(nil)
// ListGeofencesPaginatorOptions is the paginator options for ListGeofences
type ListGeofencesPaginatorOptions struct {
// An optional limit for the number of geofences returned in a single call.
// Default value: 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListGeofencesPaginator is a paginator for ListGeofences
type ListGeofencesPaginator struct {
options ListGeofencesPaginatorOptions
client ListGeofencesAPIClient
params *ListGeofencesInput
nextToken *string
firstPage bool
}
// NewListGeofencesPaginator returns a new ListGeofencesPaginator
func NewListGeofencesPaginator(client ListGeofencesAPIClient, params *ListGeofencesInput, optFns ...func(*ListGeofencesPaginatorOptions)) *ListGeofencesPaginator {
if params == nil {
params = &ListGeofencesInput{}
}
options := ListGeofencesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListGeofencesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListGeofencesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListGeofences page.
func (p *ListGeofencesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGeofencesOutput, 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.ListGeofences(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_opListGeofences(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListGeofences",
}
}
| 261 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists API key resources in your Amazon Web Services account. The API keys
// feature is in preview. We may add, change, or remove features before announcing
// general availability. For more information, see Using API keys (https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html)
// .
func (c *Client) ListKeys(ctx context.Context, params *ListKeysInput, optFns ...func(*Options)) (*ListKeysOutput, error) {
if params == nil {
params = &ListKeysInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListKeys", params, optFns, c.addOperationListKeysMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListKeysOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListKeysInput struct {
// Optionally filter the list to only Active or Expired API keys.
Filter *types.ApiKeyFilter
// An optional limit for the number of resources returned in a single call.
// Default value: 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// value: null
NextToken *string
noSmithyDocumentSerde
}
type ListKeysOutput struct {
// Contains API key resources in your Amazon Web Services account. Details include
// API key name, allowed referers and timestamp for when the API key will expire.
//
// This member is required.
Entries []types.ListKeysResponseEntry
// A pagination token indicating there are additional pages available. You can use
// the token in a following request to fetch the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListKeysMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListKeys{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListKeys{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListKeysMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListKeys(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListKeysMiddleware struct {
}
func (*endpointPrefix_opListKeysMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListKeysMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "metadata." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListKeysMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListKeysMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListKeysAPIClient is a client that implements the ListKeys operation.
type ListKeysAPIClient interface {
ListKeys(context.Context, *ListKeysInput, ...func(*Options)) (*ListKeysOutput, error)
}
var _ ListKeysAPIClient = (*Client)(nil)
// ListKeysPaginatorOptions is the paginator options for ListKeys
type ListKeysPaginatorOptions struct {
// An optional limit for the number of resources returned in a single call.
// Default value: 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListKeysPaginator is a paginator for ListKeys
type ListKeysPaginator struct {
options ListKeysPaginatorOptions
client ListKeysAPIClient
params *ListKeysInput
nextToken *string
firstPage bool
}
// NewListKeysPaginator returns a new ListKeysPaginator
func NewListKeysPaginator(client ListKeysAPIClient, params *ListKeysInput, optFns ...func(*ListKeysPaginatorOptions)) *ListKeysPaginator {
if params == nil {
params = &ListKeysInput{}
}
options := ListKeysPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListKeysPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListKeysPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListKeys page.
func (p *ListKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeysOutput, 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.ListKeys(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_opListKeys(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListKeys",
}
}
| 260 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists map resources in your Amazon Web Services account.
func (c *Client) ListMaps(ctx context.Context, params *ListMapsInput, optFns ...func(*Options)) (*ListMapsOutput, error) {
if params == nil {
params = &ListMapsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListMaps", params, optFns, c.addOperationListMapsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListMapsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListMapsInput struct {
// An optional limit for the number of resources returned in a single call.
// Default value: 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// value: null
NextToken *string
noSmithyDocumentSerde
}
type ListMapsOutput struct {
// Contains a list of maps in your Amazon Web Services account
//
// This member is required.
Entries []types.ListMapsResponseEntry
// A pagination token indicating there are additional pages available. You can use
// the token in a following request to fetch the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListMapsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListMaps{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListMaps{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListMapsMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMaps(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListMapsMiddleware struct {
}
func (*endpointPrefix_opListMapsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListMapsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "maps." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListMapsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListMapsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListMapsAPIClient is a client that implements the ListMaps operation.
type ListMapsAPIClient interface {
ListMaps(context.Context, *ListMapsInput, ...func(*Options)) (*ListMapsOutput, error)
}
var _ ListMapsAPIClient = (*Client)(nil)
// ListMapsPaginatorOptions is the paginator options for ListMaps
type ListMapsPaginatorOptions struct {
// An optional limit for the number of resources returned in a single call.
// Default value: 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListMapsPaginator is a paginator for ListMaps
type ListMapsPaginator struct {
options ListMapsPaginatorOptions
client ListMapsAPIClient
params *ListMapsInput
nextToken *string
firstPage bool
}
// NewListMapsPaginator returns a new ListMapsPaginator
func NewListMapsPaginator(client ListMapsAPIClient, params *ListMapsInput, optFns ...func(*ListMapsPaginatorOptions)) *ListMapsPaginator {
if params == nil {
params = &ListMapsInput{}
}
options := ListMapsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListMapsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListMapsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListMaps page.
func (p *ListMapsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMapsOutput, 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.ListMaps(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_opListMaps(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListMaps",
}
}
| 253 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists place index resources in your Amazon Web Services account.
func (c *Client) ListPlaceIndexes(ctx context.Context, params *ListPlaceIndexesInput, optFns ...func(*Options)) (*ListPlaceIndexesOutput, error) {
if params == nil {
params = &ListPlaceIndexesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListPlaceIndexes", params, optFns, c.addOperationListPlaceIndexesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListPlaceIndexesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListPlaceIndexesInput struct {
// An optional limit for the maximum number of results returned in a single call.
// Default value: 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// value: null
NextToken *string
noSmithyDocumentSerde
}
type ListPlaceIndexesOutput struct {
// Lists the place index resources that exist in your Amazon Web Services account
//
// This member is required.
Entries []types.ListPlaceIndexesResponseEntry
// A pagination token indicating that there are additional pages available. You
// can use the token in a new request to fetch the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListPlaceIndexesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListPlaceIndexes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPlaceIndexes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListPlaceIndexesMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPlaceIndexes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListPlaceIndexesMiddleware struct {
}
func (*endpointPrefix_opListPlaceIndexesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListPlaceIndexesMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "places." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListPlaceIndexesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListPlaceIndexesMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListPlaceIndexesAPIClient is a client that implements the ListPlaceIndexes
// operation.
type ListPlaceIndexesAPIClient interface {
ListPlaceIndexes(context.Context, *ListPlaceIndexesInput, ...func(*Options)) (*ListPlaceIndexesOutput, error)
}
var _ ListPlaceIndexesAPIClient = (*Client)(nil)
// ListPlaceIndexesPaginatorOptions is the paginator options for ListPlaceIndexes
type ListPlaceIndexesPaginatorOptions struct {
// An optional limit for the maximum number of results returned in a single call.
// Default value: 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListPlaceIndexesPaginator is a paginator for ListPlaceIndexes
type ListPlaceIndexesPaginator struct {
options ListPlaceIndexesPaginatorOptions
client ListPlaceIndexesAPIClient
params *ListPlaceIndexesInput
nextToken *string
firstPage bool
}
// NewListPlaceIndexesPaginator returns a new ListPlaceIndexesPaginator
func NewListPlaceIndexesPaginator(client ListPlaceIndexesAPIClient, params *ListPlaceIndexesInput, optFns ...func(*ListPlaceIndexesPaginatorOptions)) *ListPlaceIndexesPaginator {
if params == nil {
params = &ListPlaceIndexesInput{}
}
options := ListPlaceIndexesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListPlaceIndexesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListPlaceIndexesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListPlaceIndexes page.
func (p *ListPlaceIndexesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlaceIndexesOutput, 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.ListPlaceIndexes(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_opListPlaceIndexes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListPlaceIndexes",
}
}
| 254 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists route calculator resources in your Amazon Web Services account.
func (c *Client) ListRouteCalculators(ctx context.Context, params *ListRouteCalculatorsInput, optFns ...func(*Options)) (*ListRouteCalculatorsOutput, error) {
if params == nil {
params = &ListRouteCalculatorsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListRouteCalculators", params, optFns, c.addOperationListRouteCalculatorsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListRouteCalculatorsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListRouteCalculatorsInput struct {
// An optional maximum number of results returned in a single call. Default Value:
// 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// Value: null
NextToken *string
noSmithyDocumentSerde
}
type ListRouteCalculatorsOutput struct {
// Lists the route calculator resources that exist in your Amazon Web Services
// account
//
// This member is required.
Entries []types.ListRouteCalculatorsResponseEntry
// A pagination token indicating there are additional pages available. You can use
// the token in a subsequent request to fetch the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListRouteCalculatorsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListRouteCalculators{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRouteCalculators{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListRouteCalculatorsMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRouteCalculators(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListRouteCalculatorsMiddleware struct {
}
func (*endpointPrefix_opListRouteCalculatorsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListRouteCalculatorsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "routes." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListRouteCalculatorsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListRouteCalculatorsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListRouteCalculatorsAPIClient is a client that implements the
// ListRouteCalculators operation.
type ListRouteCalculatorsAPIClient interface {
ListRouteCalculators(context.Context, *ListRouteCalculatorsInput, ...func(*Options)) (*ListRouteCalculatorsOutput, error)
}
var _ ListRouteCalculatorsAPIClient = (*Client)(nil)
// ListRouteCalculatorsPaginatorOptions is the paginator options for
// ListRouteCalculators
type ListRouteCalculatorsPaginatorOptions struct {
// An optional maximum number of results returned in a single call. Default Value:
// 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListRouteCalculatorsPaginator is a paginator for ListRouteCalculators
type ListRouteCalculatorsPaginator struct {
options ListRouteCalculatorsPaginatorOptions
client ListRouteCalculatorsAPIClient
params *ListRouteCalculatorsInput
nextToken *string
firstPage bool
}
// NewListRouteCalculatorsPaginator returns a new ListRouteCalculatorsPaginator
func NewListRouteCalculatorsPaginator(client ListRouteCalculatorsAPIClient, params *ListRouteCalculatorsInput, optFns ...func(*ListRouteCalculatorsPaginatorOptions)) *ListRouteCalculatorsPaginator {
if params == nil {
params = &ListRouteCalculatorsInput{}
}
options := ListRouteCalculatorsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListRouteCalculatorsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListRouteCalculatorsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListRouteCalculators page.
func (p *ListRouteCalculatorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRouteCalculatorsOutput, 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.ListRouteCalculators(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_opListRouteCalculators(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListRouteCalculators",
}
}
| 256 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of tags that are applied to the specified Amazon Location
// resource.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve.
// - Format example: arn:aws:geo:region:account-id:resourcetype/ExampleResource
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// Tags that have been applied to the specified resource. Tags are mapped from the
// tag key to the tag value: "TagKey" : "TagValue" .
// - Format example: {"tag1" : "value1", "tag2" : "value2"}
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListTagsForResourceMiddleware(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
}
type endpointPrefix_opListTagsForResourceMiddleware struct {
}
func (*endpointPrefix_opListTagsForResourceMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListTagsForResourceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "metadata." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListTagsForResourceMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListTagsForResourceMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListTagsForResource",
}
}
| 159 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists geofence collections currently associated to the given tracker resource.
func (c *Client) ListTrackerConsumers(ctx context.Context, params *ListTrackerConsumersInput, optFns ...func(*Options)) (*ListTrackerConsumersOutput, error) {
if params == nil {
params = &ListTrackerConsumersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTrackerConsumers", params, optFns, c.addOperationListTrackerConsumersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTrackerConsumersOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTrackerConsumersInput struct {
// The tracker resource whose associated geofence collections you want to list.
//
// This member is required.
TrackerName *string
// An optional limit for the number of resources returned in a single call.
// Default value: 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// value: null
NextToken *string
noSmithyDocumentSerde
}
type ListTrackerConsumersOutput struct {
// Contains the list of geofence collection ARNs associated to the tracker
// resource.
//
// This member is required.
ConsumerArns []string
// A pagination token indicating there are additional pages available. You can use
// the token in a following request to fetch the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTrackerConsumersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTrackerConsumers{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTrackerConsumers{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListTrackerConsumersMiddleware(stack); err != nil {
return err
}
if err = addOpListTrackerConsumersValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrackerConsumers(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListTrackerConsumersMiddleware struct {
}
func (*endpointPrefix_opListTrackerConsumersMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListTrackerConsumersMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListTrackerConsumersMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListTrackerConsumersMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListTrackerConsumersAPIClient is a client that implements the
// ListTrackerConsumers operation.
type ListTrackerConsumersAPIClient interface {
ListTrackerConsumers(context.Context, *ListTrackerConsumersInput, ...func(*Options)) (*ListTrackerConsumersOutput, error)
}
var _ ListTrackerConsumersAPIClient = (*Client)(nil)
// ListTrackerConsumersPaginatorOptions is the paginator options for
// ListTrackerConsumers
type ListTrackerConsumersPaginatorOptions struct {
// An optional limit for the number of resources returned in a single call.
// Default value: 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTrackerConsumersPaginator is a paginator for ListTrackerConsumers
type ListTrackerConsumersPaginator struct {
options ListTrackerConsumersPaginatorOptions
client ListTrackerConsumersAPIClient
params *ListTrackerConsumersInput
nextToken *string
firstPage bool
}
// NewListTrackerConsumersPaginator returns a new ListTrackerConsumersPaginator
func NewListTrackerConsumersPaginator(client ListTrackerConsumersAPIClient, params *ListTrackerConsumersInput, optFns ...func(*ListTrackerConsumersPaginatorOptions)) *ListTrackerConsumersPaginator {
if params == nil {
params = &ListTrackerConsumersInput{}
}
options := ListTrackerConsumersPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTrackerConsumersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTrackerConsumersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTrackerConsumers page.
func (p *ListTrackerConsumersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrackerConsumersOutput, 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.ListTrackerConsumers(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_opListTrackerConsumers(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListTrackerConsumers",
}
}
| 263 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists tracker resources in your Amazon Web Services account.
func (c *Client) ListTrackers(ctx context.Context, params *ListTrackersInput, optFns ...func(*Options)) (*ListTrackersOutput, error) {
if params == nil {
params = &ListTrackersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTrackers", params, optFns, c.addOperationListTrackersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTrackersOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTrackersInput struct {
// An optional limit for the number of resources returned in a single call.
// Default value: 100
MaxResults *int32
// The pagination token specifying which page of results to return in the
// response. If no token is provided, the default page is the first page. Default
// value: null
NextToken *string
noSmithyDocumentSerde
}
type ListTrackersOutput struct {
// Contains tracker resources in your Amazon Web Services account. Details include
// tracker name, description and timestamps for when the tracker was created and
// last updated.
//
// This member is required.
Entries []types.ListTrackersResponseEntry
// A pagination token indicating there are additional pages available. You can use
// the token in a following request to fetch the next set of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTrackersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTrackers{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTrackers{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opListTrackersMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTrackers(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opListTrackersMiddleware struct {
}
func (*endpointPrefix_opListTrackersMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListTrackersMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListTrackersMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListTrackersMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListTrackersAPIClient is a client that implements the ListTrackers operation.
type ListTrackersAPIClient interface {
ListTrackers(context.Context, *ListTrackersInput, ...func(*Options)) (*ListTrackersOutput, error)
}
var _ ListTrackersAPIClient = (*Client)(nil)
// ListTrackersPaginatorOptions is the paginator options for ListTrackers
type ListTrackersPaginatorOptions struct {
// An optional limit for the number of resources returned in a single call.
// Default value: 100
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTrackersPaginator is a paginator for ListTrackers
type ListTrackersPaginator struct {
options ListTrackersPaginatorOptions
client ListTrackersAPIClient
params *ListTrackersInput
nextToken *string
firstPage bool
}
// NewListTrackersPaginator returns a new ListTrackersPaginator
func NewListTrackersPaginator(client ListTrackersAPIClient, params *ListTrackersInput, optFns ...func(*ListTrackersPaginatorOptions)) *ListTrackersPaginator {
if params == nil {
params = &ListTrackersInput{}
}
options := ListTrackersPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTrackersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTrackersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTrackers page.
func (p *ListTrackersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrackersOutput, 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.ListTrackers(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_opListTrackers(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "ListTrackers",
}
}
| 255 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Stores a geofence geometry in a given geofence collection, or updates the
// geometry of an existing geofence if a geofence ID is included in the request.
func (c *Client) PutGeofence(ctx context.Context, params *PutGeofenceInput, optFns ...func(*Options)) (*PutGeofenceOutput, error) {
if params == nil {
params = &PutGeofenceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutGeofence", params, optFns, c.addOperationPutGeofenceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutGeofenceOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutGeofenceInput struct {
// The geofence collection to store the geofence in.
//
// This member is required.
CollectionName *string
// An identifier for the geofence. For example, ExampleGeofence-1 .
//
// This member is required.
GeofenceId *string
// Contains the details to specify the position of the geofence. Can be either a
// polygon or a circle. Including both will return a validation error. Each
// geofence polygon (https://docs.aws.amazon.com/location-geofences/latest/APIReference/API_GeofenceGeometry.html)
// can have a maximum of 1,000 vertices.
//
// This member is required.
Geometry *types.GeofenceGeometry
// Specifies additional user-defined properties to store with the Geofence. An
// array of key-value pairs.
GeofenceProperties map[string]string
noSmithyDocumentSerde
}
type PutGeofenceOutput struct {
// The timestamp for when the geofence was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
CreateTime *time.Time
// The geofence identifier entered in the request.
//
// This member is required.
GeofenceId *string
// The timestamp for when the geofence was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
UpdateTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutGeofenceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutGeofence{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutGeofence{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opPutGeofenceMiddleware(stack); err != nil {
return err
}
if err = addOpPutGeofenceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutGeofence(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opPutGeofenceMiddleware struct {
}
func (*endpointPrefix_opPutGeofenceMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutGeofenceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutGeofenceMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutGeofenceMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutGeofence(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "PutGeofence",
}
}
| 189 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Reverse geocodes a given coordinate and returns a legible address. Allows you
// to search for Places or points of interest near a given position.
func (c *Client) SearchPlaceIndexForPosition(ctx context.Context, params *SearchPlaceIndexForPositionInput, optFns ...func(*Options)) (*SearchPlaceIndexForPositionOutput, error) {
if params == nil {
params = &SearchPlaceIndexForPositionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchPlaceIndexForPosition", params, optFns, c.addOperationSearchPlaceIndexForPositionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchPlaceIndexForPositionOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchPlaceIndexForPositionInput struct {
// The name of the place index resource you want to use for the search.
//
// This member is required.
IndexName *string
// Specifies the longitude and latitude of the position to query. This parameter
// must contain a pair of numbers. The first number represents the X coordinate, or
// longitude; the second number represents the Y coordinate, or latitude. For
// example, [-123.1174, 49.2847] represents a position with longitude -123.1174
// and latitude 49.2847 .
//
// This member is required.
Position []float64
// The preferred language used to return results. The value must be a valid BCP 47 (https://tools.ietf.org/search/bcp47)
// language tag, for example, en for English. This setting affects the languages
// used in the results, but not the results themselves. If no language is
// specified, or not supported for a particular result, the partner automatically
// chooses a language for the result. For an example, we'll use the Greek language.
// You search for a location around Athens, Greece, with the language parameter
// set to en . The city in the results will most likely be returned as Athens . If
// you set the language parameter to el , for Greek, then the city in the results
// will more likely be returned as Αθήνα . If the data provider does not have a
// value for Greek, the result will be in a language that the provider does
// support.
Language *string
// An optional parameter. The maximum number of results returned per request.
// Default value: 50
MaxResults int32
noSmithyDocumentSerde
}
type SearchPlaceIndexForPositionOutput struct {
// Returns a list of Places closest to the specified position. Each result
// contains additional information about the Places returned.
//
// This member is required.
Results []types.SearchForPositionResult
// Contains a summary of the request. Echoes the input values for Position ,
// Language , MaxResults , and the DataSource of the place index.
//
// This member is required.
Summary *types.SearchPlaceIndexForPositionSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchPlaceIndexForPositionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchPlaceIndexForPosition{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchPlaceIndexForPosition{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opSearchPlaceIndexForPositionMiddleware(stack); err != nil {
return err
}
if err = addOpSearchPlaceIndexForPositionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchPlaceIndexForPosition(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opSearchPlaceIndexForPositionMiddleware struct {
}
func (*endpointPrefix_opSearchPlaceIndexForPositionMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opSearchPlaceIndexForPositionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "places." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opSearchPlaceIndexForPositionMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opSearchPlaceIndexForPositionMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opSearchPlaceIndexForPosition(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "SearchPlaceIndexForPosition",
}
}
| 192 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Generates suggestions for addresses and points of interest based on partial or
// misspelled free-form text. This operation is also known as autocomplete,
// autosuggest, or fuzzy matching. Optional parameters let you narrow your search
// results by bounding box or country, or bias your search toward a specific
// position on the globe. You can search for suggested place names near a specified
// position by using BiasPosition , or filter results within a bounding box by
// using FilterBBox . These parameters are mutually exclusive; using both
// BiasPosition and FilterBBox in the same command returns an error.
func (c *Client) SearchPlaceIndexForSuggestions(ctx context.Context, params *SearchPlaceIndexForSuggestionsInput, optFns ...func(*Options)) (*SearchPlaceIndexForSuggestionsOutput, error) {
if params == nil {
params = &SearchPlaceIndexForSuggestionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchPlaceIndexForSuggestions", params, optFns, c.addOperationSearchPlaceIndexForSuggestionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchPlaceIndexForSuggestionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchPlaceIndexForSuggestionsInput struct {
// The name of the place index resource you want to use for the search.
//
// This member is required.
IndexName *string
// The free-form partial text to use to generate place suggestions. For example,
// eiffel tow .
//
// This member is required.
Text *string
// An optional parameter that indicates a preference for place suggestions that
// are closer to a specified position. If provided, this parameter must contain a
// pair of numbers. The first number represents the X coordinate, or longitude; the
// second number represents the Y coordinate, or latitude. For example,
// [-123.1174, 49.2847] represents the position with longitude -123.1174 and
// latitude 49.2847 . BiasPosition and FilterBBox are mutually exclusive.
// Specifying both options results in an error.
BiasPosition []float64
// An optional parameter that limits the search results by returning only
// suggestions within a specified bounding box. If provided, this parameter must
// contain a total of four consecutive numbers in two pairs. The first pair of
// numbers represents the X and Y coordinates (longitude and latitude,
// respectively) of the southwest corner of the bounding box; the second pair of
// numbers represents the X and Y coordinates (longitude and latitude,
// respectively) of the northeast corner of the bounding box. For example,
// [-12.7935, -37.4835, -12.0684, -36.9542] represents a bounding box where the
// southwest corner has longitude -12.7935 and latitude -37.4835 , and the
// northeast corner has longitude -12.0684 and latitude -36.9542 . FilterBBox and
// BiasPosition are mutually exclusive. Specifying both options results in an error.
FilterBBox []float64
// A list of one or more Amazon Location categories to filter the returned places.
// If you include more than one category, the results will include results that
// match any of the categories listed. For more information about using categories,
// including a list of Amazon Location categories, see Categories and filtering (https://docs.aws.amazon.com/location/latest/developerguide/category-filtering.html)
// , in the Amazon Location Service Developer Guide.
FilterCategories []string
// An optional parameter that limits the search results by returning only
// suggestions within the provided list of countries.
// - Use the ISO 3166 (https://www.iso.org/iso-3166-country-codes.html) 3-digit
// country code. For example, Australia uses three upper-case characters: AUS .
FilterCountries []string
// The preferred language used to return results. The value must be a valid BCP 47 (https://tools.ietf.org/search/bcp47)
// language tag, for example, en for English. This setting affects the languages
// used in the results. If no language is specified, or not supported for a
// particular result, the partner automatically chooses a language for the result.
// For an example, we'll use the Greek language. You search for Athens, Gr to get
// suggestions with the language parameter set to en . The results found will most
// likely be returned as Athens, Greece . If you set the language parameter to el ,
// for Greek, then the result found will more likely be returned as Αθήνα, Ελλάδα .
// If the data provider does not have a value for Greek, the result will be in a
// language that the provider does support.
Language *string
// An optional parameter. The maximum number of results returned per request. The
// default: 5
MaxResults *int32
noSmithyDocumentSerde
}
type SearchPlaceIndexForSuggestionsOutput struct {
// A list of place suggestions that best match the search text.
//
// This member is required.
Results []types.SearchForSuggestionsResult
// Contains a summary of the request. Echoes the input values for BiasPosition ,
// FilterBBox , FilterCountries , Language , MaxResults , and Text . Also includes
// the DataSource of the place index.
//
// This member is required.
Summary *types.SearchPlaceIndexForSuggestionsSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchPlaceIndexForSuggestionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchPlaceIndexForSuggestions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchPlaceIndexForSuggestions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opSearchPlaceIndexForSuggestionsMiddleware(stack); err != nil {
return err
}
if err = addOpSearchPlaceIndexForSuggestionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchPlaceIndexForSuggestions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opSearchPlaceIndexForSuggestionsMiddleware struct {
}
func (*endpointPrefix_opSearchPlaceIndexForSuggestionsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opSearchPlaceIndexForSuggestionsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "places." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opSearchPlaceIndexForSuggestionsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opSearchPlaceIndexForSuggestionsMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opSearchPlaceIndexForSuggestions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "SearchPlaceIndexForSuggestions",
}
}
| 229 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Geocodes free-form text, such as an address, name, city, or region to allow you
// to search for Places or points of interest. Optional parameters let you narrow
// your search results by bounding box or country, or bias your search toward a
// specific position on the globe. You can search for places near a given position
// using BiasPosition , or filter results within a bounding box using FilterBBox .
// Providing both parameters simultaneously returns an error. Search results are
// returned in order of highest to lowest relevance.
func (c *Client) SearchPlaceIndexForText(ctx context.Context, params *SearchPlaceIndexForTextInput, optFns ...func(*Options)) (*SearchPlaceIndexForTextOutput, error) {
if params == nil {
params = &SearchPlaceIndexForTextInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchPlaceIndexForText", params, optFns, c.addOperationSearchPlaceIndexForTextMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchPlaceIndexForTextOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchPlaceIndexForTextInput struct {
// The name of the place index resource you want to use for the search.
//
// This member is required.
IndexName *string
// The address, name, city, or region to be used in the search in free-form text
// format. For example, 123 Any Street .
//
// This member is required.
Text *string
// An optional parameter that indicates a preference for places that are closer to
// a specified position. If provided, this parameter must contain a pair of
// numbers. The first number represents the X coordinate, or longitude; the second
// number represents the Y coordinate, or latitude. For example, [-123.1174,
// 49.2847] represents the position with longitude -123.1174 and latitude 49.2847 .
// BiasPosition and FilterBBox are mutually exclusive. Specifying both options
// results in an error.
BiasPosition []float64
// An optional parameter that limits the search results by returning only places
// that are within the provided bounding box. If provided, this parameter must
// contain a total of four consecutive numbers in two pairs. The first pair of
// numbers represents the X and Y coordinates (longitude and latitude,
// respectively) of the southwest corner of the bounding box; the second pair of
// numbers represents the X and Y coordinates (longitude and latitude,
// respectively) of the northeast corner of the bounding box. For example,
// [-12.7935, -37.4835, -12.0684, -36.9542] represents a bounding box where the
// southwest corner has longitude -12.7935 and latitude -37.4835 , and the
// northeast corner has longitude -12.0684 and latitude -36.9542 . FilterBBox and
// BiasPosition are mutually exclusive. Specifying both options results in an error.
FilterBBox []float64
// A list of one or more Amazon Location categories to filter the returned places.
// If you include more than one category, the results will include results that
// match any of the categories listed. For more information about using categories,
// including a list of Amazon Location categories, see Categories and filtering (https://docs.aws.amazon.com/location/latest/developerguide/category-filtering.html)
// , in the Amazon Location Service Developer Guide.
FilterCategories []string
// An optional parameter that limits the search results by returning only places
// that are in a specified list of countries.
// - Valid values include ISO 3166 (https://www.iso.org/iso-3166-country-codes.html)
// 3-digit country codes. For example, Australia uses three upper-case characters:
// AUS .
FilterCountries []string
// The preferred language used to return results. The value must be a valid BCP 47 (https://tools.ietf.org/search/bcp47)
// language tag, for example, en for English. This setting affects the languages
// used in the results, but not the results themselves. If no language is
// specified, or not supported for a particular result, the partner automatically
// chooses a language for the result. For an example, we'll use the Greek language.
// You search for Athens, Greece , with the language parameter set to en . The
// result found will most likely be returned as Athens . If you set the language
// parameter to el , for Greek, then the result found will more likely be returned
// as Αθήνα . If the data provider does not have a value for Greek, the result will
// be in a language that the provider does support.
Language *string
// An optional parameter. The maximum number of results returned per request. The
// default: 50
MaxResults int32
noSmithyDocumentSerde
}
type SearchPlaceIndexForTextOutput struct {
// A list of Places matching the input text. Each result contains additional
// information about the specific point of interest. Not all response properties
// are included with all responses. Some properties may only be returned by
// specific data partners.
//
// This member is required.
Results []types.SearchForTextResult
// Contains a summary of the request. Echoes the input values for BiasPosition ,
// FilterBBox , FilterCountries , Language , MaxResults , and Text . Also includes
// the DataSource of the place index and the bounding box, ResultBBox , which
// surrounds the search results.
//
// This member is required.
Summary *types.SearchPlaceIndexForTextSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchPlaceIndexForTextMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchPlaceIndexForText{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchPlaceIndexForText{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opSearchPlaceIndexForTextMiddleware(stack); err != nil {
return err
}
if err = addOpSearchPlaceIndexForTextValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchPlaceIndexForText(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opSearchPlaceIndexForTextMiddleware struct {
}
func (*endpointPrefix_opSearchPlaceIndexForTextMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opSearchPlaceIndexForTextMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "places." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opSearchPlaceIndexForTextMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opSearchPlaceIndexForTextMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opSearchPlaceIndexForText(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "SearchPlaceIndexForText",
}
}
| 233 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Assigns one or more tags (key-value pairs) to the specified Amazon Location
// Service resource. Tags can help you organize and categorize your resources. You
// can also use them to scope user permissions, by granting a user permission to
// access or change only resources with certain tag values. You can use the
// TagResource operation with an Amazon Location Service resource that already has
// tags. If you specify a new tag key for the resource, this tag is appended to the
// tags already associated with the resource. If you specify a tag key that's
// already associated with the resource, the new tag value that you specify
// replaces the previous value for that tag. You can associate up to 50 tags with a
// resource.
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource whose tags you want to update.
// - Format example: arn:aws:geo:region:account-id:resourcetype/ExampleResource
//
// This member is required.
ResourceArn *string
// Applies one or more tags to specific resource. A tag is a key-value pair that
// helps you manage, identify, search, and filter your resources. Format: "key" :
// "value" Restrictions:
// - Maximum 50 tags per resource.
// - Each tag key must be unique and must have exactly one associated value.
// - Maximum key length: 128 Unicode characters in UTF-8.
// - Maximum value length: 256 Unicode characters in UTF-8.
// - Can use alphanumeric characters (A–Z, a–z, 0–9), and the following
// characters: + - = . _ : / @
// - Cannot use "aws:" as a prefix for a key.
//
// This member is required.
Tags map[string]string
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opTagResourceMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opTagResourceMiddleware struct {
}
func (*endpointPrefix_opTagResourceMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opTagResourceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "metadata." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opTagResourceMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opTagResourceMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "TagResource",
}
}
| 175 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes one or more tags from the specified Amazon Location resource.
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource from which you want to remove
// tags.
// - Format example: arn:aws:geo:region:account-id:resourcetype/ExampleResource
//
// This member is required.
ResourceArn *string
// The list of tag keys to remove from the specified resource.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opUntagResourceMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opUntagResourceMiddleware struct {
}
func (*endpointPrefix_opUntagResourceMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUntagResourceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "metadata." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUntagResourceMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUntagResourceMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "UntagResource",
}
}
| 158 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the specified properties of a given geofence collection.
func (c *Client) UpdateGeofenceCollection(ctx context.Context, params *UpdateGeofenceCollectionInput, optFns ...func(*Options)) (*UpdateGeofenceCollectionOutput, error) {
if params == nil {
params = &UpdateGeofenceCollectionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateGeofenceCollection", params, optFns, c.addOperationUpdateGeofenceCollectionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateGeofenceCollectionOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateGeofenceCollectionInput struct {
// The name of the geofence collection to update.
//
// This member is required.
CollectionName *string
// Updates the description for the geofence collection.
Description *string
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
// This parameter is no longer used.
//
// Deprecated: Deprecated. No longer allowed.
PricingPlanDataSource *string
noSmithyDocumentSerde
}
type UpdateGeofenceCollectionOutput struct {
// The Amazon Resource Name (ARN) of the updated geofence collection. Used to
// specify a resource across Amazon Web Services.
// - Format example:
// arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollection
//
// This member is required.
CollectionArn *string
// The name of the updated geofence collection.
//
// This member is required.
CollectionName *string
// The time when the geofence collection was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
UpdateTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateGeofenceCollectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateGeofenceCollection{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateGeofenceCollection{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opUpdateGeofenceCollectionMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateGeofenceCollectionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateGeofenceCollection(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opUpdateGeofenceCollectionMiddleware struct {
}
func (*endpointPrefix_opUpdateGeofenceCollectionMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateGeofenceCollectionMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "geofencing." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateGeofenceCollectionMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateGeofenceCollectionMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdateGeofenceCollection(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "UpdateGeofenceCollection",
}
}
| 187 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the specified properties of a given API key resource. The API keys
// feature is in preview. We may add, change, or remove features before announcing
// general availability. For more information, see Using API keys (https://docs.aws.amazon.com/location/latest/developerguide/using-apikeys.html)
// .
func (c *Client) UpdateKey(ctx context.Context, params *UpdateKeyInput, optFns ...func(*Options)) (*UpdateKeyOutput, error) {
if params == nil {
params = &UpdateKeyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateKey", params, optFns, c.addOperationUpdateKeyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateKeyOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateKeyInput struct {
// The name of the API key resource to update.
//
// This member is required.
KeyName *string
// Updates the description for the API key resource.
Description *string
// Updates the timestamp for when the API key resource will expire in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
ExpireTime *time.Time
// The boolean flag to be included for updating ExpireTime or Restrictions
// details. Must be set to true to update an API key resource that has been used
// in the past 7 days. False if force update is not preferred Default value: False
ForceUpdate *bool
// Whether the API key should expire. Set to true to set the API key to have no
// expiration time.
NoExpiry *bool
// Updates the API key restrictions for the API key resource.
Restrictions *types.ApiKeyRestrictions
noSmithyDocumentSerde
}
type UpdateKeyOutput struct {
// The Amazon Resource Name (ARN) for the API key resource. Used when you need to
// specify a resource across all Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:key/ExampleKey
//
// This member is required.
KeyArn *string
// The name of the API key resource.
//
// This member is required.
KeyName *string
// The timestamp for when the API key resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateKeyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateKey{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateKey{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opUpdateKeyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateKeyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateKey(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opUpdateKeyMiddleware struct {
}
func (*endpointPrefix_opUpdateKeyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateKeyMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "metadata." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateKeyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateKeyMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdateKey(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "UpdateKey",
}
}
| 194 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the specified properties of a given map resource.
func (c *Client) UpdateMap(ctx context.Context, params *UpdateMapInput, optFns ...func(*Options)) (*UpdateMapOutput, error) {
if params == nil {
params = &UpdateMapInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateMap", params, optFns, c.addOperationUpdateMapMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateMapOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateMapInput struct {
// The name of the map resource to update.
//
// This member is required.
MapName *string
// Updates the parts of the map configuration that can be updated, including the
// political view.
ConfigurationUpdate *types.MapConfigurationUpdate
// Updates the description for the map resource.
Description *string
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
noSmithyDocumentSerde
}
type UpdateMapOutput struct {
// The Amazon Resource Name (ARN) of the updated map resource. Used to specify a
// resource across AWS.
// - Format example: arn:aws:geo:region:account-id:map/ExampleMap
//
// This member is required.
MapArn *string
// The name of the updated map resource.
//
// This member is required.
MapName *string
// The timestamp for when the map resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateMapMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateMap{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateMap{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opUpdateMapMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateMapValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMap(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opUpdateMapMiddleware struct {
}
func (*endpointPrefix_opUpdateMapMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateMapMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "maps." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateMapMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateMapMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdateMap(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "UpdateMap",
}
}
| 185 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the specified properties of a given place index resource.
func (c *Client) UpdatePlaceIndex(ctx context.Context, params *UpdatePlaceIndexInput, optFns ...func(*Options)) (*UpdatePlaceIndexOutput, error) {
if params == nil {
params = &UpdatePlaceIndexInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdatePlaceIndex", params, optFns, c.addOperationUpdatePlaceIndexMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdatePlaceIndexOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdatePlaceIndexInput struct {
// The name of the place index resource to update.
//
// This member is required.
IndexName *string
// Updates the data storage option for the place index resource.
DataSourceConfiguration *types.DataSourceConfiguration
// Updates the description for the place index resource.
Description *string
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
noSmithyDocumentSerde
}
type UpdatePlaceIndexOutput struct {
// The Amazon Resource Name (ARN) of the upated place index resource. Used to
// specify a resource across Amazon Web Services.
// - Format example: arn:aws:geo:region:account-id:place- index/ExamplePlaceIndex
//
// This member is required.
IndexArn *string
// The name of the updated place index resource.
//
// This member is required.
IndexName *string
// The timestamp for when the place index resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdatePlaceIndexMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePlaceIndex{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePlaceIndex{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opUpdatePlaceIndexMiddleware(stack); err != nil {
return err
}
if err = addOpUpdatePlaceIndexValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePlaceIndex(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opUpdatePlaceIndexMiddleware struct {
}
func (*endpointPrefix_opUpdatePlaceIndexMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdatePlaceIndexMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "places." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdatePlaceIndexMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdatePlaceIndexMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdatePlaceIndex(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "UpdatePlaceIndex",
}
}
| 184 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the specified properties for a given route calculator resource.
func (c *Client) UpdateRouteCalculator(ctx context.Context, params *UpdateRouteCalculatorInput, optFns ...func(*Options)) (*UpdateRouteCalculatorOutput, error) {
if params == nil {
params = &UpdateRouteCalculatorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateRouteCalculator", params, optFns, c.addOperationUpdateRouteCalculatorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateRouteCalculatorOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateRouteCalculatorInput struct {
// The name of the route calculator resource to update.
//
// This member is required.
CalculatorName *string
// Updates the description for the route calculator resource.
Description *string
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
noSmithyDocumentSerde
}
type UpdateRouteCalculatorOutput struct {
// The Amazon Resource Name (ARN) of the updated route calculator resource. Used
// to specify a resource across AWS.
// - Format example: arn:aws:geo:region:account-id:route-
// calculator/ExampleCalculator
//
// This member is required.
CalculatorArn *string
// The name of the updated route calculator resource.
//
// This member is required.
CalculatorName *string
// The timestamp for when the route calculator was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateRouteCalculatorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRouteCalculator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRouteCalculator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opUpdateRouteCalculatorMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateRouteCalculatorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRouteCalculator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opUpdateRouteCalculatorMiddleware struct {
}
func (*endpointPrefix_opUpdateRouteCalculatorMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateRouteCalculatorMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "routes." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateRouteCalculatorMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateRouteCalculatorMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdateRouteCalculator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "UpdateRouteCalculator",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the specified properties of a given tracker resource.
func (c *Client) UpdateTracker(ctx context.Context, params *UpdateTrackerInput, optFns ...func(*Options)) (*UpdateTrackerOutput, error) {
if params == nil {
params = &UpdateTrackerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateTracker", params, optFns, c.addOperationUpdateTrackerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateTrackerOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateTrackerInput struct {
// The name of the tracker resource to update.
//
// This member is required.
TrackerName *string
// Updates the description for the tracker resource.
Description *string
// Updates the position filtering for the tracker resource. Valid values:
// - TimeBased - Location updates are evaluated against linked geofence
// collections, but not every location update is stored. If your update frequency
// is more often than 30 seconds, only one update per 30 seconds is stored for each
// unique device ID.
// - DistanceBased - If the device has moved less than 30 m (98.4 ft), location
// updates are ignored. Location updates within this distance are neither evaluated
// against linked geofence collections, nor stored. This helps control costs by
// reducing the number of geofence evaluations and historical device positions to
// paginate through. Distance-based filtering can also reduce the effects of GPS
// noise when displaying device trajectories on a map.
// - AccuracyBased - If the device has moved less than the measured accuracy,
// location updates are ignored. For example, if two consecutive updates from a
// device have a horizontal accuracy of 5 m and 10 m, the second update is ignored
// if the device has moved less than 15 m. Ignored location updates are neither
// evaluated against linked geofence collections, nor stored. This helps educe the
// effects of GPS noise when displaying device trajectories on a map, and can help
// control costs by reducing the number of geofence evaluations.
PositionFiltering types.PositionFiltering
// No longer used. If included, the only allowed value is RequestBasedUsage .
//
// Deprecated: Deprecated. If included, the only allowed value is
// RequestBasedUsage.
PricingPlan types.PricingPlan
// This parameter is no longer used.
//
// Deprecated: Deprecated. No longer allowed.
PricingPlanDataSource *string
noSmithyDocumentSerde
}
type UpdateTrackerOutput struct {
// The Amazon Resource Name (ARN) of the updated tracker resource. Used to specify
// a resource across AWS.
// - Format example: arn:aws:geo:region:account-id:tracker/ExampleTracker
//
// This member is required.
TrackerArn *string
// The name of the updated tracker resource.
//
// This member is required.
TrackerName *string
// The timestamp for when the tracker resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateTrackerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateTracker{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateTracker{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addEndpointPrefix_opUpdateTrackerMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateTrackerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTracker(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type endpointPrefix_opUpdateTrackerMiddleware struct {
}
func (*endpointPrefix_opUpdateTrackerMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateTrackerMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) {
return next.HandleSerialize(ctx, in)
}
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
req.URL.Host = "tracking." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateTrackerMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateTrackerMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdateTracker(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "geo",
OperationName: "UpdateTracker",
}
}
| 206 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/location/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"math"
"strings"
)
type awsRestjson1_deserializeOpAssociateTrackerConsumer struct {
}
func (*awsRestjson1_deserializeOpAssociateTrackerConsumer) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpAssociateTrackerConsumer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorAssociateTrackerConsumer(response, &metadata)
}
output := &AssociateTrackerConsumerOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorAssociateTrackerConsumer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpBatchDeleteDevicePositionHistory struct {
}
func (*awsRestjson1_deserializeOpBatchDeleteDevicePositionHistory) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpBatchDeleteDevicePositionHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorBatchDeleteDevicePositionHistory(response, &metadata)
}
output := &BatchDeleteDevicePositionHistoryOutput{}
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_deserializeOpDocumentBatchDeleteDevicePositionHistoryOutput(&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_deserializeOpErrorBatchDeleteDevicePositionHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentBatchDeleteDevicePositionHistoryOutput(v **BatchDeleteDevicePositionHistoryOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *BatchDeleteDevicePositionHistoryOutput
if *v == nil {
sv = &BatchDeleteDevicePositionHistoryOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Errors":
if err := awsRestjson1_deserializeDocumentBatchDeleteDevicePositionHistoryErrorList(&sv.Errors, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpBatchDeleteGeofence struct {
}
func (*awsRestjson1_deserializeOpBatchDeleteGeofence) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpBatchDeleteGeofence) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorBatchDeleteGeofence(response, &metadata)
}
output := &BatchDeleteGeofenceOutput{}
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_deserializeOpDocumentBatchDeleteGeofenceOutput(&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_deserializeOpErrorBatchDeleteGeofence(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentBatchDeleteGeofenceOutput(v **BatchDeleteGeofenceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *BatchDeleteGeofenceOutput
if *v == nil {
sv = &BatchDeleteGeofenceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Errors":
if err := awsRestjson1_deserializeDocumentBatchDeleteGeofenceErrorList(&sv.Errors, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpBatchEvaluateGeofences struct {
}
func (*awsRestjson1_deserializeOpBatchEvaluateGeofences) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpBatchEvaluateGeofences) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorBatchEvaluateGeofences(response, &metadata)
}
output := &BatchEvaluateGeofencesOutput{}
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_deserializeOpDocumentBatchEvaluateGeofencesOutput(&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_deserializeOpErrorBatchEvaluateGeofences(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentBatchEvaluateGeofencesOutput(v **BatchEvaluateGeofencesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *BatchEvaluateGeofencesOutput
if *v == nil {
sv = &BatchEvaluateGeofencesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Errors":
if err := awsRestjson1_deserializeDocumentBatchEvaluateGeofencesErrorList(&sv.Errors, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpBatchGetDevicePosition struct {
}
func (*awsRestjson1_deserializeOpBatchGetDevicePosition) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpBatchGetDevicePosition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorBatchGetDevicePosition(response, &metadata)
}
output := &BatchGetDevicePositionOutput{}
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_deserializeOpDocumentBatchGetDevicePositionOutput(&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_deserializeOpErrorBatchGetDevicePosition(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentBatchGetDevicePositionOutput(v **BatchGetDevicePositionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *BatchGetDevicePositionOutput
if *v == nil {
sv = &BatchGetDevicePositionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DevicePositions":
if err := awsRestjson1_deserializeDocumentDevicePositionList(&sv.DevicePositions, value); err != nil {
return err
}
case "Errors":
if err := awsRestjson1_deserializeDocumentBatchGetDevicePositionErrorList(&sv.Errors, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpBatchPutGeofence struct {
}
func (*awsRestjson1_deserializeOpBatchPutGeofence) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpBatchPutGeofence) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorBatchPutGeofence(response, &metadata)
}
output := &BatchPutGeofenceOutput{}
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_deserializeOpDocumentBatchPutGeofenceOutput(&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_deserializeOpErrorBatchPutGeofence(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentBatchPutGeofenceOutput(v **BatchPutGeofenceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *BatchPutGeofenceOutput
if *v == nil {
sv = &BatchPutGeofenceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Errors":
if err := awsRestjson1_deserializeDocumentBatchPutGeofenceErrorList(&sv.Errors, value); err != nil {
return err
}
case "Successes":
if err := awsRestjson1_deserializeDocumentBatchPutGeofenceSuccessList(&sv.Successes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpBatchUpdateDevicePosition struct {
}
func (*awsRestjson1_deserializeOpBatchUpdateDevicePosition) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpBatchUpdateDevicePosition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorBatchUpdateDevicePosition(response, &metadata)
}
output := &BatchUpdateDevicePositionOutput{}
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_deserializeOpDocumentBatchUpdateDevicePositionOutput(&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_deserializeOpErrorBatchUpdateDevicePosition(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentBatchUpdateDevicePositionOutput(v **BatchUpdateDevicePositionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *BatchUpdateDevicePositionOutput
if *v == nil {
sv = &BatchUpdateDevicePositionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Errors":
if err := awsRestjson1_deserializeDocumentBatchUpdateDevicePositionErrorList(&sv.Errors, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCalculateRoute struct {
}
func (*awsRestjson1_deserializeOpCalculateRoute) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCalculateRoute) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCalculateRoute(response, &metadata)
}
output := &CalculateRouteOutput{}
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_deserializeOpDocumentCalculateRouteOutput(&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_deserializeOpErrorCalculateRoute(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCalculateRouteOutput(v **CalculateRouteOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CalculateRouteOutput
if *v == nil {
sv = &CalculateRouteOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Legs":
if err := awsRestjson1_deserializeDocumentLegList(&sv.Legs, value); err != nil {
return err
}
case "Summary":
if err := awsRestjson1_deserializeDocumentCalculateRouteSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCalculateRouteMatrix struct {
}
func (*awsRestjson1_deserializeOpCalculateRouteMatrix) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCalculateRouteMatrix) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCalculateRouteMatrix(response, &metadata)
}
output := &CalculateRouteMatrixOutput{}
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_deserializeOpDocumentCalculateRouteMatrixOutput(&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_deserializeOpErrorCalculateRouteMatrix(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCalculateRouteMatrixOutput(v **CalculateRouteMatrixOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CalculateRouteMatrixOutput
if *v == nil {
sv = &CalculateRouteMatrixOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RouteMatrix":
if err := awsRestjson1_deserializeDocumentRouteMatrix(&sv.RouteMatrix, value); err != nil {
return err
}
case "SnappedDeparturePositions":
if err := awsRestjson1_deserializeDocumentPositionList(&sv.SnappedDeparturePositions, value); err != nil {
return err
}
case "SnappedDestinationPositions":
if err := awsRestjson1_deserializeDocumentPositionList(&sv.SnappedDestinationPositions, value); err != nil {
return err
}
case "Summary":
if err := awsRestjson1_deserializeDocumentCalculateRouteMatrixSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateGeofenceCollection struct {
}
func (*awsRestjson1_deserializeOpCreateGeofenceCollection) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateGeofenceCollection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateGeofenceCollection(response, &metadata)
}
output := &CreateGeofenceCollectionOutput{}
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_deserializeOpDocumentCreateGeofenceCollectionOutput(&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_deserializeOpErrorCreateGeofenceCollection(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateGeofenceCollectionOutput(v **CreateGeofenceCollectionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateGeofenceCollectionOutput
if *v == nil {
sv = &CreateGeofenceCollectionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CollectionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.CollectionArn = ptr.String(jtv)
}
case "CollectionName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.CollectionName = ptr.String(jtv)
}
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateKey struct {
}
func (*awsRestjson1_deserializeOpCreateKey) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateKey(response, &metadata)
}
output := &CreateKeyOutput{}
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_deserializeOpDocumentCreateKeyOutput(&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_deserializeOpErrorCreateKey(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateKeyOutput(v **CreateKeyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateKeyOutput
if *v == nil {
sv = &CreateKeyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApiKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "KeyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.KeyArn = ptr.String(jtv)
}
case "KeyName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.KeyName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateMap struct {
}
func (*awsRestjson1_deserializeOpCreateMap) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateMap) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateMap(response, &metadata)
}
output := &CreateMapOutput{}
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_deserializeOpDocumentCreateMapOutput(&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_deserializeOpErrorCreateMap(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateMapOutput(v **CreateMapOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateMapOutput
if *v == nil {
sv = &CreateMapOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "MapArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoArn to be of type string, got %T instead", value)
}
sv.MapArn = ptr.String(jtv)
}
case "MapName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.MapName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreatePlaceIndex struct {
}
func (*awsRestjson1_deserializeOpCreatePlaceIndex) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreatePlaceIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreatePlaceIndex(response, &metadata)
}
output := &CreatePlaceIndexOutput{}
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_deserializeOpDocumentCreatePlaceIndexOutput(&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_deserializeOpErrorCreatePlaceIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreatePlaceIndexOutput(v **CreatePlaceIndexOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreatePlaceIndexOutput
if *v == nil {
sv = &CreatePlaceIndexOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "IndexArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoArn to be of type string, got %T instead", value)
}
sv.IndexArn = ptr.String(jtv)
}
case "IndexName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.IndexName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateRouteCalculator struct {
}
func (*awsRestjson1_deserializeOpCreateRouteCalculator) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateRouteCalculator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateRouteCalculator(response, &metadata)
}
output := &CreateRouteCalculatorOutput{}
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_deserializeOpDocumentCreateRouteCalculatorOutput(&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_deserializeOpErrorCreateRouteCalculator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateRouteCalculatorOutput(v **CreateRouteCalculatorOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateRouteCalculatorOutput
if *v == nil {
sv = &CreateRouteCalculatorOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CalculatorArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoArn to be of type string, got %T instead", value)
}
sv.CalculatorArn = ptr.String(jtv)
}
case "CalculatorName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.CalculatorName = ptr.String(jtv)
}
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateTracker struct {
}
func (*awsRestjson1_deserializeOpCreateTracker) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateTracker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateTracker(response, &metadata)
}
output := &CreateTrackerOutput{}
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_deserializeOpDocumentCreateTrackerOutput(&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_deserializeOpErrorCreateTracker(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateTrackerOutput(v **CreateTrackerOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateTrackerOutput
if *v == nil {
sv = &CreateTrackerOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "TrackerArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.TrackerArn = ptr.String(jtv)
}
case "TrackerName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.TrackerName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteGeofenceCollection struct {
}
func (*awsRestjson1_deserializeOpDeleteGeofenceCollection) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteGeofenceCollection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteGeofenceCollection(response, &metadata)
}
output := &DeleteGeofenceCollectionOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteGeofenceCollection(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteKey struct {
}
func (*awsRestjson1_deserializeOpDeleteKey) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteKey(response, &metadata)
}
output := &DeleteKeyOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteKey(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteMap struct {
}
func (*awsRestjson1_deserializeOpDeleteMap) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteMap) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteMap(response, &metadata)
}
output := &DeleteMapOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteMap(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeletePlaceIndex struct {
}
func (*awsRestjson1_deserializeOpDeletePlaceIndex) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeletePlaceIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeletePlaceIndex(response, &metadata)
}
output := &DeletePlaceIndexOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeletePlaceIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteRouteCalculator struct {
}
func (*awsRestjson1_deserializeOpDeleteRouteCalculator) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteRouteCalculator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteRouteCalculator(response, &metadata)
}
output := &DeleteRouteCalculatorOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteRouteCalculator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteTracker struct {
}
func (*awsRestjson1_deserializeOpDeleteTracker) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteTracker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteTracker(response, &metadata)
}
output := &DeleteTrackerOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteTracker(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDescribeGeofenceCollection struct {
}
func (*awsRestjson1_deserializeOpDescribeGeofenceCollection) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeGeofenceCollection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeGeofenceCollection(response, &metadata)
}
output := &DescribeGeofenceCollectionOutput{}
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_deserializeOpDocumentDescribeGeofenceCollectionOutput(&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_deserializeOpErrorDescribeGeofenceCollection(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeGeofenceCollectionOutput(v **DescribeGeofenceCollectionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeGeofenceCollectionOutput
if *v == nil {
sv = &DescribeGeofenceCollectionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CollectionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.CollectionArn = ptr.String(jtv)
}
case "CollectionName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.CollectionName = ptr.String(jtv)
}
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "KmsKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value)
}
sv.KmsKeyId = ptr.String(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "PricingPlanDataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PricingPlanDataSource = ptr.String(jtv)
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeKey struct {
}
func (*awsRestjson1_deserializeOpDescribeKey) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeKey(response, &metadata)
}
output := &DescribeKeyOutput{}
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_deserializeOpDocumentDescribeKeyOutput(&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_deserializeOpErrorDescribeKey(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeKeyOutput(v **DescribeKeyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeKeyOutput
if *v == nil {
sv = &DescribeKeyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "ExpireTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.ExpireTime = ptr.Time(t)
}
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApiKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "KeyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.KeyArn = ptr.String(jtv)
}
case "KeyName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.KeyName = ptr.String(jtv)
}
case "Restrictions":
if err := awsRestjson1_deserializeDocumentApiKeyRestrictions(&sv.Restrictions, value); err != nil {
return err
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeMap struct {
}
func (*awsRestjson1_deserializeOpDescribeMap) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeMap) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeMap(response, &metadata)
}
output := &DescribeMapOutput{}
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_deserializeOpDocumentDescribeMapOutput(&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_deserializeOpErrorDescribeMap(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeMapOutput(v **DescribeMapOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeMapOutput
if *v == nil {
sv = &DescribeMapOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Configuration":
if err := awsRestjson1_deserializeDocumentMapConfiguration(&sv.Configuration, value); err != nil {
return err
}
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "MapArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoArn to be of type string, got %T instead", value)
}
sv.MapArn = ptr.String(jtv)
}
case "MapName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.MapName = ptr.String(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribePlaceIndex struct {
}
func (*awsRestjson1_deserializeOpDescribePlaceIndex) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribePlaceIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribePlaceIndex(response, &metadata)
}
output := &DescribePlaceIndexOutput{}
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_deserializeOpDocumentDescribePlaceIndexOutput(&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_deserializeOpErrorDescribePlaceIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribePlaceIndexOutput(v **DescribePlaceIndexOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribePlaceIndexOutput
if *v == nil {
sv = &DescribePlaceIndexOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "DataSourceConfiguration":
if err := awsRestjson1_deserializeDocumentDataSourceConfiguration(&sv.DataSourceConfiguration, value); err != nil {
return err
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "IndexArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoArn to be of type string, got %T instead", value)
}
sv.IndexArn = ptr.String(jtv)
}
case "IndexName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.IndexName = ptr.String(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeRouteCalculator struct {
}
func (*awsRestjson1_deserializeOpDescribeRouteCalculator) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeRouteCalculator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeRouteCalculator(response, &metadata)
}
output := &DescribeRouteCalculatorOutput{}
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_deserializeOpDocumentDescribeRouteCalculatorOutput(&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_deserializeOpErrorDescribeRouteCalculator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeRouteCalculatorOutput(v **DescribeRouteCalculatorOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeRouteCalculatorOutput
if *v == nil {
sv = &DescribeRouteCalculatorOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CalculatorArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoArn to be of type string, got %T instead", value)
}
sv.CalculatorArn = ptr.String(jtv)
}
case "CalculatorName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.CalculatorName = ptr.String(jtv)
}
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeTracker struct {
}
func (*awsRestjson1_deserializeOpDescribeTracker) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeTracker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeTracker(response, &metadata)
}
output := &DescribeTrackerOutput{}
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_deserializeOpDocumentDescribeTrackerOutput(&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_deserializeOpErrorDescribeTracker(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeTrackerOutput(v **DescribeTrackerOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeTrackerOutput
if *v == nil {
sv = &DescribeTrackerOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "KmsKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value)
}
sv.KmsKeyId = ptr.String(jtv)
}
case "PositionFiltering":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PositionFiltering to be of type string, got %T instead", value)
}
sv.PositionFiltering = types.PositionFiltering(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "PricingPlanDataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PricingPlanDataSource = ptr.String(jtv)
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "TrackerArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.TrackerArn = ptr.String(jtv)
}
case "TrackerName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.TrackerName = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDisassociateTrackerConsumer struct {
}
func (*awsRestjson1_deserializeOpDisassociateTrackerConsumer) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDisassociateTrackerConsumer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDisassociateTrackerConsumer(response, &metadata)
}
output := &DisassociateTrackerConsumerOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDisassociateTrackerConsumer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpGetDevicePosition struct {
}
func (*awsRestjson1_deserializeOpGetDevicePosition) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDevicePosition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetDevicePosition(response, &metadata)
}
output := &GetDevicePositionOutput{}
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_deserializeOpDocumentGetDevicePositionOutput(&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_deserializeOpErrorGetDevicePosition(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDevicePositionOutput(v **GetDevicePositionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDevicePositionOutput
if *v == nil {
sv = &GetDevicePositionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Accuracy":
if err := awsRestjson1_deserializeDocumentPositionalAccuracy(&sv.Accuracy, value); err != nil {
return err
}
case "DeviceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.DeviceId = ptr.String(jtv)
}
case "Position":
if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil {
return err
}
case "PositionProperties":
if err := awsRestjson1_deserializeDocumentPropertyMap(&sv.PositionProperties, value); err != nil {
return err
}
case "ReceivedTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.ReceivedTime = ptr.Time(t)
}
case "SampleTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.SampleTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDevicePositionHistory struct {
}
func (*awsRestjson1_deserializeOpGetDevicePositionHistory) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDevicePositionHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetDevicePositionHistory(response, &metadata)
}
output := &GetDevicePositionHistoryOutput{}
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_deserializeOpDocumentGetDevicePositionHistoryOutput(&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_deserializeOpErrorGetDevicePositionHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDevicePositionHistoryOutput(v **GetDevicePositionHistoryOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDevicePositionHistoryOutput
if *v == nil {
sv = &GetDevicePositionHistoryOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DevicePositions":
if err := awsRestjson1_deserializeDocumentDevicePositionList(&sv.DevicePositions, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetGeofence struct {
}
func (*awsRestjson1_deserializeOpGetGeofence) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetGeofence) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetGeofence(response, &metadata)
}
output := &GetGeofenceOutput{}
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_deserializeOpDocumentGetGeofenceOutput(&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_deserializeOpErrorGetGeofence(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetGeofenceOutput(v **GetGeofenceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetGeofenceOutput
if *v == nil {
sv = &GetGeofenceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "GeofenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.GeofenceId = ptr.String(jtv)
}
case "GeofenceProperties":
if err := awsRestjson1_deserializeDocumentPropertyMap(&sv.GeofenceProperties, value); err != nil {
return err
}
case "Geometry":
if err := awsRestjson1_deserializeDocumentGeofenceGeometry(&sv.Geometry, 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 "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetMapGlyphs struct {
}
func (*awsRestjson1_deserializeOpGetMapGlyphs) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetMapGlyphs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetMapGlyphs(response, &metadata)
}
output := &GetMapGlyphsOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsGetMapGlyphsOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
err = awsRestjson1_deserializeOpDocumentGetMapGlyphsOutput(output, response.Body, response.ContentLength)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetMapGlyphs(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsGetMapGlyphsOutput(v *GetMapGlyphsOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.CacheControl = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeOpDocumentGetMapGlyphsOutput(v *GetMapGlyphsOutput, body io.ReadCloser, contentLength int64) error {
if v == nil {
return fmt.Errorf("unsupported deserialization of nil %T", v)
}
var buf bytes.Buffer
if contentLength > 0 {
buf.Grow(int(contentLength))
} else {
buf.Grow(512)
}
_, err := buf.ReadFrom(body)
if err != nil {
return err
}
if buf.Len() > 0 {
v.Blob = buf.Bytes()
}
return nil
}
type awsRestjson1_deserializeOpGetMapSprites struct {
}
func (*awsRestjson1_deserializeOpGetMapSprites) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetMapSprites) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetMapSprites(response, &metadata)
}
output := &GetMapSpritesOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsGetMapSpritesOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
err = awsRestjson1_deserializeOpDocumentGetMapSpritesOutput(output, response.Body, response.ContentLength)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetMapSprites(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsGetMapSpritesOutput(v *GetMapSpritesOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.CacheControl = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeOpDocumentGetMapSpritesOutput(v *GetMapSpritesOutput, body io.ReadCloser, contentLength int64) error {
if v == nil {
return fmt.Errorf("unsupported deserialization of nil %T", v)
}
var buf bytes.Buffer
if contentLength > 0 {
buf.Grow(int(contentLength))
} else {
buf.Grow(512)
}
_, err := buf.ReadFrom(body)
if err != nil {
return err
}
if buf.Len() > 0 {
v.Blob = buf.Bytes()
}
return nil
}
type awsRestjson1_deserializeOpGetMapStyleDescriptor struct {
}
func (*awsRestjson1_deserializeOpGetMapStyleDescriptor) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetMapStyleDescriptor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetMapStyleDescriptor(response, &metadata)
}
output := &GetMapStyleDescriptorOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsGetMapStyleDescriptorOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
err = awsRestjson1_deserializeOpDocumentGetMapStyleDescriptorOutput(output, response.Body, response.ContentLength)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetMapStyleDescriptor(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsGetMapStyleDescriptorOutput(v *GetMapStyleDescriptorOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.CacheControl = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeOpDocumentGetMapStyleDescriptorOutput(v *GetMapStyleDescriptorOutput, body io.ReadCloser, contentLength int64) error {
if v == nil {
return fmt.Errorf("unsupported deserialization of nil %T", v)
}
var buf bytes.Buffer
if contentLength > 0 {
buf.Grow(int(contentLength))
} else {
buf.Grow(512)
}
_, err := buf.ReadFrom(body)
if err != nil {
return err
}
if buf.Len() > 0 {
v.Blob = buf.Bytes()
}
return nil
}
type awsRestjson1_deserializeOpGetMapTile struct {
}
func (*awsRestjson1_deserializeOpGetMapTile) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetMapTile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetMapTile(response, &metadata)
}
output := &GetMapTileOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsGetMapTileOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
err = awsRestjson1_deserializeOpDocumentGetMapTileOutput(output, response.Body, response.ContentLength)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetMapTile(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsGetMapTileOutput(v *GetMapTileOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.CacheControl = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeOpDocumentGetMapTileOutput(v *GetMapTileOutput, body io.ReadCloser, contentLength int64) error {
if v == nil {
return fmt.Errorf("unsupported deserialization of nil %T", v)
}
var buf bytes.Buffer
if contentLength > 0 {
buf.Grow(int(contentLength))
} else {
buf.Grow(512)
}
_, err := buf.ReadFrom(body)
if err != nil {
return err
}
if buf.Len() > 0 {
v.Blob = buf.Bytes()
}
return nil
}
type awsRestjson1_deserializeOpGetPlace struct {
}
func (*awsRestjson1_deserializeOpGetPlace) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetPlace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetPlace(response, &metadata)
}
output := &GetPlaceOutput{}
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_deserializeOpDocumentGetPlaceOutput(&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_deserializeOpErrorGetPlace(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetPlaceOutput(v **GetPlaceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetPlaceOutput
if *v == nil {
sv = &GetPlaceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Place":
if err := awsRestjson1_deserializeDocumentPlace(&sv.Place, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListDevicePositions struct {
}
func (*awsRestjson1_deserializeOpListDevicePositions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListDevicePositions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListDevicePositions(response, &metadata)
}
output := &ListDevicePositionsOutput{}
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_deserializeOpDocumentListDevicePositionsOutput(&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_deserializeOpErrorListDevicePositions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListDevicePositionsOutput(v **ListDevicePositionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDevicePositionsOutput
if *v == nil {
sv = &ListDevicePositionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entries":
if err := awsRestjson1_deserializeDocumentListDevicePositionsResponseEntryList(&sv.Entries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListGeofenceCollections struct {
}
func (*awsRestjson1_deserializeOpListGeofenceCollections) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListGeofenceCollections) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListGeofenceCollections(response, &metadata)
}
output := &ListGeofenceCollectionsOutput{}
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_deserializeOpDocumentListGeofenceCollectionsOutput(&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_deserializeOpErrorListGeofenceCollections(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListGeofenceCollectionsOutput(v **ListGeofenceCollectionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListGeofenceCollectionsOutput
if *v == nil {
sv = &ListGeofenceCollectionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entries":
if err := awsRestjson1_deserializeDocumentListGeofenceCollectionsResponseEntryList(&sv.Entries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListGeofences struct {
}
func (*awsRestjson1_deserializeOpListGeofences) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListGeofences) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListGeofences(response, &metadata)
}
output := &ListGeofencesOutput{}
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_deserializeOpDocumentListGeofencesOutput(&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_deserializeOpErrorListGeofences(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListGeofencesOutput(v **ListGeofencesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListGeofencesOutput
if *v == nil {
sv = &ListGeofencesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entries":
if err := awsRestjson1_deserializeDocumentListGeofenceResponseEntryList(&sv.Entries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListKeys struct {
}
func (*awsRestjson1_deserializeOpListKeys) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListKeys(response, &metadata)
}
output := &ListKeysOutput{}
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_deserializeOpDocumentListKeysOutput(&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_deserializeOpErrorListKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListKeysOutput(v **ListKeysOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListKeysOutput
if *v == nil {
sv = &ListKeysOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entries":
if err := awsRestjson1_deserializeDocumentListKeysResponseEntryList(&sv.Entries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListMaps struct {
}
func (*awsRestjson1_deserializeOpListMaps) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListMaps) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListMaps(response, &metadata)
}
output := &ListMapsOutput{}
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_deserializeOpDocumentListMapsOutput(&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_deserializeOpErrorListMaps(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListMapsOutput(v **ListMapsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListMapsOutput
if *v == nil {
sv = &ListMapsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entries":
if err := awsRestjson1_deserializeDocumentListMapsResponseEntryList(&sv.Entries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListPlaceIndexes struct {
}
func (*awsRestjson1_deserializeOpListPlaceIndexes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListPlaceIndexes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListPlaceIndexes(response, &metadata)
}
output := &ListPlaceIndexesOutput{}
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_deserializeOpDocumentListPlaceIndexesOutput(&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_deserializeOpErrorListPlaceIndexes(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListPlaceIndexesOutput(v **ListPlaceIndexesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListPlaceIndexesOutput
if *v == nil {
sv = &ListPlaceIndexesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entries":
if err := awsRestjson1_deserializeDocumentListPlaceIndexesResponseEntryList(&sv.Entries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListRouteCalculators struct {
}
func (*awsRestjson1_deserializeOpListRouteCalculators) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListRouteCalculators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListRouteCalculators(response, &metadata)
}
output := &ListRouteCalculatorsOutput{}
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_deserializeOpDocumentListRouteCalculatorsOutput(&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_deserializeOpErrorListRouteCalculators(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListRouteCalculatorsOutput(v **ListRouteCalculatorsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRouteCalculatorsOutput
if *v == nil {
sv = &ListRouteCalculatorsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entries":
if err := awsRestjson1_deserializeDocumentListRouteCalculatorsResponseEntryList(&sv.Entries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTagsForResource struct {
}
func (*awsRestjson1_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTrackerConsumers struct {
}
func (*awsRestjson1_deserializeOpListTrackerConsumers) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTrackerConsumers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListTrackerConsumers(response, &metadata)
}
output := &ListTrackerConsumersOutput{}
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_deserializeOpDocumentListTrackerConsumersOutput(&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_deserializeOpErrorListTrackerConsumers(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListTrackerConsumersOutput(v **ListTrackerConsumersOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTrackerConsumersOutput
if *v == nil {
sv = &ListTrackerConsumersOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConsumerArns":
if err := awsRestjson1_deserializeDocumentArnList(&sv.ConsumerArns, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTrackers struct {
}
func (*awsRestjson1_deserializeOpListTrackers) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTrackers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListTrackers(response, &metadata)
}
output := &ListTrackersOutput{}
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_deserializeOpDocumentListTrackersOutput(&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_deserializeOpErrorListTrackers(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListTrackersOutput(v **ListTrackersOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTrackersOutput
if *v == nil {
sv = &ListTrackersOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Entries":
if err := awsRestjson1_deserializeDocumentListTrackersResponseEntryList(&sv.Entries, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutGeofence struct {
}
func (*awsRestjson1_deserializeOpPutGeofence) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutGeofence) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutGeofence(response, &metadata)
}
output := &PutGeofenceOutput{}
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_deserializeOpDocumentPutGeofenceOutput(&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_deserializeOpErrorPutGeofence(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(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("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutGeofenceOutput(v **PutGeofenceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutGeofenceOutput
if *v == nil {
sv = &PutGeofenceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "GeofenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.GeofenceId = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpSearchPlaceIndexForPosition struct {
}
func (*awsRestjson1_deserializeOpSearchPlaceIndexForPosition) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpSearchPlaceIndexForPosition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorSearchPlaceIndexForPosition(response, &metadata)
}
output := &SearchPlaceIndexForPositionOutput{}
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_deserializeOpDocumentSearchPlaceIndexForPositionOutput(&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_deserializeOpErrorSearchPlaceIndexForPosition(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentSearchPlaceIndexForPositionOutput(v **SearchPlaceIndexForPositionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SearchPlaceIndexForPositionOutput
if *v == nil {
sv = &SearchPlaceIndexForPositionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Results":
if err := awsRestjson1_deserializeDocumentSearchForPositionResultList(&sv.Results, value); err != nil {
return err
}
case "Summary":
if err := awsRestjson1_deserializeDocumentSearchPlaceIndexForPositionSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpSearchPlaceIndexForSuggestions struct {
}
func (*awsRestjson1_deserializeOpSearchPlaceIndexForSuggestions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpSearchPlaceIndexForSuggestions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorSearchPlaceIndexForSuggestions(response, &metadata)
}
output := &SearchPlaceIndexForSuggestionsOutput{}
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_deserializeOpDocumentSearchPlaceIndexForSuggestionsOutput(&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_deserializeOpErrorSearchPlaceIndexForSuggestions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentSearchPlaceIndexForSuggestionsOutput(v **SearchPlaceIndexForSuggestionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SearchPlaceIndexForSuggestionsOutput
if *v == nil {
sv = &SearchPlaceIndexForSuggestionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Results":
if err := awsRestjson1_deserializeDocumentSearchForSuggestionsResultList(&sv.Results, value); err != nil {
return err
}
case "Summary":
if err := awsRestjson1_deserializeDocumentSearchPlaceIndexForSuggestionsSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpSearchPlaceIndexForText struct {
}
func (*awsRestjson1_deserializeOpSearchPlaceIndexForText) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpSearchPlaceIndexForText) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorSearchPlaceIndexForText(response, &metadata)
}
output := &SearchPlaceIndexForTextOutput{}
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_deserializeOpDocumentSearchPlaceIndexForTextOutput(&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_deserializeOpErrorSearchPlaceIndexForText(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentSearchPlaceIndexForTextOutput(v **SearchPlaceIndexForTextOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SearchPlaceIndexForTextOutput
if *v == nil {
sv = &SearchPlaceIndexForTextOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Results":
if err := awsRestjson1_deserializeDocumentSearchForTextResultList(&sv.Results, value); err != nil {
return err
}
case "Summary":
if err := awsRestjson1_deserializeDocumentSearchPlaceIndexForTextSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpTagResource struct {
}
func (*awsRestjson1_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUntagResource struct {
}
func (*awsRestjson1_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateGeofenceCollection struct {
}
func (*awsRestjson1_deserializeOpUpdateGeofenceCollection) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateGeofenceCollection) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateGeofenceCollection(response, &metadata)
}
output := &UpdateGeofenceCollectionOutput{}
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_deserializeOpDocumentUpdateGeofenceCollectionOutput(&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_deserializeOpErrorUpdateGeofenceCollection(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateGeofenceCollectionOutput(v **UpdateGeofenceCollectionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateGeofenceCollectionOutput
if *v == nil {
sv = &UpdateGeofenceCollectionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CollectionArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.CollectionArn = ptr.String(jtv)
}
case "CollectionName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.CollectionName = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateKey struct {
}
func (*awsRestjson1_deserializeOpUpdateKey) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateKey(response, &metadata)
}
output := &UpdateKeyOutput{}
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_deserializeOpDocumentUpdateKeyOutput(&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_deserializeOpErrorUpdateKey(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateKeyOutput(v **UpdateKeyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateKeyOutput
if *v == nil {
sv = &UpdateKeyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "KeyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.KeyArn = ptr.String(jtv)
}
case "KeyName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.KeyName = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateMap struct {
}
func (*awsRestjson1_deserializeOpUpdateMap) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateMap) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateMap(response, &metadata)
}
output := &UpdateMapOutput{}
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_deserializeOpDocumentUpdateMapOutput(&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_deserializeOpErrorUpdateMap(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateMapOutput(v **UpdateMapOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateMapOutput
if *v == nil {
sv = &UpdateMapOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MapArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoArn to be of type string, got %T instead", value)
}
sv.MapArn = ptr.String(jtv)
}
case "MapName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.MapName = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdatePlaceIndex struct {
}
func (*awsRestjson1_deserializeOpUpdatePlaceIndex) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdatePlaceIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdatePlaceIndex(response, &metadata)
}
output := &UpdatePlaceIndexOutput{}
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_deserializeOpDocumentUpdatePlaceIndexOutput(&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_deserializeOpErrorUpdatePlaceIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdatePlaceIndexOutput(v **UpdatePlaceIndexOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdatePlaceIndexOutput
if *v == nil {
sv = &UpdatePlaceIndexOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IndexArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoArn to be of type string, got %T instead", value)
}
sv.IndexArn = ptr.String(jtv)
}
case "IndexName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.IndexName = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateRouteCalculator struct {
}
func (*awsRestjson1_deserializeOpUpdateRouteCalculator) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateRouteCalculator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateRouteCalculator(response, &metadata)
}
output := &UpdateRouteCalculatorOutput{}
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_deserializeOpDocumentUpdateRouteCalculatorOutput(&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_deserializeOpErrorUpdateRouteCalculator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateRouteCalculatorOutput(v **UpdateRouteCalculatorOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateRouteCalculatorOutput
if *v == nil {
sv = &UpdateRouteCalculatorOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CalculatorArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeoArn to be of type string, got %T instead", value)
}
sv.CalculatorArn = ptr.String(jtv)
}
case "CalculatorName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.CalculatorName = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateTracker struct {
}
func (*awsRestjson1_deserializeOpUpdateTracker) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateTracker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateTracker(response, &metadata)
}
output := &UpdateTrackerOutput{}
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_deserializeOpDocumentUpdateTrackerOutput(&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_deserializeOpErrorUpdateTracker(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateTrackerOutput(v **UpdateTrackerOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateTrackerOutput
if *v == nil {
sv = &UpdateTrackerOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TrackerArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.TrackerArn = ptr.String(jtv)
}
case "TrackerName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.TrackerName = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ThrottlingException{}
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_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 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 String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentApiKeyActionList(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 ApiKeyAction to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentApiKeyRestrictions(v **types.ApiKeyRestrictions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ApiKeyRestrictions
if *v == nil {
sv = &types.ApiKeyRestrictions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AllowActions":
if err := awsRestjson1_deserializeDocumentApiKeyActionList(&sv.AllowActions, value); err != nil {
return err
}
case "AllowReferers":
if err := awsRestjson1_deserializeDocumentRefererPatternList(&sv.AllowReferers, value); err != nil {
return err
}
case "AllowResources":
if err := awsRestjson1_deserializeDocumentGeoArnList(&sv.AllowResources, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentArnList(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 Arn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBatchDeleteDevicePositionHistoryError(v **types.BatchDeleteDevicePositionHistoryError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BatchDeleteDevicePositionHistoryError
if *v == nil {
sv = &types.BatchDeleteDevicePositionHistoryError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeviceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.DeviceId = ptr.String(jtv)
}
case "Error":
if err := awsRestjson1_deserializeDocumentBatchItemError(&sv.Error, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBatchDeleteDevicePositionHistoryErrorList(v *[]types.BatchDeleteDevicePositionHistoryError, 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.BatchDeleteDevicePositionHistoryError
if *v == nil {
cv = []types.BatchDeleteDevicePositionHistoryError{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BatchDeleteDevicePositionHistoryError
destAddr := &col
if err := awsRestjson1_deserializeDocumentBatchDeleteDevicePositionHistoryError(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBatchDeleteGeofenceError(v **types.BatchDeleteGeofenceError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BatchDeleteGeofenceError
if *v == nil {
sv = &types.BatchDeleteGeofenceError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Error":
if err := awsRestjson1_deserializeDocumentBatchItemError(&sv.Error, value); err != nil {
return err
}
case "GeofenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.GeofenceId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBatchDeleteGeofenceErrorList(v *[]types.BatchDeleteGeofenceError, 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.BatchDeleteGeofenceError
if *v == nil {
cv = []types.BatchDeleteGeofenceError{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BatchDeleteGeofenceError
destAddr := &col
if err := awsRestjson1_deserializeDocumentBatchDeleteGeofenceError(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBatchEvaluateGeofencesError(v **types.BatchEvaluateGeofencesError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BatchEvaluateGeofencesError
if *v == nil {
sv = &types.BatchEvaluateGeofencesError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeviceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.DeviceId = ptr.String(jtv)
}
case "Error":
if err := awsRestjson1_deserializeDocumentBatchItemError(&sv.Error, value); err != nil {
return err
}
case "SampleTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.SampleTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBatchEvaluateGeofencesErrorList(v *[]types.BatchEvaluateGeofencesError, 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.BatchEvaluateGeofencesError
if *v == nil {
cv = []types.BatchEvaluateGeofencesError{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BatchEvaluateGeofencesError
destAddr := &col
if err := awsRestjson1_deserializeDocumentBatchEvaluateGeofencesError(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBatchGetDevicePositionError(v **types.BatchGetDevicePositionError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BatchGetDevicePositionError
if *v == nil {
sv = &types.BatchGetDevicePositionError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeviceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.DeviceId = ptr.String(jtv)
}
case "Error":
if err := awsRestjson1_deserializeDocumentBatchItemError(&sv.Error, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBatchGetDevicePositionErrorList(v *[]types.BatchGetDevicePositionError, 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.BatchGetDevicePositionError
if *v == nil {
cv = []types.BatchGetDevicePositionError{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BatchGetDevicePositionError
destAddr := &col
if err := awsRestjson1_deserializeDocumentBatchGetDevicePositionError(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBatchItemError(v **types.BatchItemError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BatchItemError
if *v == nil {
sv = &types.BatchItemError{}
} 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 BatchItemErrorCode to be of type string, got %T instead", value)
}
sv.Code = types.BatchItemErrorCode(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBatchPutGeofenceError(v **types.BatchPutGeofenceError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BatchPutGeofenceError
if *v == nil {
sv = &types.BatchPutGeofenceError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Error":
if err := awsRestjson1_deserializeDocumentBatchItemError(&sv.Error, value); err != nil {
return err
}
case "GeofenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.GeofenceId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBatchPutGeofenceErrorList(v *[]types.BatchPutGeofenceError, 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.BatchPutGeofenceError
if *v == nil {
cv = []types.BatchPutGeofenceError{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BatchPutGeofenceError
destAddr := &col
if err := awsRestjson1_deserializeDocumentBatchPutGeofenceError(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBatchPutGeofenceSuccess(v **types.BatchPutGeofenceSuccess, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BatchPutGeofenceSuccess
if *v == nil {
sv = &types.BatchPutGeofenceSuccess{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "GeofenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.GeofenceId = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBatchPutGeofenceSuccessList(v *[]types.BatchPutGeofenceSuccess, 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.BatchPutGeofenceSuccess
if *v == nil {
cv = []types.BatchPutGeofenceSuccess{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BatchPutGeofenceSuccess
destAddr := &col
if err := awsRestjson1_deserializeDocumentBatchPutGeofenceSuccess(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBatchUpdateDevicePositionError(v **types.BatchUpdateDevicePositionError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BatchUpdateDevicePositionError
if *v == nil {
sv = &types.BatchUpdateDevicePositionError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeviceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.DeviceId = ptr.String(jtv)
}
case "Error":
if err := awsRestjson1_deserializeDocumentBatchItemError(&sv.Error, value); err != nil {
return err
}
case "SampleTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.SampleTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBatchUpdateDevicePositionErrorList(v *[]types.BatchUpdateDevicePositionError, 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.BatchUpdateDevicePositionError
if *v == nil {
cv = []types.BatchUpdateDevicePositionError{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BatchUpdateDevicePositionError
destAddr := &col
if err := awsRestjson1_deserializeDocumentBatchUpdateDevicePositionError(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBoundingBox(v *[]float64, 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 []float64
if *v == nil {
cv = []float64{}
} else {
cv = *v
}
for _, value := range shape {
var col float64
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
col = 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)
}
col = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentCalculateRouteMatrixSummary(v **types.CalculateRouteMatrixSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CalculateRouteMatrixSummary
if *v == nil {
sv = &types.CalculateRouteMatrixSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "DistanceUnit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DistanceUnit to be of type string, got %T instead", value)
}
sv.DistanceUnit = types.DistanceUnit(jtv)
}
case "ErrorCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ErrorCount = ptr.Int32(int32(i64))
}
case "RouteCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RouteCount = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCalculateRouteSummary(v **types.CalculateRouteSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CalculateRouteSummary
if *v == nil {
sv = &types.CalculateRouteSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "Distance":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Distance = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Distance = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "DistanceUnit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DistanceUnit to be of type string, got %T instead", value)
}
sv.DistanceUnit = types.DistanceUnit(jtv)
}
case "DurationSeconds":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.DurationSeconds = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.DurationSeconds = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "RouteBBox":
if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.RouteBBox, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCircle(v **types.Circle, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Circle
if *v == nil {
sv = &types.Circle{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Center":
if err := awsRestjson1_deserializeDocumentPosition(&sv.Center, value); err != nil {
return err
}
case "Radius":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Radius = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Radius = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCountryCodeList(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 CountryCode to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDataSourceConfiguration(v **types.DataSourceConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataSourceConfiguration
if *v == nil {
sv = &types.DataSourceConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IntendedUse":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntendedUse to be of type string, got %T instead", value)
}
sv.IntendedUse = types.IntendedUse(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDevicePosition(v **types.DevicePosition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DevicePosition
if *v == nil {
sv = &types.DevicePosition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Accuracy":
if err := awsRestjson1_deserializeDocumentPositionalAccuracy(&sv.Accuracy, value); err != nil {
return err
}
case "DeviceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.DeviceId = ptr.String(jtv)
}
case "Position":
if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil {
return err
}
case "PositionProperties":
if err := awsRestjson1_deserializeDocumentPropertyMap(&sv.PositionProperties, value); err != nil {
return err
}
case "ReceivedTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.ReceivedTime = ptr.Time(t)
}
case "SampleTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.SampleTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDevicePositionList(v *[]types.DevicePosition, 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.DevicePosition
if *v == nil {
cv = []types.DevicePosition{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DevicePosition
destAddr := &col
if err := awsRestjson1_deserializeDocumentDevicePosition(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentFilterPlaceCategoryList(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 PlaceCategory to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentGeoArnList(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 GeoArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentGeofenceGeometry(v **types.GeofenceGeometry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.GeofenceGeometry
if *v == nil {
sv = &types.GeofenceGeometry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Circle":
if err := awsRestjson1_deserializeDocumentCircle(&sv.Circle, value); err != nil {
return err
}
case "Polygon":
if err := awsRestjson1_deserializeDocumentLinearRings(&sv.Polygon, value); err != nil {
return err
}
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 String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLeg(v **types.Leg, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Leg
if *v == nil {
sv = &types.Leg{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Distance":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Distance = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Distance = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "DurationSeconds":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.DurationSeconds = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.DurationSeconds = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "EndPosition":
if err := awsRestjson1_deserializeDocumentPosition(&sv.EndPosition, value); err != nil {
return err
}
case "Geometry":
if err := awsRestjson1_deserializeDocumentLegGeometry(&sv.Geometry, value); err != nil {
return err
}
case "StartPosition":
if err := awsRestjson1_deserializeDocumentPosition(&sv.StartPosition, value); err != nil {
return err
}
case "Steps":
if err := awsRestjson1_deserializeDocumentStepList(&sv.Steps, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLegGeometry(v **types.LegGeometry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LegGeometry
if *v == nil {
sv = &types.LegGeometry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LineString":
if err := awsRestjson1_deserializeDocumentLineString(&sv.LineString, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLegList(v *[]types.Leg, 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.Leg
if *v == nil {
cv = []types.Leg{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Leg
destAddr := &col
if err := awsRestjson1_deserializeDocumentLeg(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLinearRing(v *[][]float64, 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 [][]float64
if *v == nil {
cv = [][]float64{}
} else {
cv = *v
}
for _, value := range shape {
var col []float64
if err := awsRestjson1_deserializeDocumentPosition(&col, value); err != nil {
return err
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLinearRings(v *[][][]float64, 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 [][][]float64
if *v == nil {
cv = [][][]float64{}
} else {
cv = *v
}
for _, value := range shape {
var col [][]float64
if err := awsRestjson1_deserializeDocumentLinearRing(&col, value); err != nil {
return err
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLineString(v *[][]float64, 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 [][]float64
if *v == nil {
cv = [][]float64{}
} else {
cv = *v
}
for _, value := range shape {
var col []float64
if err := awsRestjson1_deserializeDocumentPosition(&col, value); err != nil {
return err
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListDevicePositionsResponseEntry(v **types.ListDevicePositionsResponseEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ListDevicePositionsResponseEntry
if *v == nil {
sv = &types.ListDevicePositionsResponseEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Accuracy":
if err := awsRestjson1_deserializeDocumentPositionalAccuracy(&sv.Accuracy, value); err != nil {
return err
}
case "DeviceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.DeviceId = ptr.String(jtv)
}
case "Position":
if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil {
return err
}
case "PositionProperties":
if err := awsRestjson1_deserializeDocumentPropertyMap(&sv.PositionProperties, value); err != nil {
return err
}
case "SampleTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.SampleTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListDevicePositionsResponseEntryList(v *[]types.ListDevicePositionsResponseEntry, 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.ListDevicePositionsResponseEntry
if *v == nil {
cv = []types.ListDevicePositionsResponseEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ListDevicePositionsResponseEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentListDevicePositionsResponseEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListGeofenceCollectionsResponseEntry(v **types.ListGeofenceCollectionsResponseEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ListGeofenceCollectionsResponseEntry
if *v == nil {
sv = &types.ListGeofenceCollectionsResponseEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CollectionName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.CollectionName = ptr.String(jtv)
}
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "PricingPlanDataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PricingPlanDataSource = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListGeofenceCollectionsResponseEntryList(v *[]types.ListGeofenceCollectionsResponseEntry, 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.ListGeofenceCollectionsResponseEntry
if *v == nil {
cv = []types.ListGeofenceCollectionsResponseEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ListGeofenceCollectionsResponseEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentListGeofenceCollectionsResponseEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListGeofenceResponseEntry(v **types.ListGeofenceResponseEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ListGeofenceResponseEntry
if *v == nil {
sv = &types.ListGeofenceResponseEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "GeofenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.GeofenceId = ptr.String(jtv)
}
case "GeofenceProperties":
if err := awsRestjson1_deserializeDocumentPropertyMap(&sv.GeofenceProperties, value); err != nil {
return err
}
case "Geometry":
if err := awsRestjson1_deserializeDocumentGeofenceGeometry(&sv.Geometry, 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 "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListGeofenceResponseEntryList(v *[]types.ListGeofenceResponseEntry, 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.ListGeofenceResponseEntry
if *v == nil {
cv = []types.ListGeofenceResponseEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ListGeofenceResponseEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentListGeofenceResponseEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListKeysResponseEntry(v **types.ListKeysResponseEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ListKeysResponseEntry
if *v == nil {
sv = &types.ListKeysResponseEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "ExpireTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.ExpireTime = ptr.Time(t)
}
case "KeyName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.KeyName = ptr.String(jtv)
}
case "Restrictions":
if err := awsRestjson1_deserializeDocumentApiKeyRestrictions(&sv.Restrictions, value); err != nil {
return err
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListKeysResponseEntryList(v *[]types.ListKeysResponseEntry, 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.ListKeysResponseEntry
if *v == nil {
cv = []types.ListKeysResponseEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ListKeysResponseEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentListKeysResponseEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListMapsResponseEntry(v **types.ListMapsResponseEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ListMapsResponseEntry
if *v == nil {
sv = &types.ListMapsResponseEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "MapName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.MapName = ptr.String(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListMapsResponseEntryList(v *[]types.ListMapsResponseEntry, 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.ListMapsResponseEntry
if *v == nil {
cv = []types.ListMapsResponseEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ListMapsResponseEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentListMapsResponseEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListPlaceIndexesResponseEntry(v **types.ListPlaceIndexesResponseEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ListPlaceIndexesResponseEntry
if *v == nil {
sv = &types.ListPlaceIndexesResponseEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "IndexName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.IndexName = ptr.String(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListPlaceIndexesResponseEntryList(v *[]types.ListPlaceIndexesResponseEntry, 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.ListPlaceIndexesResponseEntry
if *v == nil {
cv = []types.ListPlaceIndexesResponseEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ListPlaceIndexesResponseEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentListPlaceIndexesResponseEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListRouteCalculatorsResponseEntry(v **types.ListRouteCalculatorsResponseEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ListRouteCalculatorsResponseEntry
if *v == nil {
sv = &types.ListRouteCalculatorsResponseEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CalculatorName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.CalculatorName = ptr.String(jtv)
}
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListRouteCalculatorsResponseEntryList(v *[]types.ListRouteCalculatorsResponseEntry, 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.ListRouteCalculatorsResponseEntry
if *v == nil {
cv = []types.ListRouteCalculatorsResponseEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ListRouteCalculatorsResponseEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentListRouteCalculatorsResponseEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListTrackersResponseEntry(v **types.ListTrackersResponseEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ListTrackersResponseEntry
if *v == nil {
sv = &types.ListTrackersResponseEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreateTime = ptr.Time(t)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "PricingPlan":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PricingPlan to be of type string, got %T instead", value)
}
sv.PricingPlan = types.PricingPlan(jtv)
}
case "PricingPlanDataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PricingPlanDataSource = ptr.String(jtv)
}
case "TrackerName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value)
}
sv.TrackerName = ptr.String(jtv)
}
case "UpdateTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdateTime = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListTrackersResponseEntryList(v *[]types.ListTrackersResponseEntry, 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.ListTrackersResponseEntry
if *v == nil {
cv = []types.ListTrackersResponseEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ListTrackersResponseEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentListTrackersResponseEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMapConfiguration(v **types.MapConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MapConfiguration
if *v == nil {
sv = &types.MapConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "PoliticalView":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CountryCode3 to be of type string, got %T instead", value)
}
sv.PoliticalView = ptr.String(jtv)
}
case "Style":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MapStyle to be of type string, got %T instead", value)
}
sv.Style = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPlace(v **types.Place, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Place
if *v == nil {
sv = &types.Place{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AddressNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.AddressNumber = ptr.String(jtv)
}
case "Categories":
if err := awsRestjson1_deserializeDocumentPlaceCategoryList(&sv.Categories, value); err != nil {
return err
}
case "Country":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Country = ptr.String(jtv)
}
case "Geometry":
if err := awsRestjson1_deserializeDocumentPlaceGeometry(&sv.Geometry, value); err != nil {
return err
}
case "Interpolated":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.Interpolated = ptr.Bool(jtv)
}
case "Label":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Label = ptr.String(jtv)
}
case "Municipality":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Municipality = ptr.String(jtv)
}
case "Neighborhood":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Neighborhood = ptr.String(jtv)
}
case "PostalCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PostalCode = ptr.String(jtv)
}
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 "Street":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Street = ptr.String(jtv)
}
case "SubRegion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SubRegion = ptr.String(jtv)
}
case "SupplementalCategories":
if err := awsRestjson1_deserializeDocumentPlaceSupplementalCategoryList(&sv.SupplementalCategories, value); err != nil {
return err
}
case "TimeZone":
if err := awsRestjson1_deserializeDocumentTimeZone(&sv.TimeZone, value); err != nil {
return err
}
case "UnitNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.UnitNumber = ptr.String(jtv)
}
case "UnitType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.UnitType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPlaceCategoryList(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 PlaceCategory to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentPlaceGeometry(v **types.PlaceGeometry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PlaceGeometry
if *v == nil {
sv = &types.PlaceGeometry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Point":
if err := awsRestjson1_deserializeDocumentPosition(&sv.Point, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPlaceSupplementalCategoryList(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 PlaceSupplementalCategory to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentPosition(v *[]float64, 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 []float64
if *v == nil {
cv = []float64{}
} else {
cv = *v
}
for _, value := range shape {
var col float64
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
col = 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)
}
col = f64
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentPositionalAccuracy(v **types.PositionalAccuracy, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PositionalAccuracy
if *v == nil {
sv = &types.PositionalAccuracy{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Horizontal":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Horizontal = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Horizontal = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPositionList(v *[][]float64, 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 [][]float64
if *v == nil {
cv = [][]float64{}
} else {
cv = *v
}
for _, value := range shape {
var col []float64
if err := awsRestjson1_deserializeDocumentPosition(&col, value); err != nil {
return err
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentPropertyMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentRefererPatternList(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 RefererPattern to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
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 String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRouteMatrix(v *[][]types.RouteMatrixEntry, 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.RouteMatrixEntry
if *v == nil {
cv = [][]types.RouteMatrixEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col []types.RouteMatrixEntry
if err := awsRestjson1_deserializeDocumentRouteMatrixRow(&col, value); err != nil {
return err
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentRouteMatrixEntry(v **types.RouteMatrixEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RouteMatrixEntry
if *v == nil {
sv = &types.RouteMatrixEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Distance":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Distance = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Distance = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "DurationSeconds":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.DurationSeconds = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.DurationSeconds = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Error":
if err := awsRestjson1_deserializeDocumentRouteMatrixEntryError(&sv.Error, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRouteMatrixEntryError(v **types.RouteMatrixEntryError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RouteMatrixEntryError
if *v == nil {
sv = &types.RouteMatrixEntryError{}
} 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 RouteMatrixErrorCode to be of type string, got %T instead", value)
}
sv.Code = types.RouteMatrixErrorCode(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRouteMatrixRow(v *[]types.RouteMatrixEntry, 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.RouteMatrixEntry
if *v == nil {
cv = []types.RouteMatrixEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RouteMatrixEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentRouteMatrixEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSearchForPositionResult(v **types.SearchForPositionResult, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SearchForPositionResult
if *v == nil {
sv = &types.SearchForPositionResult{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Distance":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Distance = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Distance = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Place":
if err := awsRestjson1_deserializeDocumentPlace(&sv.Place, value); err != nil {
return err
}
case "PlaceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlaceId to be of type string, got %T instead", value)
}
sv.PlaceId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSearchForPositionResultList(v *[]types.SearchForPositionResult, 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.SearchForPositionResult
if *v == nil {
cv = []types.SearchForPositionResult{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SearchForPositionResult
destAddr := &col
if err := awsRestjson1_deserializeDocumentSearchForPositionResult(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSearchForSuggestionsResult(v **types.SearchForSuggestionsResult, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SearchForSuggestionsResult
if *v == nil {
sv = &types.SearchForSuggestionsResult{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Categories":
if err := awsRestjson1_deserializeDocumentPlaceCategoryList(&sv.Categories, value); err != nil {
return err
}
case "PlaceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlaceId to be of type string, got %T instead", value)
}
sv.PlaceId = ptr.String(jtv)
}
case "SupplementalCategories":
if err := awsRestjson1_deserializeDocumentPlaceSupplementalCategoryList(&sv.SupplementalCategories, value); err != nil {
return err
}
case "Text":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Text = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSearchForSuggestionsResultList(v *[]types.SearchForSuggestionsResult, 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.SearchForSuggestionsResult
if *v == nil {
cv = []types.SearchForSuggestionsResult{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SearchForSuggestionsResult
destAddr := &col
if err := awsRestjson1_deserializeDocumentSearchForSuggestionsResult(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSearchForTextResult(v **types.SearchForTextResult, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SearchForTextResult
if *v == nil {
sv = &types.SearchForTextResult{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Distance":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Distance = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Distance = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "Place":
if err := awsRestjson1_deserializeDocumentPlace(&sv.Place, value); err != nil {
return err
}
case "PlaceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlaceId to be of type string, got %T instead", value)
}
sv.PlaceId = ptr.String(jtv)
}
case "Relevance":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Relevance = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Relevance = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSearchForTextResultList(v *[]types.SearchForTextResult, 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.SearchForTextResult
if *v == nil {
cv = []types.SearchForTextResult{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SearchForTextResult
destAddr := &col
if err := awsRestjson1_deserializeDocumentSearchForTextResult(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSearchPlaceIndexForPositionSummary(v **types.SearchPlaceIndexForPositionSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SearchPlaceIndexForPositionSummary
if *v == nil {
sv = &types.SearchPlaceIndexForPositionSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "Language":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageTag to be of type string, got %T instead", value)
}
sv.Language = ptr.String(jtv)
}
case "MaxResults":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PlaceIndexSearchResultLimit to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxResults = int32(i64)
}
case "Position":
if err := awsRestjson1_deserializeDocumentPosition(&sv.Position, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSearchPlaceIndexForSuggestionsSummary(v **types.SearchPlaceIndexForSuggestionsSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SearchPlaceIndexForSuggestionsSummary
if *v == nil {
sv = &types.SearchPlaceIndexForSuggestionsSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BiasPosition":
if err := awsRestjson1_deserializeDocumentPosition(&sv.BiasPosition, value); err != nil {
return err
}
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "FilterBBox":
if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.FilterBBox, value); err != nil {
return err
}
case "FilterCategories":
if err := awsRestjson1_deserializeDocumentFilterPlaceCategoryList(&sv.FilterCategories, value); err != nil {
return err
}
case "FilterCountries":
if err := awsRestjson1_deserializeDocumentCountryCodeList(&sv.FilterCountries, value); err != nil {
return err
}
case "Language":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageTag to be of type string, got %T instead", value)
}
sv.Language = ptr.String(jtv)
}
case "MaxResults":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxResults = ptr.Int32(int32(i64))
}
case "Text":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value)
}
sv.Text = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSearchPlaceIndexForTextSummary(v **types.SearchPlaceIndexForTextSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SearchPlaceIndexForTextSummary
if *v == nil {
sv = &types.SearchPlaceIndexForTextSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BiasPosition":
if err := awsRestjson1_deserializeDocumentPosition(&sv.BiasPosition, value); err != nil {
return err
}
case "DataSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.DataSource = ptr.String(jtv)
}
case "FilterBBox":
if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.FilterBBox, value); err != nil {
return err
}
case "FilterCategories":
if err := awsRestjson1_deserializeDocumentFilterPlaceCategoryList(&sv.FilterCategories, value); err != nil {
return err
}
case "FilterCountries":
if err := awsRestjson1_deserializeDocumentCountryCodeList(&sv.FilterCountries, value); err != nil {
return err
}
case "Language":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LanguageTag to be of type string, got %T instead", value)
}
sv.Language = ptr.String(jtv)
}
case "MaxResults":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PlaceIndexSearchResultLimit to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxResults = int32(i64)
}
case "ResultBBox":
if err := awsRestjson1_deserializeDocumentBoundingBox(&sv.ResultBBox, value); err != nil {
return err
}
case "Text":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value)
}
sv.Text = 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 String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentStep(v **types.Step, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Step
if *v == nil {
sv = &types.Step{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Distance":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Distance = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Distance = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "DurationSeconds":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.DurationSeconds = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.DurationSeconds = ptr.Float64(f64)
default:
return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value)
}
}
case "EndPosition":
if err := awsRestjson1_deserializeDocumentPosition(&sv.EndPosition, value); err != nil {
return err
}
case "GeometryOffset":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.GeometryOffset = ptr.Int32(int32(i64))
}
case "StartPosition":
if err := awsRestjson1_deserializeDocumentPosition(&sv.StartPosition, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentStepList(v *[]types.Step, 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.Step
if *v == nil {
cv = []types.Step{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Step
destAddr := &col
if err := awsRestjson1_deserializeDocumentStep(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_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 String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTimeZone(v **types.TimeZone, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TimeZone
if *v == nil {
sv = &types.TimeZone{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Offset":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Offset = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "fieldList":
if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil {
return err
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value)
}
sv.Reason = types.ValidationExceptionReason(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationExceptionField
if *v == nil {
sv = &types.ValidationExceptionField{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, 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.ValidationExceptionField
if *v == nil {
cv = []types.ValidationExceptionField{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ValidationExceptionField
destAddr := &col
if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
| 14,515 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package location provides the API client, operations, and parameter types for
// Amazon Location Service.
//
// "Suite of geospatial services including Maps, Places, Routes, Tracking, and
// Geofencing"
package location
| 9 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
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/location/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 = "geo"
}
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 location
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.24.0"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/location/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"math"
)
type awsRestjson1_serializeOpAssociateTrackerConsumer struct {
}
func (*awsRestjson1_serializeOpAssociateTrackerConsumer) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAssociateTrackerConsumer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateTrackerConsumerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}/consumers")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsAssociateTrackerConsumerInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentAssociateTrackerConsumerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAssociateTrackerConsumerInput(v *AssociateTrackerConsumerInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentAssociateTrackerConsumerInput(v *AssociateTrackerConsumerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConsumerArn != nil {
ok := object.Key("ConsumerArn")
ok.String(*v.ConsumerArn)
}
return nil
}
type awsRestjson1_serializeOpBatchDeleteDevicePositionHistory struct {
}
func (*awsRestjson1_serializeOpBatchDeleteDevicePositionHistory) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchDeleteDevicePositionHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchDeleteDevicePositionHistoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}/delete-positions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBatchDeleteDevicePositionHistoryInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchDeleteDevicePositionHistoryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchDeleteDevicePositionHistoryInput(v *BatchDeleteDevicePositionHistoryInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchDeleteDevicePositionHistoryInput(v *BatchDeleteDevicePositionHistoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeviceIds != nil {
ok := object.Key("DeviceIds")
if err := awsRestjson1_serializeDocumentDeviceIdsList(v.DeviceIds, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpBatchDeleteGeofence struct {
}
func (*awsRestjson1_serializeOpBatchDeleteGeofence) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchDeleteGeofence) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchDeleteGeofenceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections/{CollectionName}/delete-geofences")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBatchDeleteGeofenceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchDeleteGeofenceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchDeleteGeofenceInput(v *BatchDeleteGeofenceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CollectionName == nil || len(*v.CollectionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CollectionName must not be empty")}
}
if v.CollectionName != nil {
if err := encoder.SetURI("CollectionName").String(*v.CollectionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchDeleteGeofenceInput(v *BatchDeleteGeofenceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GeofenceIds != nil {
ok := object.Key("GeofenceIds")
if err := awsRestjson1_serializeDocumentIdList(v.GeofenceIds, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpBatchEvaluateGeofences struct {
}
func (*awsRestjson1_serializeOpBatchEvaluateGeofences) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchEvaluateGeofences) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchEvaluateGeofencesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections/{CollectionName}/positions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBatchEvaluateGeofencesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchEvaluateGeofencesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchEvaluateGeofencesInput(v *BatchEvaluateGeofencesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CollectionName == nil || len(*v.CollectionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CollectionName must not be empty")}
}
if v.CollectionName != nil {
if err := encoder.SetURI("CollectionName").String(*v.CollectionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchEvaluateGeofencesInput(v *BatchEvaluateGeofencesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DevicePositionUpdates != nil {
ok := object.Key("DevicePositionUpdates")
if err := awsRestjson1_serializeDocumentDevicePositionUpdateList(v.DevicePositionUpdates, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpBatchGetDevicePosition struct {
}
func (*awsRestjson1_serializeOpBatchGetDevicePosition) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchGetDevicePosition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchGetDevicePositionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}/get-positions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBatchGetDevicePositionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchGetDevicePositionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchGetDevicePositionInput(v *BatchGetDevicePositionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchGetDevicePositionInput(v *BatchGetDevicePositionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeviceIds != nil {
ok := object.Key("DeviceIds")
if err := awsRestjson1_serializeDocumentIdList(v.DeviceIds, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpBatchPutGeofence struct {
}
func (*awsRestjson1_serializeOpBatchPutGeofence) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchPutGeofence) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchPutGeofenceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections/{CollectionName}/put-geofences")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBatchPutGeofenceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchPutGeofenceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchPutGeofenceInput(v *BatchPutGeofenceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CollectionName == nil || len(*v.CollectionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CollectionName must not be empty")}
}
if v.CollectionName != nil {
if err := encoder.SetURI("CollectionName").String(*v.CollectionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchPutGeofenceInput(v *BatchPutGeofenceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Entries != nil {
ok := object.Key("Entries")
if err := awsRestjson1_serializeDocumentBatchPutGeofenceRequestEntryList(v.Entries, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpBatchUpdateDevicePosition struct {
}
func (*awsRestjson1_serializeOpBatchUpdateDevicePosition) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchUpdateDevicePosition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchUpdateDevicePositionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}/positions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsBatchUpdateDevicePositionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchUpdateDevicePositionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchUpdateDevicePositionInput(v *BatchUpdateDevicePositionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchUpdateDevicePositionInput(v *BatchUpdateDevicePositionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Updates != nil {
ok := object.Key("Updates")
if err := awsRestjson1_serializeDocumentDevicePositionUpdateList(v.Updates, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCalculateRoute struct {
}
func (*awsRestjson1_serializeOpCalculateRoute) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCalculateRoute) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CalculateRouteInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/routes/v0/calculators/{CalculatorName}/calculate/route")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCalculateRouteInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCalculateRouteInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCalculateRouteInput(v *CalculateRouteInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CalculatorName == nil || len(*v.CalculatorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CalculatorName must not be empty")}
}
if v.CalculatorName != nil {
if err := encoder.SetURI("CalculatorName").String(*v.CalculatorName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCalculateRouteInput(v *CalculateRouteInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CarModeOptions != nil {
ok := object.Key("CarModeOptions")
if err := awsRestjson1_serializeDocumentCalculateRouteCarModeOptions(v.CarModeOptions, ok); err != nil {
return err
}
}
if v.DepartNow != nil {
ok := object.Key("DepartNow")
ok.Boolean(*v.DepartNow)
}
if v.DeparturePosition != nil {
ok := object.Key("DeparturePosition")
if err := awsRestjson1_serializeDocumentPosition(v.DeparturePosition, ok); err != nil {
return err
}
}
if v.DepartureTime != nil {
ok := object.Key("DepartureTime")
ok.String(smithytime.FormatDateTime(*v.DepartureTime))
}
if v.DestinationPosition != nil {
ok := object.Key("DestinationPosition")
if err := awsRestjson1_serializeDocumentPosition(v.DestinationPosition, ok); err != nil {
return err
}
}
if len(v.DistanceUnit) > 0 {
ok := object.Key("DistanceUnit")
ok.String(string(v.DistanceUnit))
}
if v.IncludeLegGeometry != nil {
ok := object.Key("IncludeLegGeometry")
ok.Boolean(*v.IncludeLegGeometry)
}
if len(v.TravelMode) > 0 {
ok := object.Key("TravelMode")
ok.String(string(v.TravelMode))
}
if v.TruckModeOptions != nil {
ok := object.Key("TruckModeOptions")
if err := awsRestjson1_serializeDocumentCalculateRouteTruckModeOptions(v.TruckModeOptions, ok); err != nil {
return err
}
}
if v.WaypointPositions != nil {
ok := object.Key("WaypointPositions")
if err := awsRestjson1_serializeDocumentWaypointPositionList(v.WaypointPositions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCalculateRouteMatrix struct {
}
func (*awsRestjson1_serializeOpCalculateRouteMatrix) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCalculateRouteMatrix) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CalculateRouteMatrixInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/routes/v0/calculators/{CalculatorName}/calculate/route-matrix")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCalculateRouteMatrixInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCalculateRouteMatrixInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCalculateRouteMatrixInput(v *CalculateRouteMatrixInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CalculatorName == nil || len(*v.CalculatorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CalculatorName must not be empty")}
}
if v.CalculatorName != nil {
if err := encoder.SetURI("CalculatorName").String(*v.CalculatorName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCalculateRouteMatrixInput(v *CalculateRouteMatrixInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CarModeOptions != nil {
ok := object.Key("CarModeOptions")
if err := awsRestjson1_serializeDocumentCalculateRouteCarModeOptions(v.CarModeOptions, ok); err != nil {
return err
}
}
if v.DepartNow != nil {
ok := object.Key("DepartNow")
ok.Boolean(*v.DepartNow)
}
if v.DeparturePositions != nil {
ok := object.Key("DeparturePositions")
if err := awsRestjson1_serializeDocumentPositionList(v.DeparturePositions, ok); err != nil {
return err
}
}
if v.DepartureTime != nil {
ok := object.Key("DepartureTime")
ok.String(smithytime.FormatDateTime(*v.DepartureTime))
}
if v.DestinationPositions != nil {
ok := object.Key("DestinationPositions")
if err := awsRestjson1_serializeDocumentPositionList(v.DestinationPositions, ok); err != nil {
return err
}
}
if len(v.DistanceUnit) > 0 {
ok := object.Key("DistanceUnit")
ok.String(string(v.DistanceUnit))
}
if len(v.TravelMode) > 0 {
ok := object.Key("TravelMode")
ok.String(string(v.TravelMode))
}
if v.TruckModeOptions != nil {
ok := object.Key("TruckModeOptions")
if err := awsRestjson1_serializeDocumentCalculateRouteTruckModeOptions(v.TruckModeOptions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateGeofenceCollection struct {
}
func (*awsRestjson1_serializeOpCreateGeofenceCollection) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateGeofenceCollection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateGeofenceCollectionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections")
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_serializeOpDocumentCreateGeofenceCollectionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateGeofenceCollectionInput(v *CreateGeofenceCollectionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateGeofenceCollectionInput(v *CreateGeofenceCollectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionName != nil {
ok := object.Key("CollectionName")
ok.String(*v.CollectionName)
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.KmsKeyId != nil {
ok := object.Key("KmsKeyId")
ok.String(*v.KmsKeyId)
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
if v.PricingPlanDataSource != nil {
ok := object.Key("PricingPlanDataSource")
ok.String(*v.PricingPlanDataSource)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateKey struct {
}
func (*awsRestjson1_serializeOpCreateKey) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateKeyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/metadata/v0/keys")
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_serializeOpDocumentCreateKeyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateKeyInput(v *CreateKeyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateKeyInput(v *CreateKeyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.ExpireTime != nil {
ok := object.Key("ExpireTime")
ok.String(smithytime.FormatDateTime(*v.ExpireTime))
}
if v.KeyName != nil {
ok := object.Key("KeyName")
ok.String(*v.KeyName)
}
if v.NoExpiry != nil {
ok := object.Key("NoExpiry")
ok.Boolean(*v.NoExpiry)
}
if v.Restrictions != nil {
ok := object.Key("Restrictions")
if err := awsRestjson1_serializeDocumentApiKeyRestrictions(v.Restrictions, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateMap struct {
}
func (*awsRestjson1_serializeOpCreateMap) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateMap) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateMapInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/maps/v0/maps")
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_serializeOpDocumentCreateMapInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateMapInput(v *CreateMapInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateMapInput(v *CreateMapInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Configuration != nil {
ok := object.Key("Configuration")
if err := awsRestjson1_serializeDocumentMapConfiguration(v.Configuration, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.MapName != nil {
ok := object.Key("MapName")
ok.String(*v.MapName)
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreatePlaceIndex struct {
}
func (*awsRestjson1_serializeOpCreatePlaceIndex) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreatePlaceIndex) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreatePlaceIndexInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/places/v0/indexes")
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_serializeOpDocumentCreatePlaceIndexInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreatePlaceIndexInput(v *CreatePlaceIndexInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreatePlaceIndexInput(v *CreatePlaceIndexInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataSource != nil {
ok := object.Key("DataSource")
ok.String(*v.DataSource)
}
if v.DataSourceConfiguration != nil {
ok := object.Key("DataSourceConfiguration")
if err := awsRestjson1_serializeDocumentDataSourceConfiguration(v.DataSourceConfiguration, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.IndexName != nil {
ok := object.Key("IndexName")
ok.String(*v.IndexName)
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateRouteCalculator struct {
}
func (*awsRestjson1_serializeOpCreateRouteCalculator) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateRouteCalculator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateRouteCalculatorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/routes/v0/calculators")
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_serializeOpDocumentCreateRouteCalculatorInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateRouteCalculatorInput(v *CreateRouteCalculatorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateRouteCalculatorInput(v *CreateRouteCalculatorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CalculatorName != nil {
ok := object.Key("CalculatorName")
ok.String(*v.CalculatorName)
}
if v.DataSource != nil {
ok := object.Key("DataSource")
ok.String(*v.DataSource)
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateTracker struct {
}
func (*awsRestjson1_serializeOpCreateTracker) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateTracker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateTrackerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers")
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_serializeOpDocumentCreateTrackerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateTrackerInput(v *CreateTrackerInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateTrackerInput(v *CreateTrackerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.KmsKeyId != nil {
ok := object.Key("KmsKeyId")
ok.String(*v.KmsKeyId)
}
if len(v.PositionFiltering) > 0 {
ok := object.Key("PositionFiltering")
ok.String(string(v.PositionFiltering))
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
if v.PricingPlanDataSource != nil {
ok := object.Key("PricingPlanDataSource")
ok.String(*v.PricingPlanDataSource)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.TrackerName != nil {
ok := object.Key("TrackerName")
ok.String(*v.TrackerName)
}
return nil
}
type awsRestjson1_serializeOpDeleteGeofenceCollection struct {
}
func (*awsRestjson1_serializeOpDeleteGeofenceCollection) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteGeofenceCollection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteGeofenceCollectionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections/{CollectionName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteGeofenceCollectionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteGeofenceCollectionInput(v *DeleteGeofenceCollectionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CollectionName == nil || len(*v.CollectionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CollectionName must not be empty")}
}
if v.CollectionName != nil {
if err := encoder.SetURI("CollectionName").String(*v.CollectionName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteKey struct {
}
func (*awsRestjson1_serializeOpDeleteKey) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteKeyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/metadata/v0/keys/{KeyName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteKeyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteKeyInput(v *DeleteKeyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.KeyName == nil || len(*v.KeyName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member KeyName must not be empty")}
}
if v.KeyName != nil {
if err := encoder.SetURI("KeyName").String(*v.KeyName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteMap struct {
}
func (*awsRestjson1_serializeOpDeleteMap) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteMap) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteMapInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/maps/v0/maps/{MapName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteMapInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteMapInput(v *DeleteMapInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MapName == nil || len(*v.MapName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member MapName must not be empty")}
}
if v.MapName != nil {
if err := encoder.SetURI("MapName").String(*v.MapName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeletePlaceIndex struct {
}
func (*awsRestjson1_serializeOpDeletePlaceIndex) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeletePlaceIndex) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeletePlaceIndexInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/places/v0/indexes/{IndexName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeletePlaceIndexInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeletePlaceIndexInput(v *DeletePlaceIndexInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IndexName == nil || len(*v.IndexName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member IndexName must not be empty")}
}
if v.IndexName != nil {
if err := encoder.SetURI("IndexName").String(*v.IndexName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteRouteCalculator struct {
}
func (*awsRestjson1_serializeOpDeleteRouteCalculator) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteRouteCalculator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteRouteCalculatorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/routes/v0/calculators/{CalculatorName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteRouteCalculatorInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteRouteCalculatorInput(v *DeleteRouteCalculatorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CalculatorName == nil || len(*v.CalculatorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CalculatorName must not be empty")}
}
if v.CalculatorName != nil {
if err := encoder.SetURI("CalculatorName").String(*v.CalculatorName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteTracker struct {
}
func (*awsRestjson1_serializeOpDeleteTracker) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteTracker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteTrackerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteTrackerInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteTrackerInput(v *DeleteTrackerInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeGeofenceCollection struct {
}
func (*awsRestjson1_serializeOpDescribeGeofenceCollection) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeGeofenceCollection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeGeofenceCollectionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections/{CollectionName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeGeofenceCollectionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeGeofenceCollectionInput(v *DescribeGeofenceCollectionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CollectionName == nil || len(*v.CollectionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CollectionName must not be empty")}
}
if v.CollectionName != nil {
if err := encoder.SetURI("CollectionName").String(*v.CollectionName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeKey struct {
}
func (*awsRestjson1_serializeOpDescribeKey) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeKeyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/metadata/v0/keys/{KeyName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeKeyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeKeyInput(v *DescribeKeyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.KeyName == nil || len(*v.KeyName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member KeyName must not be empty")}
}
if v.KeyName != nil {
if err := encoder.SetURI("KeyName").String(*v.KeyName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeMap struct {
}
func (*awsRestjson1_serializeOpDescribeMap) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeMap) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeMapInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/maps/v0/maps/{MapName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeMapInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeMapInput(v *DescribeMapInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MapName == nil || len(*v.MapName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member MapName must not be empty")}
}
if v.MapName != nil {
if err := encoder.SetURI("MapName").String(*v.MapName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribePlaceIndex struct {
}
func (*awsRestjson1_serializeOpDescribePlaceIndex) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribePlaceIndex) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribePlaceIndexInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/places/v0/indexes/{IndexName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribePlaceIndexInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribePlaceIndexInput(v *DescribePlaceIndexInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IndexName == nil || len(*v.IndexName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member IndexName must not be empty")}
}
if v.IndexName != nil {
if err := encoder.SetURI("IndexName").String(*v.IndexName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeRouteCalculator struct {
}
func (*awsRestjson1_serializeOpDescribeRouteCalculator) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeRouteCalculator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeRouteCalculatorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/routes/v0/calculators/{CalculatorName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeRouteCalculatorInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeRouteCalculatorInput(v *DescribeRouteCalculatorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CalculatorName == nil || len(*v.CalculatorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CalculatorName must not be empty")}
}
if v.CalculatorName != nil {
if err := encoder.SetURI("CalculatorName").String(*v.CalculatorName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeTracker struct {
}
func (*awsRestjson1_serializeOpDescribeTracker) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeTracker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTrackerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeTrackerInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeTrackerInput(v *DescribeTrackerInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDisassociateTrackerConsumer struct {
}
func (*awsRestjson1_serializeOpDisassociateTrackerConsumer) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDisassociateTrackerConsumer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateTrackerConsumerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}/consumers/{ConsumerArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDisassociateTrackerConsumerInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDisassociateTrackerConsumerInput(v *DisassociateTrackerConsumerInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConsumerArn == nil || len(*v.ConsumerArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConsumerArn must not be empty")}
}
if v.ConsumerArn != nil {
if err := encoder.SetURI("ConsumerArn").String(*v.ConsumerArn); err != nil {
return err
}
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetDevicePosition struct {
}
func (*awsRestjson1_serializeOpGetDevicePosition) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDevicePosition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDevicePositionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}/devices/{DeviceId}/positions/latest")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetDevicePositionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetDevicePositionInput(v *GetDevicePositionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DeviceId == nil || len(*v.DeviceId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")}
}
if v.DeviceId != nil {
if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil {
return err
}
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetDevicePositionHistory struct {
}
func (*awsRestjson1_serializeOpGetDevicePositionHistory) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDevicePositionHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDevicePositionHistoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}/devices/{DeviceId}/list-positions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetDevicePositionHistoryInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentGetDevicePositionHistoryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsGetDevicePositionHistoryInput(v *GetDevicePositionHistoryInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DeviceId == nil || len(*v.DeviceId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")}
}
if v.DeviceId != nil {
if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil {
return err
}
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentGetDevicePositionHistoryInput(v *GetDevicePositionHistoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EndTimeExclusive != nil {
ok := object.Key("EndTimeExclusive")
ok.String(smithytime.FormatDateTime(*v.EndTimeExclusive))
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if v.StartTimeInclusive != nil {
ok := object.Key("StartTimeInclusive")
ok.String(smithytime.FormatDateTime(*v.StartTimeInclusive))
}
return nil
}
type awsRestjson1_serializeOpGetGeofence struct {
}
func (*awsRestjson1_serializeOpGetGeofence) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetGeofence) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetGeofenceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections/{CollectionName}/geofences/{GeofenceId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetGeofenceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetGeofenceInput(v *GetGeofenceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CollectionName == nil || len(*v.CollectionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CollectionName must not be empty")}
}
if v.CollectionName != nil {
if err := encoder.SetURI("CollectionName").String(*v.CollectionName); err != nil {
return err
}
}
if v.GeofenceId == nil || len(*v.GeofenceId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member GeofenceId must not be empty")}
}
if v.GeofenceId != nil {
if err := encoder.SetURI("GeofenceId").String(*v.GeofenceId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetMapGlyphs struct {
}
func (*awsRestjson1_serializeOpGetMapGlyphs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetMapGlyphs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetMapGlyphsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/maps/v0/maps/{MapName}/glyphs/{FontStack}/{FontUnicodeRange}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetMapGlyphsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetMapGlyphsInput(v *GetMapGlyphsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FontStack == nil || len(*v.FontStack) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FontStack must not be empty")}
}
if v.FontStack != nil {
if err := encoder.SetURI("FontStack").String(*v.FontStack); err != nil {
return err
}
}
if v.FontUnicodeRange == nil || len(*v.FontUnicodeRange) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FontUnicodeRange must not be empty")}
}
if v.FontUnicodeRange != nil {
if err := encoder.SetURI("FontUnicodeRange").String(*v.FontUnicodeRange); err != nil {
return err
}
}
if v.Key != nil {
encoder.SetQuery("key").String(*v.Key)
}
if v.MapName == nil || len(*v.MapName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member MapName must not be empty")}
}
if v.MapName != nil {
if err := encoder.SetURI("MapName").String(*v.MapName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetMapSprites struct {
}
func (*awsRestjson1_serializeOpGetMapSprites) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetMapSprites) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetMapSpritesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/maps/v0/maps/{MapName}/sprites/{FileName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetMapSpritesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetMapSpritesInput(v *GetMapSpritesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FileName == nil || len(*v.FileName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FileName must not be empty")}
}
if v.FileName != nil {
if err := encoder.SetURI("FileName").String(*v.FileName); err != nil {
return err
}
}
if v.Key != nil {
encoder.SetQuery("key").String(*v.Key)
}
if v.MapName == nil || len(*v.MapName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member MapName must not be empty")}
}
if v.MapName != nil {
if err := encoder.SetURI("MapName").String(*v.MapName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetMapStyleDescriptor struct {
}
func (*awsRestjson1_serializeOpGetMapStyleDescriptor) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetMapStyleDescriptor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetMapStyleDescriptorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/maps/v0/maps/{MapName}/style-descriptor")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetMapStyleDescriptorInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetMapStyleDescriptorInput(v *GetMapStyleDescriptorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Key != nil {
encoder.SetQuery("key").String(*v.Key)
}
if v.MapName == nil || len(*v.MapName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member MapName must not be empty")}
}
if v.MapName != nil {
if err := encoder.SetURI("MapName").String(*v.MapName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetMapTile struct {
}
func (*awsRestjson1_serializeOpGetMapTile) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetMapTile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetMapTileInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/maps/v0/maps/{MapName}/tiles/{Z}/{X}/{Y}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetMapTileInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetMapTileInput(v *GetMapTileInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Key != nil {
encoder.SetQuery("key").String(*v.Key)
}
if v.MapName == nil || len(*v.MapName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member MapName must not be empty")}
}
if v.MapName != nil {
if err := encoder.SetURI("MapName").String(*v.MapName); err != nil {
return err
}
}
if v.X == nil || len(*v.X) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member X must not be empty")}
}
if v.X != nil {
if err := encoder.SetURI("X").String(*v.X); err != nil {
return err
}
}
if v.Y == nil || len(*v.Y) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Y must not be empty")}
}
if v.Y != nil {
if err := encoder.SetURI("Y").String(*v.Y); err != nil {
return err
}
}
if v.Z == nil || len(*v.Z) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Z must not be empty")}
}
if v.Z != nil {
if err := encoder.SetURI("Z").String(*v.Z); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetPlace struct {
}
func (*awsRestjson1_serializeOpGetPlace) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetPlace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetPlaceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/places/v0/indexes/{IndexName}/places/{PlaceId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetPlaceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetPlaceInput(v *GetPlaceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IndexName == nil || len(*v.IndexName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member IndexName must not be empty")}
}
if v.IndexName != nil {
if err := encoder.SetURI("IndexName").String(*v.IndexName); err != nil {
return err
}
}
if v.Language != nil {
encoder.SetQuery("language").String(*v.Language)
}
if v.PlaceId == nil || len(*v.PlaceId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member PlaceId must not be empty")}
}
if v.PlaceId != nil {
if err := encoder.SetURI("PlaceId").String(*v.PlaceId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListDevicePositions struct {
}
func (*awsRestjson1_serializeOpListDevicePositions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDevicePositions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListDevicePositionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}/list-positions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListDevicePositionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListDevicePositionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListDevicePositionsInput(v *ListDevicePositionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListDevicePositionsInput(v *ListDevicePositionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListGeofenceCollections struct {
}
func (*awsRestjson1_serializeOpListGeofenceCollections) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListGeofenceCollections) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListGeofenceCollectionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/list-collections")
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_serializeOpDocumentListGeofenceCollectionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListGeofenceCollectionsInput(v *ListGeofenceCollectionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListGeofenceCollectionsInput(v *ListGeofenceCollectionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListGeofences struct {
}
func (*awsRestjson1_serializeOpListGeofences) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListGeofences) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListGeofencesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections/{CollectionName}/list-geofences")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListGeofencesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListGeofencesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListGeofencesInput(v *ListGeofencesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CollectionName == nil || len(*v.CollectionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CollectionName must not be empty")}
}
if v.CollectionName != nil {
if err := encoder.SetURI("CollectionName").String(*v.CollectionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListGeofencesInput(v *ListGeofencesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListKeys struct {
}
func (*awsRestjson1_serializeOpListKeys) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListKeys) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListKeysInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/metadata/v0/list-keys")
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_serializeOpDocumentListKeysInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListKeysInput(v *ListKeysInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListKeysInput(v *ListKeysInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filter != nil {
ok := object.Key("Filter")
if err := awsRestjson1_serializeDocumentApiKeyFilter(v.Filter, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListMaps struct {
}
func (*awsRestjson1_serializeOpListMaps) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListMaps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListMapsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/maps/v0/list-maps")
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_serializeOpDocumentListMapsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListMapsInput(v *ListMapsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListMapsInput(v *ListMapsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListPlaceIndexes struct {
}
func (*awsRestjson1_serializeOpListPlaceIndexes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListPlaceIndexes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListPlaceIndexesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/places/v0/list-indexes")
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_serializeOpDocumentListPlaceIndexesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListPlaceIndexesInput(v *ListPlaceIndexesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListPlaceIndexesInput(v *ListPlaceIndexesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListRouteCalculators struct {
}
func (*awsRestjson1_serializeOpListRouteCalculators) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListRouteCalculators) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListRouteCalculatorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/routes/v0/list-calculators")
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_serializeOpDocumentListRouteCalculatorsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListRouteCalculatorsInput(v *ListRouteCalculatorsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListRouteCalculatorsInput(v *ListRouteCalculatorsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListTagsForResource struct {
}
func (*awsRestjson1_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListTrackerConsumers struct {
}
func (*awsRestjson1_serializeOpListTrackerConsumers) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTrackerConsumers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTrackerConsumersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}/list-consumers")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTrackerConsumersInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListTrackerConsumersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListTrackerConsumersInput(v *ListTrackerConsumersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentListTrackerConsumersInput(v *ListTrackerConsumersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListTrackers struct {
}
func (*awsRestjson1_serializeOpListTrackers) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTrackers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTrackersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/list-trackers")
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_serializeOpDocumentListTrackersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListTrackersInput(v *ListTrackersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListTrackersInput(v *ListTrackersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpPutGeofence struct {
}
func (*awsRestjson1_serializeOpPutGeofence) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutGeofence) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutGeofenceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections/{CollectionName}/geofences/{GeofenceId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsPutGeofenceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutGeofenceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutGeofenceInput(v *PutGeofenceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CollectionName == nil || len(*v.CollectionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CollectionName must not be empty")}
}
if v.CollectionName != nil {
if err := encoder.SetURI("CollectionName").String(*v.CollectionName); err != nil {
return err
}
}
if v.GeofenceId == nil || len(*v.GeofenceId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member GeofenceId must not be empty")}
}
if v.GeofenceId != nil {
if err := encoder.SetURI("GeofenceId").String(*v.GeofenceId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutGeofenceInput(v *PutGeofenceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GeofenceProperties != nil {
ok := object.Key("GeofenceProperties")
if err := awsRestjson1_serializeDocumentPropertyMap(v.GeofenceProperties, ok); err != nil {
return err
}
}
if v.Geometry != nil {
ok := object.Key("Geometry")
if err := awsRestjson1_serializeDocumentGeofenceGeometry(v.Geometry, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpSearchPlaceIndexForPosition struct {
}
func (*awsRestjson1_serializeOpSearchPlaceIndexForPosition) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSearchPlaceIndexForPosition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchPlaceIndexForPositionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/places/v0/indexes/{IndexName}/search/position")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsSearchPlaceIndexForPositionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentSearchPlaceIndexForPositionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsSearchPlaceIndexForPositionInput(v *SearchPlaceIndexForPositionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IndexName == nil || len(*v.IndexName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member IndexName must not be empty")}
}
if v.IndexName != nil {
if err := encoder.SetURI("IndexName").String(*v.IndexName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentSearchPlaceIndexForPositionInput(v *SearchPlaceIndexForPositionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Language != nil {
ok := object.Key("Language")
ok.String(*v.Language)
}
if v.MaxResults != 0 {
ok := object.Key("MaxResults")
ok.Integer(v.MaxResults)
}
if v.Position != nil {
ok := object.Key("Position")
if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpSearchPlaceIndexForSuggestions struct {
}
func (*awsRestjson1_serializeOpSearchPlaceIndexForSuggestions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSearchPlaceIndexForSuggestions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchPlaceIndexForSuggestionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/places/v0/indexes/{IndexName}/search/suggestions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsSearchPlaceIndexForSuggestionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentSearchPlaceIndexForSuggestionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsSearchPlaceIndexForSuggestionsInput(v *SearchPlaceIndexForSuggestionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IndexName == nil || len(*v.IndexName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member IndexName must not be empty")}
}
if v.IndexName != nil {
if err := encoder.SetURI("IndexName").String(*v.IndexName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentSearchPlaceIndexForSuggestionsInput(v *SearchPlaceIndexForSuggestionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BiasPosition != nil {
ok := object.Key("BiasPosition")
if err := awsRestjson1_serializeDocumentPosition(v.BiasPosition, ok); err != nil {
return err
}
}
if v.FilterBBox != nil {
ok := object.Key("FilterBBox")
if err := awsRestjson1_serializeDocumentBoundingBox(v.FilterBBox, ok); err != nil {
return err
}
}
if v.FilterCategories != nil {
ok := object.Key("FilterCategories")
if err := awsRestjson1_serializeDocumentFilterPlaceCategoryList(v.FilterCategories, ok); err != nil {
return err
}
}
if v.FilterCountries != nil {
ok := object.Key("FilterCountries")
if err := awsRestjson1_serializeDocumentCountryCodeList(v.FilterCountries, ok); err != nil {
return err
}
}
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.Text != nil {
ok := object.Key("Text")
ok.String(*v.Text)
}
return nil
}
type awsRestjson1_serializeOpSearchPlaceIndexForText struct {
}
func (*awsRestjson1_serializeOpSearchPlaceIndexForText) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSearchPlaceIndexForText) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchPlaceIndexForTextInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/places/v0/indexes/{IndexName}/search/text")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsSearchPlaceIndexForTextInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentSearchPlaceIndexForTextInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsSearchPlaceIndexForTextInput(v *SearchPlaceIndexForTextInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IndexName == nil || len(*v.IndexName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member IndexName must not be empty")}
}
if v.IndexName != nil {
if err := encoder.SetURI("IndexName").String(*v.IndexName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentSearchPlaceIndexForTextInput(v *SearchPlaceIndexForTextInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BiasPosition != nil {
ok := object.Key("BiasPosition")
if err := awsRestjson1_serializeDocumentPosition(v.BiasPosition, ok); err != nil {
return err
}
}
if v.FilterBBox != nil {
ok := object.Key("FilterBBox")
if err := awsRestjson1_serializeDocumentBoundingBox(v.FilterBBox, ok); err != nil {
return err
}
}
if v.FilterCategories != nil {
ok := object.Key("FilterCategories")
if err := awsRestjson1_serializeDocumentFilterPlaceCategoryList(v.FilterCategories, ok); err != nil {
return err
}
}
if v.FilterCountries != nil {
ok := object.Key("FilterCountries")
if err := awsRestjson1_serializeDocumentCountryCodeList(v.FilterCountries, ok); err != nil {
return err
}
}
if v.Language != nil {
ok := object.Key("Language")
ok.String(*v.Language)
}
if v.MaxResults != 0 {
ok := object.Key("MaxResults")
ok.Integer(v.MaxResults)
}
if v.Text != nil {
ok := object.Key("Text")
ok.String(*v.Text)
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUntagResource struct {
}
func (*awsRestjson1_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("tagKeys").String(v.TagKeys[i])
}
}
return nil
}
type awsRestjson1_serializeOpUpdateGeofenceCollection struct {
}
func (*awsRestjson1_serializeOpUpdateGeofenceCollection) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateGeofenceCollection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateGeofenceCollectionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/geofencing/v0/collections/{CollectionName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateGeofenceCollectionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateGeofenceCollectionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateGeofenceCollectionInput(v *UpdateGeofenceCollectionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CollectionName == nil || len(*v.CollectionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CollectionName must not be empty")}
}
if v.CollectionName != nil {
if err := encoder.SetURI("CollectionName").String(*v.CollectionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateGeofenceCollectionInput(v *UpdateGeofenceCollectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
if v.PricingPlanDataSource != nil {
ok := object.Key("PricingPlanDataSource")
ok.String(*v.PricingPlanDataSource)
}
return nil
}
type awsRestjson1_serializeOpUpdateKey struct {
}
func (*awsRestjson1_serializeOpUpdateKey) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateKeyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/metadata/v0/keys/{KeyName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateKeyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateKeyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateKeyInput(v *UpdateKeyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.KeyName == nil || len(*v.KeyName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member KeyName must not be empty")}
}
if v.KeyName != nil {
if err := encoder.SetURI("KeyName").String(*v.KeyName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateKeyInput(v *UpdateKeyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.ExpireTime != nil {
ok := object.Key("ExpireTime")
ok.String(smithytime.FormatDateTime(*v.ExpireTime))
}
if v.ForceUpdate != nil {
ok := object.Key("ForceUpdate")
ok.Boolean(*v.ForceUpdate)
}
if v.NoExpiry != nil {
ok := object.Key("NoExpiry")
ok.Boolean(*v.NoExpiry)
}
if v.Restrictions != nil {
ok := object.Key("Restrictions")
if err := awsRestjson1_serializeDocumentApiKeyRestrictions(v.Restrictions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateMap struct {
}
func (*awsRestjson1_serializeOpUpdateMap) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateMap) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateMapInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/maps/v0/maps/{MapName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateMapInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateMapInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateMapInput(v *UpdateMapInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MapName == nil || len(*v.MapName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member MapName must not be empty")}
}
if v.MapName != nil {
if err := encoder.SetURI("MapName").String(*v.MapName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateMapInput(v *UpdateMapInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConfigurationUpdate != nil {
ok := object.Key("ConfigurationUpdate")
if err := awsRestjson1_serializeDocumentMapConfigurationUpdate(v.ConfigurationUpdate, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
return nil
}
type awsRestjson1_serializeOpUpdatePlaceIndex struct {
}
func (*awsRestjson1_serializeOpUpdatePlaceIndex) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdatePlaceIndex) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdatePlaceIndexInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/places/v0/indexes/{IndexName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdatePlaceIndexInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdatePlaceIndexInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdatePlaceIndexInput(v *UpdatePlaceIndexInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IndexName == nil || len(*v.IndexName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member IndexName must not be empty")}
}
if v.IndexName != nil {
if err := encoder.SetURI("IndexName").String(*v.IndexName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdatePlaceIndexInput(v *UpdatePlaceIndexInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DataSourceConfiguration != nil {
ok := object.Key("DataSourceConfiguration")
if err := awsRestjson1_serializeDocumentDataSourceConfiguration(v.DataSourceConfiguration, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
return nil
}
type awsRestjson1_serializeOpUpdateRouteCalculator struct {
}
func (*awsRestjson1_serializeOpUpdateRouteCalculator) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateRouteCalculator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateRouteCalculatorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/routes/v0/calculators/{CalculatorName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateRouteCalculatorInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateRouteCalculatorInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateRouteCalculatorInput(v *UpdateRouteCalculatorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CalculatorName == nil || len(*v.CalculatorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CalculatorName must not be empty")}
}
if v.CalculatorName != nil {
if err := encoder.SetURI("CalculatorName").String(*v.CalculatorName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateRouteCalculatorInput(v *UpdateRouteCalculatorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
return nil
}
type awsRestjson1_serializeOpUpdateTracker struct {
}
func (*awsRestjson1_serializeOpUpdateTracker) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateTracker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateTrackerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tracking/v0/trackers/{TrackerName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateTrackerInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateTrackerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateTrackerInput(v *UpdateTrackerInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TrackerName == nil || len(*v.TrackerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TrackerName must not be empty")}
}
if v.TrackerName != nil {
if err := encoder.SetURI("TrackerName").String(*v.TrackerName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateTrackerInput(v *UpdateTrackerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if len(v.PositionFiltering) > 0 {
ok := object.Key("PositionFiltering")
ok.String(string(v.PositionFiltering))
}
if len(v.PricingPlan) > 0 {
ok := object.Key("PricingPlan")
ok.String(string(v.PricingPlan))
}
if v.PricingPlanDataSource != nil {
ok := object.Key("PricingPlanDataSource")
ok.String(*v.PricingPlanDataSource)
}
return nil
}
func awsRestjson1_serializeDocumentApiKeyActionList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentApiKeyFilter(v *types.ApiKeyFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.KeyStatus) > 0 {
ok := object.Key("KeyStatus")
ok.String(string(v.KeyStatus))
}
return nil
}
func awsRestjson1_serializeDocumentApiKeyRestrictions(v *types.ApiKeyRestrictions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowActions != nil {
ok := object.Key("AllowActions")
if err := awsRestjson1_serializeDocumentApiKeyActionList(v.AllowActions, ok); err != nil {
return err
}
}
if v.AllowReferers != nil {
ok := object.Key("AllowReferers")
if err := awsRestjson1_serializeDocumentRefererPatternList(v.AllowReferers, ok); err != nil {
return err
}
}
if v.AllowResources != nil {
ok := object.Key("AllowResources")
if err := awsRestjson1_serializeDocumentGeoArnList(v.AllowResources, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBatchPutGeofenceRequestEntry(v *types.BatchPutGeofenceRequestEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GeofenceId != nil {
ok := object.Key("GeofenceId")
ok.String(*v.GeofenceId)
}
if v.GeofenceProperties != nil {
ok := object.Key("GeofenceProperties")
if err := awsRestjson1_serializeDocumentPropertyMap(v.GeofenceProperties, ok); err != nil {
return err
}
}
if v.Geometry != nil {
ok := object.Key("Geometry")
if err := awsRestjson1_serializeDocumentGeofenceGeometry(v.Geometry, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBatchPutGeofenceRequestEntryList(v []types.BatchPutGeofenceRequestEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBatchPutGeofenceRequestEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBoundingBox(v []float64, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
switch {
case math.IsNaN(v[i]):
av.String("NaN")
case math.IsInf(v[i], 1):
av.String("Infinity")
case math.IsInf(v[i], -1):
av.String("-Infinity")
default:
av.Double(v[i])
}
}
return nil
}
func awsRestjson1_serializeDocumentCalculateRouteCarModeOptions(v *types.CalculateRouteCarModeOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AvoidFerries != nil {
ok := object.Key("AvoidFerries")
ok.Boolean(*v.AvoidFerries)
}
if v.AvoidTolls != nil {
ok := object.Key("AvoidTolls")
ok.Boolean(*v.AvoidTolls)
}
return nil
}
func awsRestjson1_serializeDocumentCalculateRouteTruckModeOptions(v *types.CalculateRouteTruckModeOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AvoidFerries != nil {
ok := object.Key("AvoidFerries")
ok.Boolean(*v.AvoidFerries)
}
if v.AvoidTolls != nil {
ok := object.Key("AvoidTolls")
ok.Boolean(*v.AvoidTolls)
}
if v.Dimensions != nil {
ok := object.Key("Dimensions")
if err := awsRestjson1_serializeDocumentTruckDimensions(v.Dimensions, ok); err != nil {
return err
}
}
if v.Weight != nil {
ok := object.Key("Weight")
if err := awsRestjson1_serializeDocumentTruckWeight(v.Weight, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCircle(v *types.Circle, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Center != nil {
ok := object.Key("Center")
if err := awsRestjson1_serializeDocumentPosition(v.Center, ok); err != nil {
return err
}
}
if v.Radius != nil {
ok := object.Key("Radius")
switch {
case math.IsNaN(*v.Radius):
ok.String("NaN")
case math.IsInf(*v.Radius, 1):
ok.String("Infinity")
case math.IsInf(*v.Radius, -1):
ok.String("-Infinity")
default:
ok.Double(*v.Radius)
}
}
return nil
}
func awsRestjson1_serializeDocumentCountryCodeList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentDataSourceConfiguration(v *types.DataSourceConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.IntendedUse) > 0 {
ok := object.Key("IntendedUse")
ok.String(string(v.IntendedUse))
}
return nil
}
func awsRestjson1_serializeDocumentDeviceIdsList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentDevicePositionUpdate(v *types.DevicePositionUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Accuracy != nil {
ok := object.Key("Accuracy")
if err := awsRestjson1_serializeDocumentPositionalAccuracy(v.Accuracy, ok); err != nil {
return err
}
}
if v.DeviceId != nil {
ok := object.Key("DeviceId")
ok.String(*v.DeviceId)
}
if v.Position != nil {
ok := object.Key("Position")
if err := awsRestjson1_serializeDocumentPosition(v.Position, ok); err != nil {
return err
}
}
if v.PositionProperties != nil {
ok := object.Key("PositionProperties")
if err := awsRestjson1_serializeDocumentPropertyMap(v.PositionProperties, ok); err != nil {
return err
}
}
if v.SampleTime != nil {
ok := object.Key("SampleTime")
ok.String(smithytime.FormatDateTime(*v.SampleTime))
}
return nil
}
func awsRestjson1_serializeDocumentDevicePositionUpdateList(v []types.DevicePositionUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentDevicePositionUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFilterPlaceCategoryList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentGeoArnList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentGeofenceGeometry(v *types.GeofenceGeometry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Circle != nil {
ok := object.Key("Circle")
if err := awsRestjson1_serializeDocumentCircle(v.Circle, ok); err != nil {
return err
}
}
if v.Polygon != nil {
ok := object.Key("Polygon")
if err := awsRestjson1_serializeDocumentLinearRings(v.Polygon, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIdList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentLinearRing(v [][]float64, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentPosition(v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentLinearRings(v [][][]float64, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentLinearRing(v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMapConfiguration(v *types.MapConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PoliticalView != nil {
ok := object.Key("PoliticalView")
ok.String(*v.PoliticalView)
}
if v.Style != nil {
ok := object.Key("Style")
ok.String(*v.Style)
}
return nil
}
func awsRestjson1_serializeDocumentMapConfigurationUpdate(v *types.MapConfigurationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PoliticalView != nil {
ok := object.Key("PoliticalView")
ok.String(*v.PoliticalView)
}
return nil
}
func awsRestjson1_serializeDocumentPosition(v []float64, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
switch {
case math.IsNaN(v[i]):
av.String("NaN")
case math.IsInf(v[i], 1):
av.String("Infinity")
case math.IsInf(v[i], -1):
av.String("-Infinity")
default:
av.Double(v[i])
}
}
return nil
}
func awsRestjson1_serializeDocumentPositionalAccuracy(v *types.PositionalAccuracy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Horizontal != nil {
ok := object.Key("Horizontal")
switch {
case math.IsNaN(*v.Horizontal):
ok.String("NaN")
case math.IsInf(*v.Horizontal, 1):
ok.String("Infinity")
case math.IsInf(*v.Horizontal, -1):
ok.String("-Infinity")
default:
ok.Double(*v.Horizontal)
}
}
return nil
}
func awsRestjson1_serializeDocumentPositionList(v [][]float64, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentPosition(v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPropertyMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentRefererPatternList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentTruckDimensions(v *types.TruckDimensions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Height != nil {
ok := object.Key("Height")
switch {
case math.IsNaN(*v.Height):
ok.String("NaN")
case math.IsInf(*v.Height, 1):
ok.String("Infinity")
case math.IsInf(*v.Height, -1):
ok.String("-Infinity")
default:
ok.Double(*v.Height)
}
}
if v.Length != nil {
ok := object.Key("Length")
switch {
case math.IsNaN(*v.Length):
ok.String("NaN")
case math.IsInf(*v.Length, 1):
ok.String("Infinity")
case math.IsInf(*v.Length, -1):
ok.String("-Infinity")
default:
ok.Double(*v.Length)
}
}
if len(v.Unit) > 0 {
ok := object.Key("Unit")
ok.String(string(v.Unit))
}
if v.Width != nil {
ok := object.Key("Width")
switch {
case math.IsNaN(*v.Width):
ok.String("NaN")
case math.IsInf(*v.Width, 1):
ok.String("Infinity")
case math.IsInf(*v.Width, -1):
ok.String("-Infinity")
default:
ok.Double(*v.Width)
}
}
return nil
}
func awsRestjson1_serializeDocumentTruckWeight(v *types.TruckWeight, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Total != nil {
ok := object.Key("Total")
switch {
case math.IsNaN(*v.Total):
ok.String("NaN")
case math.IsInf(*v.Total, 1):
ok.String("Infinity")
case math.IsInf(*v.Total, -1):
ok.String("-Infinity")
default:
ok.Double(*v.Total)
}
}
if len(v.Unit) > 0 {
ok := object.Key("Unit")
ok.String(string(v.Unit))
}
return nil
}
func awsRestjson1_serializeDocumentWaypointPositionList(v [][]float64, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentPosition(v[i], av); err != nil {
return err
}
}
return nil
}
| 5,307 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package location
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/location/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAssociateTrackerConsumer struct {
}
func (*validateOpAssociateTrackerConsumer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateTrackerConsumer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateTrackerConsumerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateTrackerConsumerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchDeleteDevicePositionHistory struct {
}
func (*validateOpBatchDeleteDevicePositionHistory) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchDeleteDevicePositionHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchDeleteDevicePositionHistoryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchDeleteDevicePositionHistoryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchDeleteGeofence struct {
}
func (*validateOpBatchDeleteGeofence) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchDeleteGeofence) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchDeleteGeofenceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchDeleteGeofenceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchEvaluateGeofences struct {
}
func (*validateOpBatchEvaluateGeofences) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchEvaluateGeofences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchEvaluateGeofencesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchEvaluateGeofencesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchGetDevicePosition struct {
}
func (*validateOpBatchGetDevicePosition) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchGetDevicePosition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchGetDevicePositionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchGetDevicePositionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchPutGeofence struct {
}
func (*validateOpBatchPutGeofence) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchPutGeofence) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchPutGeofenceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchPutGeofenceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchUpdateDevicePosition struct {
}
func (*validateOpBatchUpdateDevicePosition) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchUpdateDevicePosition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchUpdateDevicePositionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchUpdateDevicePositionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCalculateRoute struct {
}
func (*validateOpCalculateRoute) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCalculateRoute) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CalculateRouteInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCalculateRouteInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCalculateRouteMatrix struct {
}
func (*validateOpCalculateRouteMatrix) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCalculateRouteMatrix) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CalculateRouteMatrixInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCalculateRouteMatrixInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateGeofenceCollection struct {
}
func (*validateOpCreateGeofenceCollection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateGeofenceCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateGeofenceCollectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateGeofenceCollectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateKey struct {
}
func (*validateOpCreateKey) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateKeyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateKeyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateMap struct {
}
func (*validateOpCreateMap) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateMap) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateMapInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateMapInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreatePlaceIndex struct {
}
func (*validateOpCreatePlaceIndex) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreatePlaceIndex) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreatePlaceIndexInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreatePlaceIndexInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateRouteCalculator struct {
}
func (*validateOpCreateRouteCalculator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateRouteCalculator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateRouteCalculatorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateRouteCalculatorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateTracker struct {
}
func (*validateOpCreateTracker) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateTracker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateTrackerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateTrackerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteGeofenceCollection struct {
}
func (*validateOpDeleteGeofenceCollection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteGeofenceCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteGeofenceCollectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteGeofenceCollectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteKey struct {
}
func (*validateOpDeleteKey) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteKeyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteKeyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteMap struct {
}
func (*validateOpDeleteMap) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteMap) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteMapInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteMapInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeletePlaceIndex struct {
}
func (*validateOpDeletePlaceIndex) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeletePlaceIndex) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeletePlaceIndexInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeletePlaceIndexInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteRouteCalculator struct {
}
func (*validateOpDeleteRouteCalculator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteRouteCalculator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteRouteCalculatorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteRouteCalculatorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteTracker struct {
}
func (*validateOpDeleteTracker) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteTracker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteTrackerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteTrackerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeGeofenceCollection struct {
}
func (*validateOpDescribeGeofenceCollection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeGeofenceCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeGeofenceCollectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeGeofenceCollectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeKey struct {
}
func (*validateOpDescribeKey) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeKeyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeKeyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeMap struct {
}
func (*validateOpDescribeMap) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeMap) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeMapInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeMapInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribePlaceIndex struct {
}
func (*validateOpDescribePlaceIndex) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribePlaceIndex) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribePlaceIndexInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribePlaceIndexInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeRouteCalculator struct {
}
func (*validateOpDescribeRouteCalculator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeRouteCalculator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeRouteCalculatorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeRouteCalculatorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeTracker struct {
}
func (*validateOpDescribeTracker) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeTracker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeTrackerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeTrackerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateTrackerConsumer struct {
}
func (*validateOpDisassociateTrackerConsumer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateTrackerConsumer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateTrackerConsumerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateTrackerConsumerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDevicePositionHistory struct {
}
func (*validateOpGetDevicePositionHistory) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDevicePositionHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDevicePositionHistoryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDevicePositionHistoryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDevicePosition struct {
}
func (*validateOpGetDevicePosition) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDevicePosition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDevicePositionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDevicePositionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetGeofence struct {
}
func (*validateOpGetGeofence) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetGeofence) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetGeofenceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetGeofenceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMapGlyphs struct {
}
func (*validateOpGetMapGlyphs) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMapGlyphs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMapGlyphsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMapGlyphsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMapSprites struct {
}
func (*validateOpGetMapSprites) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMapSprites) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMapSpritesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMapSpritesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMapStyleDescriptor struct {
}
func (*validateOpGetMapStyleDescriptor) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMapStyleDescriptor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMapStyleDescriptorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMapStyleDescriptorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMapTile struct {
}
func (*validateOpGetMapTile) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMapTile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMapTileInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMapTileInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetPlace struct {
}
func (*validateOpGetPlace) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetPlace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetPlaceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetPlaceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListDevicePositions struct {
}
func (*validateOpListDevicePositions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListDevicePositions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListDevicePositionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListDevicePositionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListGeofences struct {
}
func (*validateOpListGeofences) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListGeofences) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListGeofencesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListGeofencesInput(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 validateOpListTrackerConsumers struct {
}
func (*validateOpListTrackerConsumers) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTrackerConsumers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTrackerConsumersInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTrackerConsumersInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutGeofence struct {
}
func (*validateOpPutGeofence) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutGeofence) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutGeofenceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutGeofenceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchPlaceIndexForPosition struct {
}
func (*validateOpSearchPlaceIndexForPosition) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchPlaceIndexForPosition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchPlaceIndexForPositionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchPlaceIndexForPositionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchPlaceIndexForSuggestions struct {
}
func (*validateOpSearchPlaceIndexForSuggestions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchPlaceIndexForSuggestions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchPlaceIndexForSuggestionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchPlaceIndexForSuggestionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchPlaceIndexForText struct {
}
func (*validateOpSearchPlaceIndexForText) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchPlaceIndexForText) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchPlaceIndexForTextInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchPlaceIndexForTextInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateGeofenceCollection struct {
}
func (*validateOpUpdateGeofenceCollection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateGeofenceCollection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateGeofenceCollectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateGeofenceCollectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateKey struct {
}
func (*validateOpUpdateKey) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateKeyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateKeyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateMap struct {
}
func (*validateOpUpdateMap) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateMap) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateMapInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateMapInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdatePlaceIndex struct {
}
func (*validateOpUpdatePlaceIndex) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdatePlaceIndex) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdatePlaceIndexInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdatePlaceIndexInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateRouteCalculator struct {
}
func (*validateOpUpdateRouteCalculator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateRouteCalculator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateRouteCalculatorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateRouteCalculatorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateTracker struct {
}
func (*validateOpUpdateTracker) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateTracker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateTrackerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateTrackerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAssociateTrackerConsumerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateTrackerConsumer{}, middleware.After)
}
func addOpBatchDeleteDevicePositionHistoryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchDeleteDevicePositionHistory{}, middleware.After)
}
func addOpBatchDeleteGeofenceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchDeleteGeofence{}, middleware.After)
}
func addOpBatchEvaluateGeofencesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchEvaluateGeofences{}, middleware.After)
}
func addOpBatchGetDevicePositionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchGetDevicePosition{}, middleware.After)
}
func addOpBatchPutGeofenceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchPutGeofence{}, middleware.After)
}
func addOpBatchUpdateDevicePositionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchUpdateDevicePosition{}, middleware.After)
}
func addOpCalculateRouteValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCalculateRoute{}, middleware.After)
}
func addOpCalculateRouteMatrixValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCalculateRouteMatrix{}, middleware.After)
}
func addOpCreateGeofenceCollectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateGeofenceCollection{}, middleware.After)
}
func addOpCreateKeyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateKey{}, middleware.After)
}
func addOpCreateMapValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateMap{}, middleware.After)
}
func addOpCreatePlaceIndexValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreatePlaceIndex{}, middleware.After)
}
func addOpCreateRouteCalculatorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateRouteCalculator{}, middleware.After)
}
func addOpCreateTrackerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateTracker{}, middleware.After)
}
func addOpDeleteGeofenceCollectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteGeofenceCollection{}, middleware.After)
}
func addOpDeleteKeyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteKey{}, middleware.After)
}
func addOpDeleteMapValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteMap{}, middleware.After)
}
func addOpDeletePlaceIndexValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeletePlaceIndex{}, middleware.After)
}
func addOpDeleteRouteCalculatorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteRouteCalculator{}, middleware.After)
}
func addOpDeleteTrackerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteTracker{}, middleware.After)
}
func addOpDescribeGeofenceCollectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeGeofenceCollection{}, middleware.After)
}
func addOpDescribeKeyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeKey{}, middleware.After)
}
func addOpDescribeMapValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeMap{}, middleware.After)
}
func addOpDescribePlaceIndexValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribePlaceIndex{}, middleware.After)
}
func addOpDescribeRouteCalculatorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeRouteCalculator{}, middleware.After)
}
func addOpDescribeTrackerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeTracker{}, middleware.After)
}
func addOpDisassociateTrackerConsumerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateTrackerConsumer{}, middleware.After)
}
func addOpGetDevicePositionHistoryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDevicePositionHistory{}, middleware.After)
}
func addOpGetDevicePositionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDevicePosition{}, middleware.After)
}
func addOpGetGeofenceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetGeofence{}, middleware.After)
}
func addOpGetMapGlyphsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMapGlyphs{}, middleware.After)
}
func addOpGetMapSpritesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMapSprites{}, middleware.After)
}
func addOpGetMapStyleDescriptorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMapStyleDescriptor{}, middleware.After)
}
func addOpGetMapTileValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMapTile{}, middleware.After)
}
func addOpGetPlaceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetPlace{}, middleware.After)
}
func addOpListDevicePositionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListDevicePositions{}, middleware.After)
}
func addOpListGeofencesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListGeofences{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpListTrackerConsumersValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTrackerConsumers{}, middleware.After)
}
func addOpPutGeofenceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutGeofence{}, middleware.After)
}
func addOpSearchPlaceIndexForPositionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchPlaceIndexForPosition{}, middleware.After)
}
func addOpSearchPlaceIndexForSuggestionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchPlaceIndexForSuggestions{}, middleware.After)
}
func addOpSearchPlaceIndexForTextValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchPlaceIndexForText{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateGeofenceCollectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateGeofenceCollection{}, middleware.After)
}
func addOpUpdateKeyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateKey{}, middleware.After)
}
func addOpUpdateMapValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateMap{}, middleware.After)
}
func addOpUpdatePlaceIndexValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdatePlaceIndex{}, middleware.After)
}
func addOpUpdateRouteCalculatorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateRouteCalculator{}, middleware.After)
}
func addOpUpdateTrackerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateTracker{}, middleware.After)
}
func validateApiKeyRestrictions(v *types.ApiKeyRestrictions) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ApiKeyRestrictions"}
if v.AllowActions == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowActions"))
}
if v.AllowResources == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowResources"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBatchPutGeofenceRequestEntry(v *types.BatchPutGeofenceRequestEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchPutGeofenceRequestEntry"}
if v.GeofenceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GeofenceId"))
}
if v.Geometry == nil {
invalidParams.Add(smithy.NewErrParamRequired("Geometry"))
} else if v.Geometry != nil {
if err := validateGeofenceGeometry(v.Geometry); err != nil {
invalidParams.AddNested("Geometry", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBatchPutGeofenceRequestEntryList(v []types.BatchPutGeofenceRequestEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchPutGeofenceRequestEntryList"}
for i := range v {
if err := validateBatchPutGeofenceRequestEntry(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCircle(v *types.Circle) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Circle"}
if v.Center == nil {
invalidParams.Add(smithy.NewErrParamRequired("Center"))
}
if v.Radius == nil {
invalidParams.Add(smithy.NewErrParamRequired("Radius"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDevicePositionUpdate(v *types.DevicePositionUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DevicePositionUpdate"}
if v.DeviceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeviceId"))
}
if v.SampleTime == nil {
invalidParams.Add(smithy.NewErrParamRequired("SampleTime"))
}
if v.Position == nil {
invalidParams.Add(smithy.NewErrParamRequired("Position"))
}
if v.Accuracy != nil {
if err := validatePositionalAccuracy(v.Accuracy); err != nil {
invalidParams.AddNested("Accuracy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDevicePositionUpdateList(v []types.DevicePositionUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DevicePositionUpdateList"}
for i := range v {
if err := validateDevicePositionUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGeofenceGeometry(v *types.GeofenceGeometry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GeofenceGeometry"}
if v.Circle != nil {
if err := validateCircle(v.Circle); err != nil {
invalidParams.AddNested("Circle", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMapConfiguration(v *types.MapConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MapConfiguration"}
if v.Style == nil {
invalidParams.Add(smithy.NewErrParamRequired("Style"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePositionalAccuracy(v *types.PositionalAccuracy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PositionalAccuracy"}
if v.Horizontal == nil {
invalidParams.Add(smithy.NewErrParamRequired("Horizontal"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateTrackerConsumerInput(v *AssociateTrackerConsumerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateTrackerConsumerInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if v.ConsumerArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConsumerArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchDeleteDevicePositionHistoryInput(v *BatchDeleteDevicePositionHistoryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteDevicePositionHistoryInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if v.DeviceIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeviceIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchDeleteGeofenceInput(v *BatchDeleteGeofenceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchDeleteGeofenceInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
if v.GeofenceIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("GeofenceIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchEvaluateGeofencesInput(v *BatchEvaluateGeofencesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchEvaluateGeofencesInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
if v.DevicePositionUpdates == nil {
invalidParams.Add(smithy.NewErrParamRequired("DevicePositionUpdates"))
} else if v.DevicePositionUpdates != nil {
if err := validateDevicePositionUpdateList(v.DevicePositionUpdates); err != nil {
invalidParams.AddNested("DevicePositionUpdates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchGetDevicePositionInput(v *BatchGetDevicePositionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetDevicePositionInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if v.DeviceIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeviceIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchPutGeofenceInput(v *BatchPutGeofenceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchPutGeofenceInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
if v.Entries == nil {
invalidParams.Add(smithy.NewErrParamRequired("Entries"))
} else if v.Entries != nil {
if err := validateBatchPutGeofenceRequestEntryList(v.Entries); err != nil {
invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchUpdateDevicePositionInput(v *BatchUpdateDevicePositionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchUpdateDevicePositionInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if v.Updates == nil {
invalidParams.Add(smithy.NewErrParamRequired("Updates"))
} else if v.Updates != nil {
if err := validateDevicePositionUpdateList(v.Updates); err != nil {
invalidParams.AddNested("Updates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCalculateRouteInput(v *CalculateRouteInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CalculateRouteInput"}
if v.CalculatorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CalculatorName"))
}
if v.DeparturePosition == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeparturePosition"))
}
if v.DestinationPosition == nil {
invalidParams.Add(smithy.NewErrParamRequired("DestinationPosition"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCalculateRouteMatrixInput(v *CalculateRouteMatrixInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CalculateRouteMatrixInput"}
if v.CalculatorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CalculatorName"))
}
if v.DeparturePositions == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeparturePositions"))
}
if v.DestinationPositions == nil {
invalidParams.Add(smithy.NewErrParamRequired("DestinationPositions"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateGeofenceCollectionInput(v *CreateGeofenceCollectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateGeofenceCollectionInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateKeyInput(v *CreateKeyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateKeyInput"}
if v.KeyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyName"))
}
if v.Restrictions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Restrictions"))
} else if v.Restrictions != nil {
if err := validateApiKeyRestrictions(v.Restrictions); err != nil {
invalidParams.AddNested("Restrictions", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateMapInput(v *CreateMapInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateMapInput"}
if v.MapName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapName"))
}
if v.Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("Configuration"))
} else if v.Configuration != nil {
if err := validateMapConfiguration(v.Configuration); err != nil {
invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreatePlaceIndexInput(v *CreatePlaceIndexInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreatePlaceIndexInput"}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if v.DataSource == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataSource"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateRouteCalculatorInput(v *CreateRouteCalculatorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateRouteCalculatorInput"}
if v.CalculatorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CalculatorName"))
}
if v.DataSource == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataSource"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateTrackerInput(v *CreateTrackerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateTrackerInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteGeofenceCollectionInput(v *DeleteGeofenceCollectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteGeofenceCollectionInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteKeyInput(v *DeleteKeyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteKeyInput"}
if v.KeyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteMapInput(v *DeleteMapInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteMapInput"}
if v.MapName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeletePlaceIndexInput(v *DeletePlaceIndexInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeletePlaceIndexInput"}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteRouteCalculatorInput(v *DeleteRouteCalculatorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteRouteCalculatorInput"}
if v.CalculatorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CalculatorName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteTrackerInput(v *DeleteTrackerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteTrackerInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeGeofenceCollectionInput(v *DescribeGeofenceCollectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeGeofenceCollectionInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeKeyInput(v *DescribeKeyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeKeyInput"}
if v.KeyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeMapInput(v *DescribeMapInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeMapInput"}
if v.MapName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribePlaceIndexInput(v *DescribePlaceIndexInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribePlaceIndexInput"}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeRouteCalculatorInput(v *DescribeRouteCalculatorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeRouteCalculatorInput"}
if v.CalculatorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CalculatorName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeTrackerInput(v *DescribeTrackerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeTrackerInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateTrackerConsumerInput(v *DisassociateTrackerConsumerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateTrackerConsumerInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if v.ConsumerArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConsumerArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDevicePositionHistoryInput(v *GetDevicePositionHistoryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDevicePositionHistoryInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if v.DeviceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeviceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDevicePositionInput(v *GetDevicePositionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDevicePositionInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if v.DeviceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeviceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetGeofenceInput(v *GetGeofenceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetGeofenceInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
if v.GeofenceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GeofenceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMapGlyphsInput(v *GetMapGlyphsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMapGlyphsInput"}
if v.MapName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapName"))
}
if v.FontStack == nil {
invalidParams.Add(smithy.NewErrParamRequired("FontStack"))
}
if v.FontUnicodeRange == nil {
invalidParams.Add(smithy.NewErrParamRequired("FontUnicodeRange"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMapSpritesInput(v *GetMapSpritesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMapSpritesInput"}
if v.MapName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapName"))
}
if v.FileName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMapStyleDescriptorInput(v *GetMapStyleDescriptorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMapStyleDescriptorInput"}
if v.MapName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMapTileInput(v *GetMapTileInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMapTileInput"}
if v.MapName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapName"))
}
if v.Z == nil {
invalidParams.Add(smithy.NewErrParamRequired("Z"))
}
if v.X == nil {
invalidParams.Add(smithy.NewErrParamRequired("X"))
}
if v.Y == nil {
invalidParams.Add(smithy.NewErrParamRequired("Y"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetPlaceInput(v *GetPlaceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetPlaceInput"}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if v.PlaceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PlaceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListDevicePositionsInput(v *ListDevicePositionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListDevicePositionsInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListGeofencesInput(v *ListGeofencesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListGeofencesInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
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 validateOpListTrackerConsumersInput(v *ListTrackerConsumersInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTrackerConsumersInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutGeofenceInput(v *PutGeofenceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutGeofenceInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
if v.GeofenceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GeofenceId"))
}
if v.Geometry == nil {
invalidParams.Add(smithy.NewErrParamRequired("Geometry"))
} else if v.Geometry != nil {
if err := validateGeofenceGeometry(v.Geometry); err != nil {
invalidParams.AddNested("Geometry", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchPlaceIndexForPositionInput(v *SearchPlaceIndexForPositionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchPlaceIndexForPositionInput"}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if v.Position == nil {
invalidParams.Add(smithy.NewErrParamRequired("Position"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchPlaceIndexForSuggestionsInput(v *SearchPlaceIndexForSuggestionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchPlaceIndexForSuggestionsInput"}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if v.Text == nil {
invalidParams.Add(smithy.NewErrParamRequired("Text"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchPlaceIndexForTextInput(v *SearchPlaceIndexForTextInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchPlaceIndexForTextInput"}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if v.Text == nil {
invalidParams.Add(smithy.NewErrParamRequired("Text"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateGeofenceCollectionInput(v *UpdateGeofenceCollectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateGeofenceCollectionInput"}
if v.CollectionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CollectionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateKeyInput(v *UpdateKeyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateKeyInput"}
if v.KeyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyName"))
}
if v.Restrictions != nil {
if err := validateApiKeyRestrictions(v.Restrictions); err != nil {
invalidParams.AddNested("Restrictions", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateMapInput(v *UpdateMapInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateMapInput"}
if v.MapName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MapName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdatePlaceIndexInput(v *UpdatePlaceIndexInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdatePlaceIndexInput"}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateRouteCalculatorInput(v *UpdateRouteCalculatorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateRouteCalculatorInput"}
if v.CalculatorName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CalculatorName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateTrackerInput(v *UpdateTrackerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateTrackerInput"}
if v.TrackerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TrackerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 2,333 |
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 Location 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: "geo.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "geo-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "geo-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "geo.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "geo.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "geo-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "geo-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "geo.{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: "geo-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "geo.{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: "geo-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "geo.{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: "geo-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "geo.{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: "geo-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "geo.{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: "geo.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "geo-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "geo-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "geo.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 338 |
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 BatchItemErrorCode string
// Values returns all known values for BatchItemErrorCode. 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 (BatchItemErrorCode) Values() []BatchItemErrorCode {
return []BatchItemErrorCode{
"AccessDeniedError",
"ConflictError",
"InternalServerError",
"ResourceNotFoundError",
"ThrottlingError",
"ValidationError",
}
}
type DimensionUnit string
// Values returns all known values for DimensionUnit. 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 (DimensionUnit) Values() []DimensionUnit {
return []DimensionUnit{
"Meters",
"Feet",
}
}
type DistanceUnit string
// Values returns all known values for DistanceUnit. 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 (DistanceUnit) Values() []DistanceUnit {
return []DistanceUnit{
"Kilometers",
"Miles",
}
}
type IntendedUse string
// Values returns all known values for IntendedUse. 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 (IntendedUse) Values() []IntendedUse {
return []IntendedUse{
"SingleUse",
"Storage",
}
}
type PositionFiltering string
// Values returns all known values for PositionFiltering. 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 (PositionFiltering) Values() []PositionFiltering {
return []PositionFiltering{
"TimeBased",
"DistanceBased",
"AccuracyBased",
}
}
type PricingPlan string
// Values returns all known values for PricingPlan. 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 (PricingPlan) Values() []PricingPlan {
return []PricingPlan{
"RequestBasedUsage",
"MobileAssetTracking",
"MobileAssetManagement",
}
}
type RouteMatrixErrorCode string
// Values returns all known values for RouteMatrixErrorCode. 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 (RouteMatrixErrorCode) Values() []RouteMatrixErrorCode {
return []RouteMatrixErrorCode{
"RouteNotFound",
"RouteTooLong",
"PositionsNotFound",
"DestinationPositionNotFound",
"DeparturePositionNotFound",
"OtherValidationError",
}
}
type Status string
// Values returns all known values for Status. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Status) Values() []Status {
return []Status{
"Active",
"Expired",
}
}
type TravelMode string
// Values returns all known values for TravelMode. 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 (TravelMode) Values() []TravelMode {
return []TravelMode{
"Car",
"Truck",
"Walking",
"Bicycle",
"Motorcycle",
}
}
type ValidationExceptionReason string
// Values returns all known values for ValidationExceptionReason. 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 (ValidationExceptionReason) Values() []ValidationExceptionReason {
return []ValidationExceptionReason{
"UnknownOperation",
"Missing",
"CannotParse",
"FieldValidationFailed",
"Other",
}
}
type VehicleWeightUnit string
// Values returns all known values for VehicleWeightUnit. 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 (VehicleWeightUnit) Values() []VehicleWeightUnit {
return []VehicleWeightUnit{
"Kilograms",
"Pounds",
}
}
| 152 |
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 request was denied because of insufficient access or permissions. Check
// with an administrator to verify your permissions.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was unsuccessful because of a conflict.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request has failed to process because of an unknown server error,
// exception, or failure.
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 resource that you've entered was not found in your AWS account.
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 }
// The operation was denied because the request would exceed the maximum quota (https://docs.aws.amazon.com/location/latest/developerguide/location-quotas.html)
// set for Amazon Location Service.
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 }
// The request was denied because of request throttling.
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 }
// The input failed to meet the constraints specified by the AWS service.
type ValidationException struct {
Message *string
ErrorCodeOverride *string
Reason ValidationExceptionReason
FieldList []ValidationExceptionField
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 }
| 197 |
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"
)
// Options for filtering API keys.
type ApiKeyFilter struct {
// Filter on Active or Expired API keys.
KeyStatus Status
noSmithyDocumentSerde
}
// API Restrictions on the allowed actions, resources, and referers for an API key
// resource.
type ApiKeyRestrictions struct {
// A list of allowed actions that an API key resource grants permissions to
// perform Currently, the only valid action is geo:GetMap* as an input to the
// list. For example, ["geo:GetMap*"] is valid but ["geo:GetMapTile"] is not.
//
// This member is required.
AllowActions []string
// A list of allowed resource ARNs that a API key bearer can perform actions on
// For more information about ARN format, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// . In this preview, you can allow only map resources. Requirements:
// - Must be prefixed with arn .
// - partition and service must not be empty and should begin with only
// alphanumeric characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers,
// hyphens (-) and periods (.).
// - region and account-id can be empty or should begin with only alphanumeric
// characters (A–Z, a–z, 0–9) and contain only alphanumeric numbers, hyphens (-)
// and periods (.).
// - resource-id can begin with any character except for forward slash (/) and
// contain any characters after, including forward slashes to form a path.
// resource-id can also include wildcard characters, denoted by an asterisk (*).
// - arn , partition , service , region , account-id and resource-id must be
// delimited by a colon (:).
// - No spaces allowed. For example,
// arn:aws:geo:region:account-id:map/ExampleMap* .
//
// This member is required.
AllowResources []string
// An optional list of allowed HTTP referers for which requests must originate
// from. Requests using this API key from other domains will not be allowed.
// Requirements:
// - Contain only alphanumeric characters (A–Z, a–z, 0–9) or any symbols in this
// list $\-._+!*`(),;/?:@=&
// - May contain a percent (%) if followed by 2 hexadecimal digits (A-F, a-f,
// 0-9); this is used for URL encoding purposes.
// - May contain wildcard characters question mark (?) and asterisk (*).
// Question mark (?) will replace any single character (including hexadecimal
// digits). Asterisk (*) will replace any multiple characters (including multiple
// hexadecimal digits).
// - No spaces allowed. For example, https://example.com .
AllowReferers []string
noSmithyDocumentSerde
}
// Contains the tracker resource details.
type BatchDeleteDevicePositionHistoryError struct {
// The ID of the device for this position.
//
// This member is required.
DeviceId *string
// Contains the batch request error details associated with the request.
//
// This member is required.
Error *BatchItemError
noSmithyDocumentSerde
}
// Contains error details for each geofence that failed to delete from the
// geofence collection.
type BatchDeleteGeofenceError struct {
// Contains details associated to the batch error.
//
// This member is required.
Error *BatchItemError
// The geofence associated with the error message.
//
// This member is required.
GeofenceId *string
noSmithyDocumentSerde
}
// Contains error details for each device that failed to evaluate its position
// against the geofences in a given geofence collection.
type BatchEvaluateGeofencesError struct {
// The device associated with the position evaluation error.
//
// This member is required.
DeviceId *string
// Contains details associated to the batch error.
//
// This member is required.
Error *BatchItemError
// Specifies a timestamp for when the error occurred in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
SampleTime *time.Time
noSmithyDocumentSerde
}
// Contains error details for each device that didn't return a position.
type BatchGetDevicePositionError struct {
// The ID of the device that didn't return a position.
//
// This member is required.
DeviceId *string
// Contains details related to the error code.
//
// This member is required.
Error *BatchItemError
noSmithyDocumentSerde
}
// Contains the batch request error details associated with the request.
type BatchItemError struct {
// The error code associated with the batch request error.
Code BatchItemErrorCode
// A message with the reason for the batch request error.
Message *string
noSmithyDocumentSerde
}
// Contains error details for each geofence that failed to be stored in a given
// geofence collection.
type BatchPutGeofenceError struct {
// Contains details associated to the batch error.
//
// This member is required.
Error *BatchItemError
// The geofence associated with the error message.
//
// This member is required.
GeofenceId *string
noSmithyDocumentSerde
}
// Contains geofence geometry details.
type BatchPutGeofenceRequestEntry struct {
// The identifier for the geofence to be stored in a given geofence collection.
//
// This member is required.
GeofenceId *string
// Contains the details of the position of the geofence. Can be either a polygon
// or a circle. Including both will return a validation error. Each geofence
// polygon (https://docs.aws.amazon.com/location-geofences/latest/APIReference/API_GeofenceGeometry.html)
// can have a maximum of 1,000 vertices.
//
// This member is required.
Geometry *GeofenceGeometry
// Specifies additional user-defined properties to store with the Geofence. An
// array of key-value pairs.
GeofenceProperties map[string]string
noSmithyDocumentSerde
}
// Contains a summary of each geofence that was successfully stored in a given
// geofence collection.
type BatchPutGeofenceSuccess struct {
// The timestamp for when the geofence was stored in a geofence collection in ISO
// 8601 (https://www.iso.org/iso-8601-date-and-time-format.html) format:
// YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
CreateTime *time.Time
// The geofence successfully stored in a geofence collection.
//
// This member is required.
GeofenceId *string
// The timestamp for when the geofence was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
UpdateTime *time.Time
noSmithyDocumentSerde
}
// Contains error details for each device that failed to update its position.
type BatchUpdateDevicePositionError struct {
// The device associated with the failed location update.
//
// This member is required.
DeviceId *string
// Contains details related to the error code such as the error code and error
// message.
//
// This member is required.
Error *BatchItemError
// The timestamp at which the device position was determined. Uses ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
SampleTime *time.Time
noSmithyDocumentSerde
}
// Contains details about additional route preferences for requests that specify
// TravelMode as Car .
type CalculateRouteCarModeOptions struct {
// Avoids ferries when calculating routes. Default Value: false Valid Values: false
// | true
AvoidFerries *bool
// Avoids tolls when calculating routes. Default Value: false Valid Values: false
// | true
AvoidTolls *bool
noSmithyDocumentSerde
}
// A summary of the calculated route matrix.
type CalculateRouteMatrixSummary struct {
// The data provider of traffic and road network data used to calculate the
// routes. Indicates one of the available providers:
// - Esri
// - Grab
// - Here
// For more information about data providers, see Amazon Location Service data
// providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// .
//
// This member is required.
DataSource *string
// The unit of measurement for route distances.
//
// This member is required.
DistanceUnit DistanceUnit
// The count of error results in the route matrix. If this number is 0, all routes
// were calculated successfully.
//
// This member is required.
ErrorCount *int32
// The count of cells in the route matrix. Equal to the number of
// DeparturePositions multiplied by the number of DestinationPositions .
//
// This member is required.
RouteCount *int32
noSmithyDocumentSerde
}
// A summary of the calculated route.
type CalculateRouteSummary struct {
// The data provider of traffic and road network data used to calculate the route.
// Indicates one of the available providers:
// - Esri
// - Grab
// - Here
// For more information about data providers, see Amazon Location Service data
// providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// .
//
// This member is required.
DataSource *string
// The total distance covered by the route. The sum of the distance travelled
// between every stop on the route. If Esri is the data source for the route
// calculator, the route distance can’t be greater than 400 km. If the route
// exceeds 400 km, the response is a 400 RoutesValidationException error.
//
// This member is required.
Distance *float64
// The unit of measurement for route distances.
//
// This member is required.
DistanceUnit DistanceUnit
// The total travel time for the route measured in seconds. The sum of the travel
// time between every stop on the route.
//
// This member is required.
DurationSeconds *float64
// Specifies a geographical box surrounding a route. Used to zoom into a route
// when displaying it in a map. For example, [min x, min y, max x, max y] . The
// first 2 bbox parameters describe the lower southwest corner:
// - The first bbox position is the X coordinate or longitude of the lower
// southwest corner.
// - The second bbox position is the Y coordinate or latitude of the lower
// southwest corner.
// The next 2 bbox parameters describe the upper northeast corner:
// - The third bbox position is the X coordinate, or longitude of the upper
// northeast corner.
// - The fourth bbox position is the Y coordinate, or latitude of the upper
// northeast corner.
//
// This member is required.
RouteBBox []float64
noSmithyDocumentSerde
}
// Contains details about additional route preferences for requests that specify
// TravelMode as Truck .
type CalculateRouteTruckModeOptions struct {
// Avoids ferries when calculating routes. Default Value: false Valid Values: false
// | true
AvoidFerries *bool
// Avoids tolls when calculating routes. Default Value: false Valid Values: false
// | true
AvoidTolls *bool
// Specifies the truck's dimension specifications including length, height, width,
// and unit of measurement. Used to avoid roads that can't support the truck's
// dimensions.
Dimensions *TruckDimensions
// Specifies the truck's weight specifications including total weight and unit of
// measurement. Used to avoid roads that can't support the truck's weight.
Weight *TruckWeight
noSmithyDocumentSerde
}
// A circle on the earth, as defined by a center point and a radius.
type Circle struct {
// A single point geometry, specifying the center of the circle, using WGS 84 (https://gisgeography.com/wgs84-world-geodetic-system/)
// coordinates, in the form [longitude, latitude] .
//
// This member is required.
Center []float64
// The radius of the circle in meters. Must be greater than zero and no larger
// than 100,000 (100 kilometers).
//
// This member is required.
Radius *float64
noSmithyDocumentSerde
}
// Specifies the data storage option chosen for requesting Places. When using
// Amazon Location Places:
// - If using HERE Technologies as a data provider, you can't store results for
// locations in Japan by setting IntendedUse to Storage . parameter.
// - Under the MobileAssetTracking or MobilAssetManagement pricing plan, you
// can't store results from your place index resources by setting IntendedUse to
// Storage . This returns a validation exception error.
//
// For more information, see the AWS Service Terms (https://aws.amazon.com/service-terms/)
// for Amazon Location Service.
type DataSourceConfiguration struct {
// Specifies how the results of an operation will be stored by the caller. Valid
// values include:
// - SingleUse specifies that the results won't be stored.
// - Storage specifies that the result can be cached or stored in a database.
// Default value: SingleUse
IntendedUse IntendedUse
noSmithyDocumentSerde
}
// Contains the device position details.
type DevicePosition struct {
// The last known device position.
//
// This member is required.
Position []float64
// The timestamp for when the tracker resource received the device position in
// ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html) format:
// YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
ReceivedTime *time.Time
// The timestamp at which the device's position was determined. Uses ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
SampleTime *time.Time
// The accuracy of the device position.
Accuracy *PositionalAccuracy
// The device whose position you retrieved.
DeviceId *string
// The properties associated with the position.
PositionProperties map[string]string
noSmithyDocumentSerde
}
// Contains the position update details for a device.
type DevicePositionUpdate struct {
// The device associated to the position update.
//
// This member is required.
DeviceId *string
// The latest device position defined in WGS 84 (https://earth-info.nga.mil/index.php?dir=wgs84&action=wgs84)
// format: [X or longitude, Y or latitude] .
//
// This member is required.
Position []float64
// The timestamp at which the device's position was determined. Uses ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
SampleTime *time.Time
// The accuracy of the device position.
Accuracy *PositionalAccuracy
// Associates one of more properties with the position update. A property is a
// key-value pair stored with the position update and added to any geofence event
// the update may trigger. Format: "key" : "value"
PositionProperties map[string]string
noSmithyDocumentSerde
}
// Contains the geofence geometry details. A geofence geometry is made up of
// either a polygon or a circle. Can be either a polygon or a circle. Including
// both will return a validation error. Amazon Location doesn't currently support
// polygons with holes, multipolygons, polygons that are wound clockwise, or that
// cross the antimeridian.
type GeofenceGeometry struct {
// A circle on the earth, as defined by a center point and a radius.
Circle *Circle
// A polygon is a list of linear rings which are each made up of a list of
// vertices. Each vertex is a 2-dimensional point of the form: [longitude,
// latitude] . This is represented as an array of doubles of length 2 (so [double,
// double] ). An array of 4 or more vertices, where the first and last vertex are
// the same (to form a closed boundary), is called a linear ring. The linear ring
// vertices must be listed in counter-clockwise order around the ring’s interior.
// The linear ring is represented as an array of vertices, or an array of arrays of
// doubles ( [[double, double], ...] ). A geofence consists of a single linear
// ring. To allow for future expansion, the Polygon parameter takes an array of
// linear rings, which is represented as an array of arrays of arrays of doubles (
// [[[double, double], ...], ...] ). A linear ring for use in geofences can consist
// of between 4 and 1,000 vertices.
Polygon [][][]float64
noSmithyDocumentSerde
}
// Contains the calculated route's details for each path between a pair of
// positions. The number of legs returned corresponds to one fewer than the total
// number of positions in the request. For example, a route with a departure
// position and destination position returns one leg with the positions snapped to
// a nearby road (https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html)
// :
// - The StartPosition is the departure position.
// - The EndPosition is the destination position.
//
// A route with a waypoint between the departure and destination position returns
// two legs with the positions snapped to a nearby road:
// - Leg 1: The StartPosition is the departure position . The EndPosition is the
// waypoint positon.
// - Leg 2: The StartPosition is the waypoint position. The EndPosition is the
// destination position.
type Leg struct {
// The distance between the leg's StartPosition and EndPosition along a calculated
// route.
// - The default measurement is Kilometers unless the request specifies a
// DistanceUnit of Miles .
//
// This member is required.
Distance *float64
// The estimated travel time between the leg's StartPosition and EndPosition . The
// travel mode and departure time that you specify in the request determines the
// calculated time.
//
// This member is required.
DurationSeconds *float64
// The terminating position of the leg. Follows the format [longitude,latitude] .
// If the EndPosition isn't located on a road, it's snapped to a nearby road (https://docs.aws.amazon.com/location/latest/developerguide/nap-to-nearby-road.html)
// .
//
// This member is required.
EndPosition []float64
// The starting position of the leg. Follows the format [longitude,latitude] . If
// the StartPosition isn't located on a road, it's snapped to a nearby road (https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html)
// .
//
// This member is required.
StartPosition []float64
// Contains a list of steps, which represent subsections of a leg. Each step
// provides instructions for how to move to the next step in the leg such as the
// step's start position, end position, travel distance, travel duration, and
// geometry offset.
//
// This member is required.
Steps []Step
// Contains the calculated route's path as a linestring geometry.
Geometry *LegGeometry
noSmithyDocumentSerde
}
// Contains the geometry details for each path between a pair of positions. Used
// in plotting a route leg on a map.
type LegGeometry struct {
// An ordered list of positions used to plot a route on a map. The first position
// is closest to the start position for the leg, and the last position is the
// closest to the end position for the leg.
// - For example, [[-123.117, 49.284],[-123.115, 49.285],[-123.115, 49.285]]
LineString [][]float64
noSmithyDocumentSerde
}
// Contains the tracker resource details.
type ListDevicePositionsResponseEntry struct {
// The ID of the device for this position.
//
// This member is required.
DeviceId *string
// The last known device position. Empty if no positions currently stored.
//
// This member is required.
Position []float64
// The timestamp at which the device position was determined. Uses ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
SampleTime *time.Time
// The accuracy of the device position.
Accuracy *PositionalAccuracy
// The properties associated with the position.
PositionProperties map[string]string
noSmithyDocumentSerde
}
// Contains the geofence collection details.
type ListGeofenceCollectionsResponseEntry struct {
// The name of the geofence collection.
//
// This member is required.
CollectionName *string
// The timestamp for when the geofence collection was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
CreateTime *time.Time
// The description for the geofence collection
//
// This member is required.
Description *string
// Specifies a timestamp for when the resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
UpdateTime *time.Time
// No longer used. Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan PricingPlan
// No longer used. Always returns an empty string.
//
// Deprecated: Deprecated. Unused.
PricingPlanDataSource *string
noSmithyDocumentSerde
}
// Contains a list of geofences stored in a given geofence collection.
type ListGeofenceResponseEntry struct {
// The timestamp for when the geofence was stored in a geofence collection in ISO
// 8601 (https://www.iso.org/iso-8601-date-and-time-format.html) format:
// YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
CreateTime *time.Time
// The geofence identifier.
//
// This member is required.
GeofenceId *string
// Contains the geofence geometry details describing a polygon or a circle.
//
// This member is required.
Geometry *GeofenceGeometry
// Identifies the state of the geofence. A geofence will hold one of the following
// states:
// - ACTIVE — The geofence has been indexed by the system.
// - PENDING — The geofence is being processed by the system.
// - FAILED — The geofence failed to be indexed by the system.
// - DELETED — The geofence has been deleted from the system index.
// - DELETING — The geofence is being deleted from the system index.
//
// This member is required.
Status *string
// The timestamp for when the geofence was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ
//
// This member is required.
UpdateTime *time.Time
// Contains additional user-defined properties stored with the geofence. An array
// of key-value pairs.
GeofenceProperties map[string]string
noSmithyDocumentSerde
}
// An API key resource listed in your Amazon Web Services account.
type ListKeysResponseEntry struct {
// The timestamp of when the API key was created, in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The timestamp for when the API key resource will expire, in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
ExpireTime *time.Time
// The name of the API key resource.
//
// This member is required.
KeyName *string
// API Restrictions on the allowed actions, resources, and referers for an API key
// resource.
//
// This member is required.
Restrictions *ApiKeyRestrictions
// The timestamp of when the API key was last updated, in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// The optional description for the API key resource.
Description *string
noSmithyDocumentSerde
}
// Contains details of an existing map resource in your Amazon Web Services
// account.
type ListMapsResponseEntry struct {
// The timestamp for when the map resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// Specifies the data provider for the associated map tiles.
//
// This member is required.
DataSource *string
// The description for the map resource.
//
// This member is required.
Description *string
// The name of the associated map resource.
//
// This member is required.
MapName *string
// The timestamp for when the map resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// No longer used. Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan PricingPlan
noSmithyDocumentSerde
}
// A place index resource listed in your Amazon Web Services account.
type ListPlaceIndexesResponseEntry struct {
// The timestamp for when the place index resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The data provider of geospatial data. Values can be one of the following:
// - Esri
// - Grab
// - Here
// For more information about data providers, see Amazon Location Service data
// providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// .
//
// This member is required.
DataSource *string
// The optional description for the place index resource.
//
// This member is required.
Description *string
// The name of the place index resource.
//
// This member is required.
IndexName *string
// The timestamp for when the place index resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// No longer used. Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan PricingPlan
noSmithyDocumentSerde
}
// A route calculator resource listed in your Amazon Web Services account.
type ListRouteCalculatorsResponseEntry struct {
// The name of the route calculator resource.
//
// This member is required.
CalculatorName *string
// The timestamp when the route calculator resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
// - For example, 2020–07-2T12:15:20.000Z+01:00
//
// This member is required.
CreateTime *time.Time
// The data provider of traffic and road network data. Indicates one of the
// available providers:
// - Esri
// - Grab
// - Here
// For more information about data providers, see Amazon Location Service data
// providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// .
//
// This member is required.
DataSource *string
// The optional description of the route calculator resource.
//
// This member is required.
Description *string
// The timestamp when the route calculator resource was last updated in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
// - For example, 2020–07-2T12:15:20.000Z+01:00
//
// This member is required.
UpdateTime *time.Time
// Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan PricingPlan
noSmithyDocumentSerde
}
// Contains the tracker resource details.
type ListTrackersResponseEntry struct {
// The timestamp for when the tracker resource was created in ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
CreateTime *time.Time
// The description for the tracker resource.
//
// This member is required.
Description *string
// The name of the tracker resource.
//
// This member is required.
TrackerName *string
// The timestamp at which the device's position was determined. Uses ISO 8601 (https://www.iso.org/iso-8601-date-and-time-format.html)
// format: YYYY-MM-DDThh:mm:ss.sssZ .
//
// This member is required.
UpdateTime *time.Time
// Always returns RequestBasedUsage .
//
// Deprecated: Deprecated. Always returns RequestBasedUsage.
PricingPlan PricingPlan
// No longer used. Always returns an empty string.
//
// Deprecated: Deprecated. Unused.
PricingPlanDataSource *string
noSmithyDocumentSerde
}
// Specifies the map tile style selected from an available provider.
type MapConfiguration struct {
// Specifies the map style selected from an available data provider. Valid Esri
// map styles (https://docs.aws.amazon.com/location/latest/developerguide/esri.html)
// :
// - VectorEsriDarkGrayCanvas – The Esri Dark Gray Canvas map style. A vector
// basemap with a dark gray, neutral background with minimal colors, labels, and
// features that's designed to draw attention to your thematic content.
// - RasterEsriImagery – The Esri Imagery map style. A raster basemap that
// provides one meter or better satellite and aerial imagery in many parts of the
// world and lower resolution satellite imagery worldwide.
// - VectorEsriLightGrayCanvas – The Esri Light Gray Canvas map style, which
// provides a detailed vector basemap with a light gray, neutral background style
// with minimal colors, labels, and features that's designed to draw attention to
// your thematic content.
// - VectorEsriTopographic – The Esri Light map style, which provides a detailed
// vector basemap with a classic Esri map style.
// - VectorEsriStreets – The Esri Street Map style, which provides a detailed
// vector basemap for the world symbolized with a classic Esri street map style.
// The vector tile layer is similar in content and style to the World Street Map
// raster map.
// - VectorEsriNavigation – The Esri Navigation map style, which provides a
// detailed basemap for the world symbolized with a custom navigation map style
// that's designed for use during the day in mobile devices.
// Valid HERE Technologies map styles (https://docs.aws.amazon.com/location/latest/developerguide/HERE.html)
// :
// - VectorHereContrast – The HERE Contrast (Berlin) map style is a high contrast
// detailed base map of the world that blends 3D and 2D rendering. The
// VectorHereContrast style has been renamed from VectorHereBerlin .
// VectorHereBerlin has been deprecated, but will continue to work in
// applications that use it.
// - VectorHereExplore – A default HERE map style containing a neutral, global
// map and its features including roads, buildings, landmarks, and water features.
// It also now includes a fully designed map of Japan.
// - VectorHereExploreTruck – A global map containing truck restrictions and
// attributes (e.g. width / height / HAZMAT) symbolized with highlighted segments
// and icons on top of HERE Explore to support use cases within transport and
// logistics.
// - RasterHereExploreSatellite – A global map containing high resolution
// satellite imagery.
// - HybridHereExploreSatellite – A global map displaying the road network,
// street names, and city labels over satellite imagery. This style will
// automatically retrieve both raster and vector tiles, and your charges will be
// based on total tiles retrieved. Hybrid styles use both vector and raster tiles
// when rendering the map that you see. This means that more tiles are retrieved
// than when using either vector or raster tiles alone. Your charges will include
// all tiles retrieved.
// Valid GrabMaps map styles (https://docs.aws.amazon.com/location/latest/developerguide/grab.html)
// :
// - VectorGrabStandardLight – The Grab Standard Light map style provides a
// basemap with detailed land use coloring, area names, roads, landmarks, and
// points of interest covering Southeast Asia.
// - VectorGrabStandardDark – The Grab Standard Dark map style provides a dark
// variation of the standard basemap covering Southeast Asia.
// Grab provides maps only for countries in Southeast Asia, and is only available
// in the Asia Pacific (Singapore) Region ( ap-southeast-1 ). For more information,
// see GrabMaps countries and area covered (https://docs.aws.amazon.com/location/latest/developerguide/grab.html#grab-coverage-area)
// . Valid Open Data map styles (https://docs.aws.amazon.com/location/latest/developerguide/open-data.html)
// :
// - VectorOpenDataStandardLight – The Open Data Standard Light map style
// provides a detailed basemap for the world suitable for website and mobile
// application use. The map includes highways major roads, minor roads, railways,
// water features, cities, parks, landmarks, building footprints, and
// administrative boundaries.
// - VectorOpenDataStandardDark – Open Data Standard Dark is a dark-themed map
// style that provides a detailed basemap for the world suitable for website and
// mobile application use. The map includes highways major roads, minor roads,
// railways, water features, cities, parks, landmarks, building footprints, and
// administrative boundaries.
// - VectorOpenDataVisualizationLight – The Open Data Visualization Light map
// style is a light-themed style with muted colors and fewer features that aids in
// understanding overlaid data.
// - VectorOpenDataVisualizationDark – The Open Data Visualization Dark map style
// is a dark-themed style with muted colors and fewer features that aids in
// understanding overlaid data.
//
// This member is required.
Style *string
// Specifies the political view for the style. Leave unset to not use a political
// view, or, for styles that support specific political views, you can choose a
// view, such as IND for the Indian view. Default is unset. Not all map resources
// or styles support political view styles. See Political views (https://docs.aws.amazon.com/location/latest/developerguide/map-concepts.html#political-views)
// for more information.
PoliticalView *string
noSmithyDocumentSerde
}
// Specifies the political view for the style.
type MapConfigurationUpdate struct {
// Specifies the political view for the style. Set to an empty string to not use a
// political view, or, for styles that support specific political views, you can
// choose a view, such as IND for the Indian view. Not all map resources or styles
// support political view styles. See Political views (https://docs.aws.amazon.com/location/latest/developerguide/map-concepts.html#political-views)
// for more information.
PoliticalView *string
noSmithyDocumentSerde
}
// Contains details about addresses or points of interest that match the search
// criteria. Not all details are included with all responses. Some details may only
// be returned by specific data partners.
type Place struct {
// Places uses a point geometry to specify a location or a Place.
//
// This member is required.
Geometry *PlaceGeometry
// The numerical portion of an address, such as a building number.
AddressNumber *string
// The Amazon Location categories that describe this Place. For more information
// about using categories, including a list of Amazon Location categories, see
// Categories and filtering (https://docs.aws.amazon.com/location/latest/developerguide/category-filtering.html)
// , in the Amazon Location Service Developer Guide.
Categories []string
// A country/region specified using ISO 3166 (https://www.iso.org/iso-3166-country-codes.html)
// 3-digit country/region code. For example, CAN .
Country *string
// True if the result is interpolated from other known places. False if the Place
// is a known place. Not returned when the partner does not provide the
// information. For example, returns False for an address location that is found
// in the partner data, but returns True if an address does not exist in the
// partner data and its location is calculated by interpolating between other known
// addresses.
Interpolated *bool
// The full name and address of the point of interest such as a city, region, or
// country. For example, 123 Any Street, Any Town, USA .
Label *string
// A name for a local area, such as a city or town name. For example, Toronto .
Municipality *string
// The name of a community district. For example, Downtown .
Neighborhood *string
// A group of numbers and letters in a country-specific format, which accompanies
// the address for the purpose of identifying a location.
PostalCode *string
// A name for an area or geographical division, such as a province or state name.
// For example, British Columbia .
Region *string
// The name for a street or a road to identify a location. For example, Main Street
// .
Street *string
// A county, or an area that's part of a larger region. For example, Metro
// Vancouver .
SubRegion *string
// Categories from the data provider that describe the Place that are not mapped
// to any Amazon Location categories.
SupplementalCategories []string
// The time zone in which the Place is located. Returned only when using HERE or
// Grab as the selected partner.
TimeZone *TimeZone
// For addresses with multiple units, the unit identifier. Can include numbers and
// letters, for example 3B or Unit 123 . Returned only for a place index that uses
// Esri or Grab as a data provider. Is not returned for SearchPlaceIndexForPosition
// .
UnitNumber *string
// For addresses with a UnitNumber , the type of unit. For example, Apartment .
// Returned only for a place index that uses Esri as a data provider.
UnitType *string
noSmithyDocumentSerde
}
// Places uses a point geometry to specify a location or a Place.
type PlaceGeometry struct {
// A single point geometry specifies a location for a Place using WGS 84 (https://gisgeography.com/wgs84-world-geodetic-system/)
// coordinates:
// - x — Specifies the x coordinate or longitude.
// - y — Specifies the y coordinate or latitude.
Point []float64
noSmithyDocumentSerde
}
// Defines the level of certainty of the position.
type PositionalAccuracy struct {
// Estimated maximum distance, in meters, between the measured position and the
// true position of a device, along the Earth's surface.
//
// This member is required.
Horizontal *float64
noSmithyDocumentSerde
}
// The result for the calculated route of one DeparturePosition DestinationPosition
// pair.
type RouteMatrixEntry struct {
// The total distance of travel for the route.
Distance *float64
// The expected duration of travel for the route.
DurationSeconds *float64
// An error corresponding to the calculation of a route between the
// DeparturePosition and DestinationPosition .
Error *RouteMatrixEntryError
noSmithyDocumentSerde
}
// An error corresponding to the calculation of a route between the
// DeparturePosition and DestinationPosition . The error code can be one of the
// following:
//
// - RouteNotFound - Unable to find a valid route with the given parameters.
//
// - RouteTooLong - Route calculation went beyond the maximum size of a route and
// was terminated before completion.
//
// - PositionsNotFound - One or more of the input positions were not found on the
// route network.
//
// - DestinationPositionNotFound - The destination position was not found on the
// route network.
//
// - DeparturePositionNotFound - The departure position was not found on the
// route network.
//
// - OtherValidationError - The given inputs were not valid or a route was not
// found. More information is given in the error Message
type RouteMatrixEntryError struct {
// The type of error which occurred for the route calculation.
//
// This member is required.
Code RouteMatrixErrorCode
// A message about the error that occurred for the route calculation.
Message *string
noSmithyDocumentSerde
}
// Contains a search result from a position search query that is run on a place
// index resource.
type SearchForPositionResult struct {
// The distance in meters of a great-circle arc between the query position and the
// result. A great-circle arc is the shortest path on a sphere, in this case the
// Earth. This returns the shortest distance between two locations.
//
// This member is required.
Distance *float64
// Details about the search result, such as its address and position.
//
// This member is required.
Place *Place
// The unique identifier of the place. You can use this with the GetPlace
// operation to find the place again later. For SearchPlaceIndexForPosition
// operations, the PlaceId is returned only by place indexes that use HERE or Grab
// as a data provider.
PlaceId *string
noSmithyDocumentSerde
}
// Contains a place suggestion resulting from a place suggestion query that is run
// on a place index resource.
type SearchForSuggestionsResult struct {
// The text of the place suggestion, typically formatted as an address string.
//
// This member is required.
Text *string
// The Amazon Location categories that describe the Place. For more information
// about using categories, including a list of Amazon Location categories, see
// Categories and filtering (https://docs.aws.amazon.com/location/latest/developerguide/category-filtering.html)
// , in the Amazon Location Service Developer Guide.
Categories []string
// The unique identifier of the Place. You can use this with the GetPlace
// operation to find the place again later, or to get full information for the
// Place. The GetPlace request must use the same PlaceIndex resource as the
// SearchPlaceIndexForSuggestions that generated the Place ID. For
// SearchPlaceIndexForSuggestions operations, the PlaceId is returned by place
// indexes that use Esri, Grab, or HERE as data providers.
PlaceId *string
// Categories from the data provider that describe the Place that are not mapped
// to any Amazon Location categories.
SupplementalCategories []string
noSmithyDocumentSerde
}
// Contains a search result from a text search query that is run on a place index
// resource.
type SearchForTextResult struct {
// Details about the search result, such as its address and position.
//
// This member is required.
Place *Place
// The distance in meters of a great-circle arc between the bias position
// specified and the result. Distance will be returned only if a bias position was
// specified in the query. A great-circle arc is the shortest path on a sphere, in
// this case the Earth. This returns the shortest distance between two locations.
Distance *float64
// The unique identifier of the place. You can use this with the GetPlace
// operation to find the place again later. For SearchPlaceIndexForText
// operations, the PlaceId is returned only by place indexes that use HERE or Grab
// as a data provider.
PlaceId *string
// The relative confidence in the match for a result among the results returned.
// For example, if more fields for an address match (including house number,
// street, city, country/region, and postal code), the relevance score is closer to
// 1. Returned only when the partner selected is Esri or Grab.
Relevance *float64
noSmithyDocumentSerde
}
// A summary of the request sent by using SearchPlaceIndexForPosition .
type SearchPlaceIndexForPositionSummary struct {
// The geospatial data provider attached to the place index resource specified in
// the request. Values can be one of the following:
// - Esri
// - Grab
// - Here
// For more information about data providers, see Amazon Location Service data
// providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// .
//
// This member is required.
DataSource *string
// The position specified in the request.
//
// This member is required.
Position []float64
// The preferred language used to return results. Matches the language in the
// request. The value is a valid BCP 47 (https://tools.ietf.org/search/bcp47)
// language tag, for example, en for English.
Language *string
// Contains the optional result count limit that is specified in the request.
// Default value: 50
MaxResults int32
noSmithyDocumentSerde
}
// A summary of the request sent by using SearchPlaceIndexForSuggestions .
type SearchPlaceIndexForSuggestionsSummary struct {
// The geospatial data provider attached to the place index resource specified in
// the request. Values can be one of the following:
// - Esri
// - Grab
// - Here
// For more information about data providers, see Amazon Location Service data
// providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// .
//
// This member is required.
DataSource *string
// The free-form partial text input specified in the request.
//
// This member is required.
Text *string
// Contains the coordinates for the optional bias position specified in the
// request. This parameter contains a pair of numbers. The first number represents
// the X coordinate, or longitude; the second number represents the Y coordinate,
// or latitude. For example, [-123.1174, 49.2847] represents the position with
// longitude -123.1174 and latitude 49.2847 .
BiasPosition []float64
// Contains the coordinates for the optional bounding box specified in the request.
FilterBBox []float64
// The optional category filter specified in the request.
FilterCategories []string
// Contains the optional country filter specified in the request.
FilterCountries []string
// The preferred language used to return results. Matches the language in the
// request. The value is a valid BCP 47 (https://tools.ietf.org/search/bcp47)
// language tag, for example, en for English.
Language *string
// Contains the optional result count limit specified in the request.
MaxResults *int32
noSmithyDocumentSerde
}
// A summary of the request sent by using SearchPlaceIndexForText .
type SearchPlaceIndexForTextSummary struct {
// The geospatial data provider attached to the place index resource specified in
// the request. Values can be one of the following:
// - Esri
// - Grab
// - Here
// For more information about data providers, see Amazon Location Service data
// providers (https://docs.aws.amazon.com/location/latest/developerguide/what-is-data-provider.html)
// .
//
// This member is required.
DataSource *string
// The search text specified in the request.
//
// This member is required.
Text *string
// Contains the coordinates for the optional bias position specified in the
// request. This parameter contains a pair of numbers. The first number represents
// the X coordinate, or longitude; the second number represents the Y coordinate,
// or latitude. For example, [-123.1174, 49.2847] represents the position with
// longitude -123.1174 and latitude 49.2847 .
BiasPosition []float64
// Contains the coordinates for the optional bounding box specified in the request.
FilterBBox []float64
// The optional category filter specified in the request.
FilterCategories []string
// Contains the optional country filter specified in the request.
FilterCountries []string
// The preferred language used to return results. Matches the language in the
// request. The value is a valid BCP 47 (https://tools.ietf.org/search/bcp47)
// language tag, for example, en for English.
Language *string
// Contains the optional result count limit specified in the request.
MaxResults int32
// The bounding box that fully contains all search results. If you specified the
// optional FilterBBox parameter in the request, ResultBBox is contained within
// FilterBBox .
ResultBBox []float64
noSmithyDocumentSerde
}
// Represents an element of a leg within a route. A step contains instructions for
// how to move to the next step in the leg.
type Step struct {
// The travel distance between the step's StartPosition and EndPosition .
//
// This member is required.
Distance *float64
// The estimated travel time, in seconds, from the step's StartPosition to the
// EndPosition . . The travel mode and departure time that you specify in the
// request determines the calculated time.
//
// This member is required.
DurationSeconds *float64
// The end position of a step. If the position the last step in the leg, this
// position is the same as the end position of the leg.
//
// This member is required.
EndPosition []float64
// The starting position of a step. If the position is the first step in the leg,
// this position is the same as the start position of the leg.
//
// This member is required.
StartPosition []float64
// Represents the start position, or index, in a sequence of steps within the
// leg's line string geometry. For example, the index of the first step in a leg
// geometry is 0 . Included in the response for queries that set IncludeLegGeometry
// to True .
GeometryOffset *int32
noSmithyDocumentSerde
}
// Information about a time zone. Includes the name of the time zone and the
// offset from UTC in seconds.
type TimeZone struct {
// The name of the time zone, following the IANA time zone standard (https://www.iana.org/time-zones)
// . For example, America/Los_Angeles .
//
// This member is required.
Name *string
// The time zone's offset, in seconds, from UTC.
Offset *int32
noSmithyDocumentSerde
}
// Contains details about the truck dimensions in the unit of measurement that you
// specify. Used to filter out roads that can't support or allow the specified
// dimensions for requests that specify TravelMode as Truck .
type TruckDimensions struct {
// The height of the truck.
// - For example, 4.5 .
// For routes calculated with a HERE resource, this value must be between 0 and 50
// meters.
Height *float64
// The length of the truck.
// - For example, 15.5 .
// For routes calculated with a HERE resource, this value must be between 0 and
// 300 meters.
Length *float64
// Specifies the unit of measurement for the truck dimensions. Default Value:
// Meters
Unit DimensionUnit
// The width of the truck.
// - For example, 4.5 .
// For routes calculated with a HERE resource, this value must be between 0 and 50
// meters.
Width *float64
noSmithyDocumentSerde
}
// Contains details about the truck's weight specifications. Used to avoid roads
// that can't support or allow the total weight for requests that specify
// TravelMode as Truck .
type TruckWeight struct {
// The total weight of the truck.
// - For example, 3500 .
Total *float64
// The unit of measurement to use for the truck weight. Default Value: Kilograms
Unit VehicleWeightUnit
noSmithyDocumentSerde
}
// The input failed to meet the constraints specified by the AWS service in a
// specified field.
type ValidationExceptionField struct {
// A message with the reason for the validation exception error.
//
// This member is required.
Message *string
// The field name where the invalid entry was detected.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 1,474 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"context"
cryptorand "crypto/rand"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyrand "github.com/aws/smithy-go/rand"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "LookoutEquipment"
const ServiceAPIVersion = "2020-12-15"
// Client provides the API client to make operations call for Amazon Lookout for
// Equipment.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
resolveIdempotencyTokenProvider(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// Provides idempotency tokens values that will be automatically populated into
// idempotent API operations.
IdempotencyTokenProvider IdempotencyTokenProvider
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "lookoutequipment", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func resolveIdempotencyTokenProvider(o *Options) {
if o.IdempotencyTokenProvider != nil {
return
}
o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
// IdempotencyTokenProvider interface for providing idempotency token
type IdempotencyTokenProvider interface {
GetIdempotencyToken() (string, error)
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 455 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
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 lookoutequipment
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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a container for a collection of data being ingested for analysis. The
// dataset contains the metadata describing where the data is and what the data
// actually looks like. In other words, it contains the location of the data
// source, the data schema, and other information. A dataset also contains any tags
// associated with the ingested data.
func (c *Client) CreateDataset(ctx context.Context, params *CreateDatasetInput, optFns ...func(*Options)) (*CreateDatasetOutput, error) {
if params == nil {
params = &CreateDatasetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateDataset", params, optFns, c.addOperationCreateDatasetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateDatasetOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateDatasetInput struct {
// A unique identifier for the request. If you do not set the client request
// token, Amazon Lookout for Equipment generates one.
//
// This member is required.
ClientToken *string
// The name of the dataset being created.
//
// This member is required.
DatasetName *string
// A JSON description of the data that is in each time series dataset, including
// names, column names, and data types.
DatasetSchema *types.DatasetSchema
// Provides the identifier of the KMS key used to encrypt dataset data by Amazon
// Lookout for Equipment.
ServerSideKmsKeyId *string
// Any tags associated with the ingested data described in the dataset.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateDatasetOutput struct {
// The Amazon Resource Name (ARN) of the dataset being created.
DatasetArn *string
// The name of the dataset being created.
DatasetName *string
// Indicates the status of the CreateDataset operation.
Status types.DatasetStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateDatasetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateDataset{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateDataset{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateDatasetMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateDatasetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataset(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateDataset struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateDataset) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateDatasetInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDatasetInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateDatasetMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDataset{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateDataset(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "CreateDataset",
}
}
| 189 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a scheduled inference. Scheduling an inference is setting up a
// continuous real-time inference plan to analyze new measurement data. When
// setting up the schedule, you provide an S3 bucket location for the input data,
// assign it a delimiter between separate entries in the data, set an offset delay
// if desired, and set the frequency of inferencing. You must also provide an S3
// bucket location for the output data.
func (c *Client) CreateInferenceScheduler(ctx context.Context, params *CreateInferenceSchedulerInput, optFns ...func(*Options)) (*CreateInferenceSchedulerOutput, error) {
if params == nil {
params = &CreateInferenceSchedulerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateInferenceScheduler", params, optFns, c.addOperationCreateInferenceSchedulerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateInferenceSchedulerOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateInferenceSchedulerInput struct {
// A unique identifier for the request. If you do not set the client request
// token, Amazon Lookout for Equipment generates one.
//
// This member is required.
ClientToken *string
// Specifies configuration information for the input data for the inference
// scheduler, including delimiter, format, and dataset location.
//
// This member is required.
DataInputConfiguration *types.InferenceInputConfiguration
// Specifies configuration information for the output results for the inference
// scheduler, including the S3 location for the output.
//
// This member is required.
DataOutputConfiguration *types.InferenceOutputConfiguration
// How often data is uploaded to the source Amazon S3 bucket for the input data.
// The value chosen is the length of time between data uploads. For instance, if
// you select 5 minutes, Amazon Lookout for Equipment will upload the real-time
// data to the source bucket once every 5 minutes. This frequency also determines
// how often Amazon Lookout for Equipment runs inference on your data. For more
// information, see Understanding the inference process (https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/understanding-inference-process.html)
// .
//
// This member is required.
DataUploadFrequency types.DataUploadFrequency
// The name of the inference scheduler being created.
//
// This member is required.
InferenceSchedulerName *string
// The name of the previously trained ML model being used to create the inference
// scheduler.
//
// This member is required.
ModelName *string
// The Amazon Resource Name (ARN) of a role with permission to access the data
// source being used for the inference.
//
// This member is required.
RoleArn *string
// The interval (in minutes) of planned delay at the start of each inference
// segment. For example, if inference is set to run every ten minutes, the delay is
// set to five minutes and the time is 09:08. The inference scheduler will wake up
// at the configured interval (which, without a delay configured, would be 09:10)
// plus the additional five minute delay time (so 09:15) to check your Amazon S3
// bucket. The delay provides a buffer for you to upload data at the same
// frequency, so that you don't have to stop and restart the scheduler when
// uploading new data. For more information, see Understanding the inference
// process (https://docs.aws.amazon.com/lookout-for-equipment/latest/ug/understanding-inference-process.html)
// .
DataDelayOffsetInMinutes *int64
// Provides the identifier of the KMS key used to encrypt inference scheduler data
// by Amazon Lookout for Equipment.
ServerSideKmsKeyId *string
// Any tags associated with the inference scheduler.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateInferenceSchedulerOutput struct {
// The Amazon Resource Name (ARN) of the inference scheduler being created.
InferenceSchedulerArn *string
// The name of inference scheduler being created.
InferenceSchedulerName *string
// Indicates the status of the CreateInferenceScheduler operation.
Status types.InferenceSchedulerStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateInferenceSchedulerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateInferenceScheduler{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateInferenceScheduler{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateInferenceSchedulerMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateInferenceSchedulerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInferenceScheduler(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateInferenceScheduler struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateInferenceScheduler) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateInferenceScheduler) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateInferenceSchedulerInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateInferenceSchedulerInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateInferenceSchedulerMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateInferenceScheduler{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateInferenceScheduler(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "CreateInferenceScheduler",
}
}
| 233 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a label for an event.
func (c *Client) CreateLabel(ctx context.Context, params *CreateLabelInput, optFns ...func(*Options)) (*CreateLabelOutput, error) {
if params == nil {
params = &CreateLabelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLabel", params, optFns, c.addOperationCreateLabelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLabelOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLabelInput struct {
// A unique identifier for the request to create a label. If you do not set the
// client request token, Lookout for Equipment generates one.
//
// This member is required.
ClientToken *string
// The end time of the labeled event.
//
// This member is required.
EndTime *time.Time
// The name of a group of labels. Data in this field will be retained for service
// usage. Follow best practices for the security of your data.
//
// This member is required.
LabelGroupName *string
// Indicates whether a labeled event represents an anomaly.
//
// This member is required.
Rating types.LabelRating
// The start time of the labeled event.
//
// This member is required.
StartTime *time.Time
// Indicates that a label pertains to a particular piece of equipment. Data in
// this field will be retained for service usage. Follow best practices for the
// security of your data.
Equipment *string
// Provides additional information about the label. The fault code must be defined
// in the FaultCodes attribute of the label group. Data in this field will be
// retained for service usage. Follow best practices for the security of your data.
FaultCode *string
// Metadata providing additional information about the label. Data in this field
// will be retained for service usage. Follow best practices for the security of
// your data.
Notes *string
noSmithyDocumentSerde
}
type CreateLabelOutput struct {
// The ID of the label that you have created.
LabelId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLabelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateLabel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateLabel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateLabelMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateLabelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLabel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateLabel struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateLabel) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateLabel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateLabelInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateLabelInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateLabelMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateLabel{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateLabel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "CreateLabel",
}
}
| 200 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a group of labels.
func (c *Client) CreateLabelGroup(ctx context.Context, params *CreateLabelGroupInput, optFns ...func(*Options)) (*CreateLabelGroupOutput, error) {
if params == nil {
params = &CreateLabelGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLabelGroup", params, optFns, c.addOperationCreateLabelGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLabelGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLabelGroupInput struct {
// A unique identifier for the request to create a label group. If you do not set
// the client request token, Lookout for Equipment generates one.
//
// This member is required.
ClientToken *string
// Names a group of labels. Data in this field will be retained for service usage.
// Follow best practices for the security of your data.
//
// This member is required.
LabelGroupName *string
// The acceptable fault codes (indicating the type of anomaly associated with the
// label) that can be used with this label group. Data in this field will be
// retained for service usage. Follow best practices for the security of your data.
FaultCodes []string
// Tags that provide metadata about the label group you are creating. Data in this
// field will be retained for service usage. Follow best practices for the security
// of your data.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateLabelGroupOutput struct {
// The ARN of the label group that you have created.
LabelGroupArn *string
// The name of the label group that you have created. Data in this field will be
// retained for service usage. Follow best practices for the security of your data.
LabelGroupName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLabelGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateLabelGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateLabelGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateLabelGroupMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateLabelGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLabelGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateLabelGroup struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateLabelGroup) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateLabelGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateLabelGroupInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateLabelGroupInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateLabelGroupMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateLabelGroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateLabelGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "CreateLabelGroup",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an ML model for data inference. A machine-learning (ML) model is a
// mathematical model that finds patterns in your data. In Amazon Lookout for
// Equipment, the model learns the patterns of normal behavior and detects abnormal
// behavior that could be potential equipment failure (or maintenance events). The
// models are made by analyzing normal data and abnormalities in machine behavior
// that have already occurred. Your model is trained using a portion of the data
// from your dataset and uses that data to learn patterns of normal behavior and
// abnormal patterns that lead to equipment failure. Another portion of the data is
// used to evaluate the model's accuracy.
func (c *Client) CreateModel(ctx context.Context, params *CreateModelInput, optFns ...func(*Options)) (*CreateModelOutput, error) {
if params == nil {
params = &CreateModelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateModel", params, optFns, c.addOperationCreateModelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateModelOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateModelInput struct {
// A unique identifier for the request. If you do not set the client request
// token, Amazon Lookout for Equipment generates one.
//
// This member is required.
ClientToken *string
// The name of the dataset for the ML model being created.
//
// This member is required.
DatasetName *string
// The name for the ML model to be created.
//
// This member is required.
ModelName *string
// The configuration is the TargetSamplingRate , which is the sampling rate of the
// data after post processing by Amazon Lookout for Equipment. For example, if you
// provide data that has been collected at a 1 second level and you want the system
// to resample the data at a 1 minute rate before training, the TargetSamplingRate
// is 1 minute. When providing a value for the TargetSamplingRate , you must attach
// the prefix "PT" to the rate you want. The value for a 1 second rate is therefore
// PT1S, the value for a 15 minute rate is PT15M, and the value for a 1 hour rate
// is PT1H
DataPreProcessingConfiguration *types.DataPreProcessingConfiguration
// The data schema for the ML model being created.
DatasetSchema *types.DatasetSchema
// Indicates the time reference in the dataset that should be used to end the
// subset of evaluation data for the ML model.
EvaluationDataEndTime *time.Time
// Indicates the time reference in the dataset that should be used to begin the
// subset of evaluation data for the ML model.
EvaluationDataStartTime *time.Time
// The input configuration for the labels being used for the ML model that's being
// created.
LabelsInputConfiguration *types.LabelsInputConfiguration
// Indicates that the asset associated with this sensor has been shut off. As long
// as this condition is met, Lookout for Equipment will not use data from this
// asset for training, evaluation, or inference.
OffCondition *string
// The Amazon Resource Name (ARN) of a role with permission to access the data
// source being used to create the ML model.
RoleArn *string
// Provides the identifier of the KMS key used to encrypt model data by Amazon
// Lookout for Equipment.
ServerSideKmsKeyId *string
// Any tags associated with the ML model being created.
Tags []types.Tag
// Indicates the time reference in the dataset that should be used to end the
// subset of training data for the ML model.
TrainingDataEndTime *time.Time
// Indicates the time reference in the dataset that should be used to begin the
// subset of training data for the ML model.
TrainingDataStartTime *time.Time
noSmithyDocumentSerde
}
type CreateModelOutput struct {
// The Amazon Resource Name (ARN) of the model being created.
ModelArn *string
// Indicates the status of the CreateModel operation.
Status types.ModelStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateModelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateModel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateModel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateModelMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateModelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateModel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateModel struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateModel) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateModelInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateModelInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateModelMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateModel{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateModel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "CreateModel",
}
}
| 234 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"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 dataset and associated artifacts. The operation will check to see if
// any inference scheduler or data ingestion job is currently using the dataset,
// and if there isn't, the dataset, its metadata, and any associated data stored in
// S3 will be deleted. This does not affect any models that used this dataset for
// training and evaluation, but does prevent it from being used in the future.
func (c *Client) DeleteDataset(ctx context.Context, params *DeleteDatasetInput, optFns ...func(*Options)) (*DeleteDatasetOutput, error) {
if params == nil {
params = &DeleteDatasetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteDataset", params, optFns, c.addOperationDeleteDatasetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteDatasetOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteDatasetInput struct {
// The name of the dataset to be deleted.
//
// This member is required.
DatasetName *string
noSmithyDocumentSerde
}
type DeleteDatasetOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteDatasetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteDataset{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteDataset{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteDatasetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDataset(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteDataset(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DeleteDataset",
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"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 inference scheduler that has been set up. Already processed output
// results are not affected.
func (c *Client) DeleteInferenceScheduler(ctx context.Context, params *DeleteInferenceSchedulerInput, optFns ...func(*Options)) (*DeleteInferenceSchedulerOutput, error) {
if params == nil {
params = &DeleteInferenceSchedulerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteInferenceScheduler", params, optFns, c.addOperationDeleteInferenceSchedulerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteInferenceSchedulerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteInferenceSchedulerInput struct {
// The name of the inference scheduler to be deleted.
//
// This member is required.
InferenceSchedulerName *string
noSmithyDocumentSerde
}
type DeleteInferenceSchedulerOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteInferenceSchedulerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteInferenceScheduler{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteInferenceScheduler{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteInferenceSchedulerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInferenceScheduler(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteInferenceScheduler(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DeleteInferenceScheduler",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"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 label.
func (c *Client) DeleteLabel(ctx context.Context, params *DeleteLabelInput, optFns ...func(*Options)) (*DeleteLabelOutput, error) {
if params == nil {
params = &DeleteLabelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLabel", params, optFns, c.addOperationDeleteLabelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLabelOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLabelInput struct {
// The name of the label group that contains the label that you want to delete.
// Data in this field will be retained for service usage. Follow best practices for
// the security of your data.
//
// This member is required.
LabelGroupName *string
// The ID of the label that you want to delete.
//
// This member is required.
LabelId *string
noSmithyDocumentSerde
}
type DeleteLabelOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLabelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteLabel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteLabel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteLabelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLabel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteLabel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DeleteLabel",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes a group of labels.
func (c *Client) DeleteLabelGroup(ctx context.Context, params *DeleteLabelGroupInput, optFns ...func(*Options)) (*DeleteLabelGroupOutput, error) {
if params == nil {
params = &DeleteLabelGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLabelGroup", params, optFns, c.addOperationDeleteLabelGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLabelGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLabelGroupInput struct {
// The name of the label group that you want to delete. Data in this field will be
// retained for service usage. Follow best practices for the security of your data.
//
// This member is required.
LabelGroupName *string
noSmithyDocumentSerde
}
type DeleteLabelGroupOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLabelGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteLabelGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteLabelGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteLabelGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLabelGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteLabelGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DeleteLabelGroup",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"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 ML model currently available for Amazon Lookout for Equipment. This
// will prevent it from being used with an inference scheduler, even one that is
// already set up.
func (c *Client) DeleteModel(ctx context.Context, params *DeleteModelInput, optFns ...func(*Options)) (*DeleteModelOutput, error) {
if params == nil {
params = &DeleteModelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteModel", params, optFns, c.addOperationDeleteModelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteModelOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteModelInput struct {
// The name of the ML model to be deleted.
//
// This member is required.
ModelName *string
noSmithyDocumentSerde
}
type DeleteModelOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteModelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteModel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteModel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteModelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteModel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteModel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DeleteModel",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides information on a specific data ingestion job such as creation time,
// dataset ARN, and status.
func (c *Client) DescribeDataIngestionJob(ctx context.Context, params *DescribeDataIngestionJobInput, optFns ...func(*Options)) (*DescribeDataIngestionJobOutput, error) {
if params == nil {
params = &DescribeDataIngestionJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeDataIngestionJob", params, optFns, c.addOperationDescribeDataIngestionJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeDataIngestionJobOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeDataIngestionJobInput struct {
// The job ID of the data ingestion job.
//
// This member is required.
JobId *string
noSmithyDocumentSerde
}
type DescribeDataIngestionJobOutput struct {
// The time at which the data ingestion job was created.
CreatedAt *time.Time
// Indicates the latest timestamp corresponding to data that was successfully
// ingested during this specific ingestion job.
DataEndTime *time.Time
// Gives statistics about a completed ingestion job. These statistics primarily
// relate to quantifying incorrect data such as MissingCompleteSensorData,
// MissingSensorData, UnsupportedDateFormats, InsufficientSensorData, and
// DuplicateTimeStamps.
DataQualitySummary *types.DataQualitySummary
// Indicates the earliest timestamp corresponding to data that was successfully
// ingested during this specific ingestion job.
DataStartTime *time.Time
// The Amazon Resource Name (ARN) of the dataset being used in the data ingestion
// job.
DatasetArn *string
// Specifies the reason for failure when a data ingestion job has failed.
FailedReason *string
// Indicates the size of the ingested dataset.
IngestedDataSize *int64
// Gives statistics about how many files have been ingested, and which files have
// not been ingested, for a particular ingestion job.
IngestedFilesSummary *types.IngestedFilesSummary
// Specifies the S3 location configuration for the data input for the data
// ingestion job.
IngestionInputConfiguration *types.IngestionInputConfiguration
// Indicates the job ID of the data ingestion job.
JobId *string
// The Amazon Resource Name (ARN) of an IAM role with permission to access the
// data source being ingested.
RoleArn *string
// Indicates the status of the DataIngestionJob operation.
Status types.IngestionJobStatus
// Provides details about status of the ingestion job that is currently in
// progress.
StatusDetail *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeDataIngestionJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeDataIngestionJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeDataIngestionJob{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeDataIngestionJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDataIngestionJob(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeDataIngestionJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DescribeDataIngestionJob",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides a JSON description of the data in each time series dataset, including
// names, column names, and data types.
func (c *Client) DescribeDataset(ctx context.Context, params *DescribeDatasetInput, optFns ...func(*Options)) (*DescribeDatasetOutput, error) {
if params == nil {
params = &DescribeDatasetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeDataset", params, optFns, c.addOperationDescribeDatasetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeDatasetOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeDatasetInput struct {
// The name of the dataset to be described.
//
// This member is required.
DatasetName *string
noSmithyDocumentSerde
}
type DescribeDatasetOutput struct {
// Specifies the time the dataset was created in Lookout for Equipment.
CreatedAt *time.Time
// Indicates the latest timestamp corresponding to data that was successfully
// ingested during the most recent ingestion of this particular dataset.
DataEndTime *time.Time
// Gives statistics associated with the given dataset for the latest successful
// associated ingestion job id. These statistics primarily relate to quantifying
// incorrect data such as MissingCompleteSensorData, MissingSensorData,
// UnsupportedDateFormats, InsufficientSensorData, and DuplicateTimeStamps.
DataQualitySummary *types.DataQualitySummary
// Indicates the earliest timestamp corresponding to data that was successfully
// ingested during the most recent ingestion of this particular dataset.
DataStartTime *time.Time
// The Amazon Resource Name (ARN) of the dataset being described.
DatasetArn *string
// The name of the dataset being described.
DatasetName *string
// IngestedFilesSummary associated with the given dataset for the latest
// successful associated ingestion job id.
IngestedFilesSummary *types.IngestedFilesSummary
// Specifies the S3 location configuration for the data input for the data
// ingestion job.
IngestionInputConfiguration *types.IngestionInputConfiguration
// Specifies the time the dataset was last updated, if it was.
LastUpdatedAt *time.Time
// The Amazon Resource Name (ARN) of the IAM role that you are using for this the
// data ingestion job.
RoleArn *string
// A JSON description of the data that is in each time series dataset, including
// names, column names, and data types.
//
// This value conforms to the media type: application/json
Schema *string
// Provides the identifier of the KMS key used to encrypt dataset data by Amazon
// Lookout for Equipment.
ServerSideKmsKeyId *string
// Indicates the status of the dataset.
Status types.DatasetStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeDatasetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeDataset{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeDataset{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeDatasetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDataset(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeDataset(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DescribeDataset",
}
}
| 175 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Specifies information about the inference scheduler being used, including name,
// model, status, and associated metadata
func (c *Client) DescribeInferenceScheduler(ctx context.Context, params *DescribeInferenceSchedulerInput, optFns ...func(*Options)) (*DescribeInferenceSchedulerOutput, error) {
if params == nil {
params = &DescribeInferenceSchedulerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeInferenceScheduler", params, optFns, c.addOperationDescribeInferenceSchedulerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeInferenceSchedulerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeInferenceSchedulerInput struct {
// The name of the inference scheduler being described.
//
// This member is required.
InferenceSchedulerName *string
noSmithyDocumentSerde
}
type DescribeInferenceSchedulerOutput struct {
// Specifies the time at which the inference scheduler was created.
CreatedAt *time.Time
// A period of time (in minutes) by which inference on the data is delayed after
// the data starts. For instance, if you select an offset delay time of five
// minutes, inference will not begin on the data until the first data measurement
// after the five minute mark. For example, if five minutes is selected, the
// inference scheduler will wake up at the configured frequency with the additional
// five minute delay time to check the customer S3 bucket. The customer can upload
// data at the same frequency and they don't need to stop and restart the scheduler
// when uploading new data.
DataDelayOffsetInMinutes *int64
// Specifies configuration information for the input data for the inference
// scheduler, including delimiter, format, and dataset location.
DataInputConfiguration *types.InferenceInputConfiguration
// Specifies information for the output results for the inference scheduler,
// including the output S3 location.
DataOutputConfiguration *types.InferenceOutputConfiguration
// Specifies how often data is uploaded to the source S3 bucket for the input
// data. This value is the length of time between data uploads. For instance, if
// you select 5 minutes, Amazon Lookout for Equipment will upload the real-time
// data to the source bucket once every 5 minutes. This frequency also determines
// how often Amazon Lookout for Equipment starts a scheduled inference on your
// data. In this example, it starts once every 5 minutes.
DataUploadFrequency types.DataUploadFrequency
// The Amazon Resource Name (ARN) of the inference scheduler being described.
InferenceSchedulerArn *string
// The name of the inference scheduler being described.
InferenceSchedulerName *string
// Indicates whether the latest execution for the inference scheduler was
// Anomalous (anomalous events found) or Normal (no anomalous events found).
LatestInferenceResult types.LatestInferenceResult
// The Amazon Resource Name (ARN) of the ML model of the inference scheduler being
// described.
ModelArn *string
// The name of the ML model of the inference scheduler being described.
ModelName *string
// The Amazon Resource Name (ARN) of a role with permission to access the data
// source for the inference scheduler being described.
RoleArn *string
// Provides the identifier of the KMS key used to encrypt inference scheduler data
// by Amazon Lookout for Equipment.
ServerSideKmsKeyId *string
// Indicates the status of the inference scheduler.
Status types.InferenceSchedulerStatus
// Specifies the time at which the inference scheduler was last updated, if it was.
UpdatedAt *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeInferenceSchedulerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeInferenceScheduler{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeInferenceScheduler{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeInferenceSchedulerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeInferenceScheduler(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeInferenceScheduler(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DescribeInferenceScheduler",
}
}
| 184 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns the name of the label.
func (c *Client) DescribeLabel(ctx context.Context, params *DescribeLabelInput, optFns ...func(*Options)) (*DescribeLabelOutput, error) {
if params == nil {
params = &DescribeLabelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeLabel", params, optFns, c.addOperationDescribeLabelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeLabelOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeLabelInput struct {
// Returns the name of the group containing the label.
//
// This member is required.
LabelGroupName *string
// Returns the ID of the label.
//
// This member is required.
LabelId *string
noSmithyDocumentSerde
}
type DescribeLabelOutput struct {
// The time at which the label was created.
CreatedAt *time.Time
// The end time of the requested label.
EndTime *time.Time
// Indicates that a label pertains to a particular piece of equipment.
Equipment *string
// Indicates the type of anomaly associated with the label. Data in this field
// will be retained for service usage. Follow best practices for the security of
// your data.
FaultCode *string
// The ARN of the requested label group.
LabelGroupArn *string
// The name of the requested label group.
LabelGroupName *string
// The ID of the requested label.
LabelId *string
// Metadata providing additional information about the label. Data in this field
// will be retained for service usage. Follow best practices for the security of
// your data.
Notes *string
// Indicates whether a labeled event represents an anomaly.
Rating types.LabelRating
// The start time of the requested label.
StartTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeLabelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeLabel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeLabel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeLabelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLabel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeLabel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DescribeLabel",
}
}
| 162 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns information about the label group.
func (c *Client) DescribeLabelGroup(ctx context.Context, params *DescribeLabelGroupInput, optFns ...func(*Options)) (*DescribeLabelGroupOutput, error) {
if params == nil {
params = &DescribeLabelGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeLabelGroup", params, optFns, c.addOperationDescribeLabelGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeLabelGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeLabelGroupInput struct {
// Returns the name of the label group.
//
// This member is required.
LabelGroupName *string
noSmithyDocumentSerde
}
type DescribeLabelGroupOutput struct {
// The time at which the label group was created.
CreatedAt *time.Time
// Codes indicating the type of anomaly associated with the labels in the lagbel
// group.
FaultCodes []string
// The ARN of the label group.
LabelGroupArn *string
// The name of the label group.
LabelGroupName *string
// The time at which the label group was updated.
UpdatedAt *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeLabelGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeLabelGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeLabelGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeLabelGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLabelGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeLabelGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DescribeLabelGroup",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lookoutequipment
import (
"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/lookoutequipment/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides a JSON containing the overall information about a specific ML model,
// including model name and ARN, dataset, training and evaluation information,
// status, and so on.
func (c *Client) DescribeModel(ctx context.Context, params *DescribeModelInput, optFns ...func(*Options)) (*DescribeModelOutput, error) {
if params == nil {
params = &DescribeModelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeModel", params, optFns, c.addOperationDescribeModelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeModelOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeModelInput struct {
// The name of the ML model to be described.
//
// This member is required.
ModelName *string
noSmithyDocumentSerde
}
type DescribeModelOutput struct {
// Indicates the time and date at which the ML model was created.
CreatedAt *time.Time
// The configuration is the TargetSamplingRate , which is the sampling rate of the
// data after post processing by Amazon Lookout for Equipment. For example, if you
// provide data that has been collected at a 1 second level and you want the system
// to resample the data at a 1 minute rate before training, the TargetSamplingRate
// is 1 minute. When providing a value for the TargetSamplingRate , you must attach
// the prefix "PT" to the rate you want. The value for a 1 second rate is therefore
// PT1S, the value for a 15 minute rate is PT15M, and the value for a 1 hour rate
// is PT1H
DataPreProcessingConfiguration *types.DataPreProcessingConfiguration
// The Amazon Resouce Name (ARN) of the dataset used to create the ML model being
// described.
DatasetArn *string
// The name of the dataset being used by the ML being described.
DatasetName *string
// Indicates the time reference in the dataset that was used to end the subset of
// evaluation data for the ML model.
EvaluationDataEndTime *time.Time
// Indicates the time reference in the dataset that was used to begin the subset
// of evaluation data for the ML model.
EvaluationDataStartTime *time.Time
// If the training of the ML model failed, this indicates the reason for that
// failure.
FailedReason *string
// Specifies configuration information about the labels input, including its S3
// location.
LabelsInputConfiguration *types.LabelsInputConfiguration
// Indicates the last time the ML model was updated. The type of update is not
// specified.
LastUpdatedTime *time.Time
// The Amazon Resource Name (ARN) of the ML model being described.
ModelArn *string
// The Model Metrics show an aggregated summary of the model's performance within
// the evaluation time range. This is the JSON content of the metrics created when
// evaluating the model.
//
// This value conforms to the media type: application/json
ModelMetrics *string
// The name of the ML model being described.
ModelName *string
// Indicates that the asset associated with this sensor has been shut off. As long
// as this condition is met, Lookout for Equipment will not use data from this
// asset for training, evaluation, or inference.
OffCondition *string
// The Amazon Resource Name (ARN) of a role with permission to access the data
// source for the ML model being described.
RoleArn *string
// A JSON description of the data that is in each time series dataset, including
// names, column names, and data types.
//
// This value conforms to the media type: application/json
Schema *string
// Provides the identifier of the KMS key used to encrypt model data by Amazon
// Lookout for Equipment.
ServerSideKmsKeyId *string
// Specifies the current status of the model being described. Status describes the
// status of the most recent action of the model.
Status types.ModelStatus
// Indicates the time reference in the dataset that was used to end the subset of
// training data for the ML model.
TrainingDataEndTime *time.Time
// Indicates the time reference in the dataset that was used to begin the subset
// of training data for the ML model.
TrainingDataStartTime *time.Time
// Indicates the time at which the training of the ML model was completed.
TrainingExecutionEndTime *time.Time
// Indicates the time at which the training of the ML model began.
TrainingExecutionStartTime *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeModelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeModel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeModel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeModelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeModel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDescribeModel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lookoutequipment",
OperationName: "DescribeModel",
}
}
| 215 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.