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 iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves information about a gateway.
func (c *Client) DescribeGateway(ctx context.Context, params *DescribeGatewayInput, optFns ...func(*Options)) (*DescribeGatewayOutput, error) {
if params == nil {
params = &DescribeGatewayInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeGateway", params, optFns, c.addOperationDescribeGatewayMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeGatewayOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeGatewayInput struct {
// The ID of the gateway device.
//
// This member is required.
GatewayId *string
noSmithyDocumentSerde
}
type DescribeGatewayOutput struct {
// The date the gateway was created, in Unix epoch time.
//
// This member is required.
CreationDate *time.Time
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the gateway, which has the following format.
// arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}
//
// This member is required.
GatewayArn *string
// A list of gateway capability summaries that each contain a namespace and
// status. Each gateway capability defines data sources for the gateway. To
// retrieve a capability configuration's definition, use
// DescribeGatewayCapabilityConfiguration (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGatewayCapabilityConfiguration.html)
// .
//
// This member is required.
GatewayCapabilitySummaries []types.GatewayCapabilitySummary
// The ID of the gateway device.
//
// This member is required.
GatewayId *string
// The name of the gateway.
//
// This member is required.
GatewayName *string
// The date the gateway was last updated, in Unix epoch time.
//
// This member is required.
LastUpdateDate *time.Time
// The gateway's platform.
GatewayPlatform *types.GatewayPlatform
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeGateway{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeGateway{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeGatewayMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeGatewayValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeGateway(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeGatewayMiddleware struct {
}
func (*endpointPrefix_opDescribeGatewayMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeGatewayMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeGatewayMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeGatewayMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeGateway(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "DescribeGateway",
}
}
| 193 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves information about a gateway capability configuration. Each gateway
// capability defines data sources for a gateway. A capability configuration can
// contain multiple data source configurations. If you define OPC-UA sources for a
// gateway in the IoT SiteWise console, all of your OPC-UA sources are stored in
// one capability configuration. To list all capability configurations for a
// gateway, use DescribeGateway (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGateway.html)
// .
func (c *Client) DescribeGatewayCapabilityConfiguration(ctx context.Context, params *DescribeGatewayCapabilityConfigurationInput, optFns ...func(*Options)) (*DescribeGatewayCapabilityConfigurationOutput, error) {
if params == nil {
params = &DescribeGatewayCapabilityConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeGatewayCapabilityConfiguration", params, optFns, c.addOperationDescribeGatewayCapabilityConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeGatewayCapabilityConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeGatewayCapabilityConfigurationInput struct {
// The namespace of the capability configuration. For example, if you configure
// OPC-UA sources from the IoT SiteWise console, your OPC-UA capability
// configuration has the namespace iotsitewise:opcuacollector:version , where
// version is a number such as 1 .
//
// This member is required.
CapabilityNamespace *string
// The ID of the gateway that defines the capability configuration.
//
// This member is required.
GatewayId *string
noSmithyDocumentSerde
}
type DescribeGatewayCapabilityConfigurationOutput struct {
// The JSON document that defines the gateway capability's configuration. For more
// information, see Configuring data sources (CLI) (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/configure-sources.html#configure-source-cli)
// in the IoT SiteWise User Guide.
//
// This member is required.
CapabilityConfiguration *string
// The namespace of the gateway capability.
//
// This member is required.
CapabilityNamespace *string
// The synchronization status of the capability configuration. The sync status can
// be one of the following:
// - IN_SYNC – The gateway is running the capability configuration.
// - OUT_OF_SYNC – The gateway hasn't received the capability configuration.
// - SYNC_FAILED – The gateway rejected the capability configuration.
//
// This member is required.
CapabilitySyncStatus types.CapabilitySyncStatus
// The ID of the gateway that defines the capability configuration.
//
// This member is required.
GatewayId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeGatewayCapabilityConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeGatewayCapabilityConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeGatewayCapabilityConfigurationMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeGatewayCapabilityConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeGatewayCapabilityConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeGatewayCapabilityConfigurationMiddleware struct {
}
func (*endpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeGatewayCapabilityConfigurationMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeGatewayCapabilityConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "DescribeGatewayCapabilityConfiguration",
}
}
| 193 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the current IoT SiteWise logging options.
func (c *Client) DescribeLoggingOptions(ctx context.Context, params *DescribeLoggingOptionsInput, optFns ...func(*Options)) (*DescribeLoggingOptionsOutput, error) {
if params == nil {
params = &DescribeLoggingOptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeLoggingOptions", params, optFns, c.addOperationDescribeLoggingOptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeLoggingOptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeLoggingOptionsInput struct {
noSmithyDocumentSerde
}
type DescribeLoggingOptionsOutput struct {
// The current logging options.
//
// This member is required.
LoggingOptions *types.LoggingOptions
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeLoggingOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeLoggingOptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeLoggingOptions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeLoggingOptionsMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLoggingOptions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeLoggingOptionsMiddleware struct {
}
func (*endpointPrefix_opDescribeLoggingOptionsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeLoggingOptionsMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeLoggingOptionsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeLoggingOptionsMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeLoggingOptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "DescribeLoggingOptions",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
import (
"context"
"errors"
"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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
smithywaiter "github.com/aws/smithy-go/waiter"
"github.com/jmespath/go-jmespath"
"time"
)
// Retrieves information about a portal.
func (c *Client) DescribePortal(ctx context.Context, params *DescribePortalInput, optFns ...func(*Options)) (*DescribePortalOutput, error) {
if params == nil {
params = &DescribePortalInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribePortal", params, optFns, c.addOperationDescribePortalMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribePortalOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribePortalInput struct {
// The ID of the portal.
//
// This member is required.
PortalId *string
noSmithyDocumentSerde
}
type DescribePortalOutput struct {
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the portal, which has the following format.
// arn:${Partition}:iotsitewise:${Region}:${Account}:portal/${PortalId}
//
// This member is required.
PortalArn *string
// The IAM Identity Center application generated client ID (used with IAM Identity
// Center APIs). IoT SiteWise includes portalClientId for only portals that use
// IAM Identity Center to authenticate users.
//
// This member is required.
PortalClientId *string
// The Amazon Web Services administrator's contact email address.
//
// This member is required.
PortalContactEmail *string
// The date the portal was created, in Unix epoch time.
//
// This member is required.
PortalCreationDate *time.Time
// The ID of the portal.
//
// This member is required.
PortalId *string
// The date the portal was last updated, in Unix epoch time.
//
// This member is required.
PortalLastUpdateDate *time.Time
// The name of the portal.
//
// This member is required.
PortalName *string
// The URL for the IoT SiteWise Monitor portal. You can use this URL to access
// portals that use IAM Identity Center for authentication. For portals that use
// IAM for authentication, you must use the IoT SiteWise console to get a URL that
// you can use to access the portal.
//
// This member is required.
PortalStartUrl *string
// The current status of the portal, which contains a state and any error message.
//
// This member is required.
PortalStatus *types.PortalStatus
// Contains the configuration information of an alarm created in an IoT SiteWise
// Monitor portal.
Alarms *types.Alarms
// The email address that sends alarm notifications.
NotificationSenderEmail *string
// The service to use to authenticate users to the portal.
PortalAuthMode types.AuthMode
// The portal's description.
PortalDescription *string
// The portal's logo image, which is available at a URL.
PortalLogoImageLocation *types.ImageLocation
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the service role that allows the portal's users to access your IoT SiteWise
// resources on your behalf. For more information, see Using service roles for IoT
// SiteWise Monitor (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html)
// in the IoT SiteWise User Guide.
RoleArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribePortalMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribePortal{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribePortal{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribePortalMiddleware(stack); err != nil {
return err
}
if err = addOpDescribePortalValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePortal(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribePortalMiddleware struct {
}
func (*endpointPrefix_opDescribePortalMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribePortalMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribePortalMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribePortalMiddleware{}, `OperationSerializer`, middleware.After)
}
// DescribePortalAPIClient is a client that implements the DescribePortal
// operation.
type DescribePortalAPIClient interface {
DescribePortal(context.Context, *DescribePortalInput, ...func(*Options)) (*DescribePortalOutput, error)
}
var _ DescribePortalAPIClient = (*Client)(nil)
// PortalActiveWaiterOptions are waiter options for PortalActiveWaiter
type PortalActiveWaiterOptions 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
// MinDelay is the minimum amount of time to delay between retries. If unset,
// PortalActiveWaiter will use default minimum delay of 3 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, PortalActiveWaiter will use default max delay of 120 seconds. Note
// that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribePortalInput, *DescribePortalOutput, error) (bool, error)
}
// PortalActiveWaiter defines the waiters for PortalActive
type PortalActiveWaiter struct {
client DescribePortalAPIClient
options PortalActiveWaiterOptions
}
// NewPortalActiveWaiter constructs a PortalActiveWaiter.
func NewPortalActiveWaiter(client DescribePortalAPIClient, optFns ...func(*PortalActiveWaiterOptions)) *PortalActiveWaiter {
options := PortalActiveWaiterOptions{}
options.MinDelay = 3 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = portalActiveStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &PortalActiveWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for PortalActive waiter. The maxWaitDur is the
// maximum wait duration the waiter will wait. The maxWaitDur is required and must
// be greater than zero.
func (w *PortalActiveWaiter) Wait(ctx context.Context, params *DescribePortalInput, maxWaitDur time.Duration, optFns ...func(*PortalActiveWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for PortalActive waiter and returns the
// output of the successful operation. The maxWaitDur is the maximum wait duration
// the waiter will wait. The maxWaitDur is required and must be greater than zero.
func (w *PortalActiveWaiter) WaitForOutput(ctx context.Context, params *DescribePortalInput, maxWaitDur time.Duration, optFns ...func(*PortalActiveWaiterOptions)) (*DescribePortalOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribePortal(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for PortalActive waiter")
}
func portalActiveStateRetryable(ctx context.Context, input *DescribePortalInput, output *DescribePortalOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("portalStatus.state", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "ACTIVE"
value, ok := pathValue.(types.PortalState)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.PortalState value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
return true, nil
}
// PortalNotExistsWaiterOptions are waiter options for PortalNotExistsWaiter
type PortalNotExistsWaiterOptions 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
// MinDelay is the minimum amount of time to delay between retries. If unset,
// PortalNotExistsWaiter will use default minimum delay of 3 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, PortalNotExistsWaiter will use default max delay of 120 seconds.
// Note that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribePortalInput, *DescribePortalOutput, error) (bool, error)
}
// PortalNotExistsWaiter defines the waiters for PortalNotExists
type PortalNotExistsWaiter struct {
client DescribePortalAPIClient
options PortalNotExistsWaiterOptions
}
// NewPortalNotExistsWaiter constructs a PortalNotExistsWaiter.
func NewPortalNotExistsWaiter(client DescribePortalAPIClient, optFns ...func(*PortalNotExistsWaiterOptions)) *PortalNotExistsWaiter {
options := PortalNotExistsWaiterOptions{}
options.MinDelay = 3 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = portalNotExistsStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &PortalNotExistsWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for PortalNotExists waiter. The maxWaitDur is
// the maximum wait duration the waiter will wait. The maxWaitDur is required and
// must be greater than zero.
func (w *PortalNotExistsWaiter) Wait(ctx context.Context, params *DescribePortalInput, maxWaitDur time.Duration, optFns ...func(*PortalNotExistsWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for PortalNotExists waiter and returns
// the output of the successful operation. The maxWaitDur is the maximum wait
// duration the waiter will wait. The maxWaitDur is required and must be greater
// than zero.
func (w *PortalNotExistsWaiter) WaitForOutput(ctx context.Context, params *DescribePortalInput, maxWaitDur time.Duration, optFns ...func(*PortalNotExistsWaiterOptions)) (*DescribePortalOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribePortal(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for PortalNotExists waiter")
}
func portalNotExistsStateRetryable(ctx context.Context, input *DescribePortalInput, output *DescribePortalOutput, err error) (bool, error) {
if err != nil {
var errorType *types.ResourceNotFoundException
if errors.As(err, &errorType) {
return false, nil
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribePortal(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "DescribePortal",
}
}
| 550 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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"
"time"
)
// Retrieves information about a project.
func (c *Client) DescribeProject(ctx context.Context, params *DescribeProjectInput, optFns ...func(*Options)) (*DescribeProjectOutput, error) {
if params == nil {
params = &DescribeProjectInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeProject", params, optFns, c.addOperationDescribeProjectMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeProjectOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeProjectInput struct {
// The ID of the project.
//
// This member is required.
ProjectId *string
noSmithyDocumentSerde
}
type DescribeProjectOutput struct {
// The ID of the portal that the project is in.
//
// This member is required.
PortalId *string
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the project, which has the following format.
// arn:${Partition}:iotsitewise:${Region}:${Account}:project/${ProjectId}
//
// This member is required.
ProjectArn *string
// The date the project was created, in Unix epoch time.
//
// This member is required.
ProjectCreationDate *time.Time
// The ID of the project.
//
// This member is required.
ProjectId *string
// The date the project was last updated, in Unix epoch time.
//
// This member is required.
ProjectLastUpdateDate *time.Time
// The name of the project.
//
// This member is required.
ProjectName *string
// The project's description.
ProjectDescription *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeProjectMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeProject{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeProject{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeProjectMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeProjectValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeProject(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeProjectMiddleware struct {
}
func (*endpointPrefix_opDescribeProjectMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeProjectMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeProjectMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeProjectMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeProject(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "DescribeProject",
}
}
| 188 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves information about the storage configuration for IoT SiteWise.
func (c *Client) DescribeStorageConfiguration(ctx context.Context, params *DescribeStorageConfigurationInput, optFns ...func(*Options)) (*DescribeStorageConfigurationOutput, error) {
if params == nil {
params = &DescribeStorageConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStorageConfiguration", params, optFns, c.addOperationDescribeStorageConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeStorageConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeStorageConfigurationInput struct {
noSmithyDocumentSerde
}
type DescribeStorageConfigurationOutput struct {
// Contains current status information for the configuration.
//
// This member is required.
ConfigurationStatus *types.ConfigurationStatus
// The storage tier that you specified for your data. The storageType parameter
// can be one of the following values:
// - SITEWISE_DEFAULT_STORAGE – IoT SiteWise saves your data into the hot tier.
// The hot tier is a service-managed database.
// - MULTI_LAYER_STORAGE – IoT SiteWise saves your data in both the cold tier and
// the hot tier. The cold tier is a customer-managed Amazon S3 bucket.
//
// This member is required.
StorageType types.StorageType
// Contains the storage configuration for time series (data streams) that aren't
// associated with asset properties. The disassociatedDataStorage can be one of
// the following values:
// - ENABLED – IoT SiteWise accepts time series that aren't associated with asset
// properties. After the disassociatedDataStorage is enabled, you can't disable
// it.
// - DISABLED – IoT SiteWise doesn't accept time series (data streams) that
// aren't associated with asset properties.
// For more information, see Data streams (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/data-streams.html)
// in the IoT SiteWise User Guide.
DisassociatedDataStorage types.DisassociatedDataStorageState
// The date the storage configuration was last updated, in Unix epoch time.
LastUpdateDate *time.Time
// Contains information about the storage destination.
MultiLayerStorage *types.MultiLayerStorage
// How many days your data is kept in the hot tier. By default, your data is kept
// indefinitely in the hot tier.
RetentionPeriod *types.RetentionPeriod
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeStorageConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeStorageConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeStorageConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeStorageConfigurationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeStorageConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeStorageConfigurationMiddleware struct {
}
func (*endpointPrefix_opDescribeStorageConfigurationMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeStorageConfigurationMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeStorageConfigurationMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeStorageConfigurationMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeStorageConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "DescribeStorageConfiguration",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves information about a time series (data stream). To identify a time
// series, do one of the following:
// - If the time series isn't associated with an asset property, specify the
// alias of the time series.
// - If the time series is associated with an asset property, specify one of the
// following:
// - The alias of the time series.
// - The assetId and propertyId that identifies the asset property.
func (c *Client) DescribeTimeSeries(ctx context.Context, params *DescribeTimeSeriesInput, optFns ...func(*Options)) (*DescribeTimeSeriesOutput, error) {
if params == nil {
params = &DescribeTimeSeriesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeTimeSeries", params, optFns, c.addOperationDescribeTimeSeriesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeTimeSeriesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeTimeSeriesInput struct {
// The alias that identifies the time series.
Alias *string
// The ID of the asset in which the asset property was created.
AssetId *string
// The ID of the asset property.
PropertyId *string
noSmithyDocumentSerde
}
type DescribeTimeSeriesOutput struct {
// The data type of the time series. If you specify STRUCT , you must also specify
// dataTypeSpec to identify the type of the structure for this time series.
//
// This member is required.
DataType types.PropertyDataType
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the time series, which has the following format.
// arn:${Partition}:iotsitewise:${Region}:${Account}:time-series/${TimeSeriesId}
//
// This member is required.
TimeSeriesArn *string
// The date that the time series was created, in Unix epoch time.
//
// This member is required.
TimeSeriesCreationDate *time.Time
// The ID of the time series.
//
// This member is required.
TimeSeriesId *string
// The date that the time series was last updated, in Unix epoch time.
//
// This member is required.
TimeSeriesLastUpdateDate *time.Time
// The alias that identifies the time series.
Alias *string
// The ID of the asset in which the asset property was created.
AssetId *string
// The data type of the structure for this time series. This parameter is required
// for time series that have the STRUCT data type. The options for this parameter
// depend on the type of the composite model in which you created the asset
// property that is associated with your time series. Use AWS/ALARM_STATE for
// alarm state in alarm composite models.
DataTypeSpec *string
// The ID of the asset property.
PropertyId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeTimeSeriesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeTimeSeries{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeTimeSeries{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeTimeSeriesMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTimeSeries(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeTimeSeriesMiddleware struct {
}
func (*endpointPrefix_opDescribeTimeSeriesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDescribeTimeSeriesMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDescribeTimeSeriesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDescribeTimeSeriesMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opDescribeTimeSeries(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "DescribeTimeSeries",
}
}
| 206 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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"
)
// Disassociates a child asset from the given parent asset through a hierarchy
// defined in the parent asset's model.
func (c *Client) DisassociateAssets(ctx context.Context, params *DisassociateAssetsInput, optFns ...func(*Options)) (*DisassociateAssetsOutput, error) {
if params == nil {
params = &DisassociateAssetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateAssets", params, optFns, c.addOperationDisassociateAssetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateAssetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateAssetsInput struct {
// The ID of the parent asset from which to disassociate the child asset.
//
// This member is required.
AssetId *string
// The ID of the child asset to disassociate.
//
// This member is required.
ChildAssetId *string
// The ID of a hierarchy in the parent asset's model. Hierarchies allow different
// groupings of assets to be formed that all come from the same asset model. You
// can use the hierarchy ID to identify the correct asset to disassociate. For more
// information, see Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html)
// in the IoT SiteWise User Guide.
//
// This member is required.
HierarchyId *string
// A unique case-sensitive identifier that you can provide to ensure the
// idempotency of the request. Don't reuse this client token if a new idempotent
// request is required.
ClientToken *string
noSmithyDocumentSerde
}
type DisassociateAssetsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateAssetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateAssets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateAssets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDisassociateAssetsMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDisassociateAssetsMiddleware(stack, options); err != nil {
return err
}
if err = addOpDisassociateAssetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateAssets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDisassociateAssetsMiddleware struct {
}
func (*endpointPrefix_opDisassociateAssetsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDisassociateAssetsMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDisassociateAssetsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDisassociateAssetsMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpDisassociateAssets struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDisassociateAssets) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDisassociateAssets) 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.(*DisassociateAssetsInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DisassociateAssetsInput ")
}
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_opDisassociateAssetsMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDisassociateAssets{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDisassociateAssets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "DisassociateAssets",
}
}
| 207 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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"
)
// Disassociates a time series (data stream) from an asset property.
func (c *Client) DisassociateTimeSeriesFromAssetProperty(ctx context.Context, params *DisassociateTimeSeriesFromAssetPropertyInput, optFns ...func(*Options)) (*DisassociateTimeSeriesFromAssetPropertyOutput, error) {
if params == nil {
params = &DisassociateTimeSeriesFromAssetPropertyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateTimeSeriesFromAssetProperty", params, optFns, c.addOperationDisassociateTimeSeriesFromAssetPropertyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateTimeSeriesFromAssetPropertyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateTimeSeriesFromAssetPropertyInput struct {
// The alias that identifies the time series.
//
// This member is required.
Alias *string
// The ID of the asset in which the asset property was created.
//
// This member is required.
AssetId *string
// The ID of the asset property.
//
// This member is required.
PropertyId *string
// A unique case-sensitive identifier that you can provide to ensure the
// idempotency of the request. Don't reuse this client token if a new idempotent
// request is required.
ClientToken *string
noSmithyDocumentSerde
}
type DisassociateTimeSeriesFromAssetPropertyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateTimeSeriesFromAssetPropertyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateTimeSeriesFromAssetProperty{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDisassociateTimeSeriesFromAssetPropertyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDisassociateTimeSeriesFromAssetPropertyMiddleware(stack, options); err != nil {
return err
}
if err = addOpDisassociateTimeSeriesFromAssetPropertyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateTimeSeriesFromAssetProperty(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDisassociateTimeSeriesFromAssetPropertyMiddleware struct {
}
func (*endpointPrefix_opDisassociateTimeSeriesFromAssetPropertyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opDisassociateTimeSeriesFromAssetPropertyMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opDisassociateTimeSeriesFromAssetPropertyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opDisassociateTimeSeriesFromAssetPropertyMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpDisassociateTimeSeriesFromAssetProperty struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDisassociateTimeSeriesFromAssetProperty) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDisassociateTimeSeriesFromAssetProperty) 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.(*DisassociateTimeSeriesFromAssetPropertyInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DisassociateTimeSeriesFromAssetPropertyInput ")
}
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_opDisassociateTimeSeriesFromAssetPropertyMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDisassociateTimeSeriesFromAssetProperty{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDisassociateTimeSeriesFromAssetProperty(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "DisassociateTimeSeriesFromAssetProperty",
}
}
| 202 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets aggregated values for an asset property. For more information, see
// Querying aggregates (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#aggregates)
// in the IoT SiteWise User Guide. To identify an asset property, you must specify
// one of the following:
// - The assetId and propertyId of an asset property.
// - A propertyAlias , which is a data stream alias (for example,
// /company/windfarm/3/turbine/7/temperature ). To define an asset property's
// alias, see UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html)
// .
func (c *Client) GetAssetPropertyAggregates(ctx context.Context, params *GetAssetPropertyAggregatesInput, optFns ...func(*Options)) (*GetAssetPropertyAggregatesOutput, error) {
if params == nil {
params = &GetAssetPropertyAggregatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetAssetPropertyAggregates", params, optFns, c.addOperationGetAssetPropertyAggregatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetAssetPropertyAggregatesOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetAssetPropertyAggregatesInput struct {
// The data aggregating function.
//
// This member is required.
AggregateTypes []types.AggregateType
// The inclusive end of the range from which to query historical data, expressed
// in seconds in Unix epoch time.
//
// This member is required.
EndDate *time.Time
// The time interval over which to aggregate data.
//
// This member is required.
Resolution *string
// The exclusive start of the range from which to query historical data, expressed
// in seconds in Unix epoch time.
//
// This member is required.
StartDate *time.Time
// The ID of the asset.
AssetId *string
// The maximum number of results to return for each paginated request. A result
// set is returned in the two cases, whichever occurs first.
// - The size of the result set is equal to 1 MB.
// - The number of data points in the result set is equal to the value of
// maxResults . The maximum value of maxResults is 250.
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
PropertyAlias *string
// The ID of the asset property.
PropertyId *string
// The quality by which to filter asset data.
Qualities []types.Quality
// The chronological sorting order of the requested information. Default: ASCENDING
TimeOrdering types.TimeOrdering
noSmithyDocumentSerde
}
type GetAssetPropertyAggregatesOutput struct {
// The requested aggregated values.
//
// This member is required.
AggregatedValues []types.AggregatedValue
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetAssetPropertyAggregatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAssetPropertyAggregates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAssetPropertyAggregates{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opGetAssetPropertyAggregatesMiddleware(stack); err != nil {
return err
}
if err = addOpGetAssetPropertyAggregatesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAssetPropertyAggregates(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetAssetPropertyAggregatesMiddleware struct {
}
func (*endpointPrefix_opGetAssetPropertyAggregatesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetAssetPropertyAggregatesMiddleware) 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 = "data." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetAssetPropertyAggregatesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyAggregatesMiddleware{}, `OperationSerializer`, middleware.After)
}
// GetAssetPropertyAggregatesAPIClient is a client that implements the
// GetAssetPropertyAggregates operation.
type GetAssetPropertyAggregatesAPIClient interface {
GetAssetPropertyAggregates(context.Context, *GetAssetPropertyAggregatesInput, ...func(*Options)) (*GetAssetPropertyAggregatesOutput, error)
}
var _ GetAssetPropertyAggregatesAPIClient = (*Client)(nil)
// GetAssetPropertyAggregatesPaginatorOptions is the paginator options for
// GetAssetPropertyAggregates
type GetAssetPropertyAggregatesPaginatorOptions struct {
// The maximum number of results to return for each paginated request. A result
// set is returned in the two cases, whichever occurs first.
// - The size of the result set is equal to 1 MB.
// - The number of data points in the result set is equal to the value of
// maxResults . The maximum value of maxResults is 250.
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
}
// GetAssetPropertyAggregatesPaginator is a paginator for
// GetAssetPropertyAggregates
type GetAssetPropertyAggregatesPaginator struct {
options GetAssetPropertyAggregatesPaginatorOptions
client GetAssetPropertyAggregatesAPIClient
params *GetAssetPropertyAggregatesInput
nextToken *string
firstPage bool
}
// NewGetAssetPropertyAggregatesPaginator returns a new
// GetAssetPropertyAggregatesPaginator
func NewGetAssetPropertyAggregatesPaginator(client GetAssetPropertyAggregatesAPIClient, params *GetAssetPropertyAggregatesInput, optFns ...func(*GetAssetPropertyAggregatesPaginatorOptions)) *GetAssetPropertyAggregatesPaginator {
if params == nil {
params = &GetAssetPropertyAggregatesInput{}
}
options := GetAssetPropertyAggregatesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetAssetPropertyAggregatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetAssetPropertyAggregatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetAssetPropertyAggregates page.
func (p *GetAssetPropertyAggregatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAssetPropertyAggregatesOutput, 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.GetAssetPropertyAggregates(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_opGetAssetPropertyAggregates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "GetAssetPropertyAggregates",
}
}
| 313 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets an asset property's current value. For more information, see Querying
// current values (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#current-values)
// in the IoT SiteWise User Guide. To identify an asset property, you must specify
// one of the following:
// - The assetId and propertyId of an asset property.
// - A propertyAlias , which is a data stream alias (for example,
// /company/windfarm/3/turbine/7/temperature ). To define an asset property's
// alias, see UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html)
// .
func (c *Client) GetAssetPropertyValue(ctx context.Context, params *GetAssetPropertyValueInput, optFns ...func(*Options)) (*GetAssetPropertyValueOutput, error) {
if params == nil {
params = &GetAssetPropertyValueInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetAssetPropertyValue", params, optFns, c.addOperationGetAssetPropertyValueMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetAssetPropertyValueOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetAssetPropertyValueInput struct {
// The ID of the asset.
AssetId *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
PropertyAlias *string
// The ID of the asset property.
PropertyId *string
noSmithyDocumentSerde
}
type GetAssetPropertyValueOutput struct {
// The current asset property value.
PropertyValue *types.AssetPropertyValue
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetAssetPropertyValueMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAssetPropertyValue{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAssetPropertyValue{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opGetAssetPropertyValueMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAssetPropertyValue(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetAssetPropertyValueMiddleware struct {
}
func (*endpointPrefix_opGetAssetPropertyValueMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetAssetPropertyValueMiddleware) 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 = "data." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetAssetPropertyValueMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyValueMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opGetAssetPropertyValue(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "GetAssetPropertyValue",
}
}
| 168 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets the history of an asset property's values. For more information, see
// Querying historical values (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/query-industrial-data.html#historical-values)
// in the IoT SiteWise User Guide. To identify an asset property, you must specify
// one of the following:
// - The assetId and propertyId of an asset property.
// - A propertyAlias , which is a data stream alias (for example,
// /company/windfarm/3/turbine/7/temperature ). To define an asset property's
// alias, see UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html)
// .
func (c *Client) GetAssetPropertyValueHistory(ctx context.Context, params *GetAssetPropertyValueHistoryInput, optFns ...func(*Options)) (*GetAssetPropertyValueHistoryOutput, error) {
if params == nil {
params = &GetAssetPropertyValueHistoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetAssetPropertyValueHistory", params, optFns, c.addOperationGetAssetPropertyValueHistoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetAssetPropertyValueHistoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetAssetPropertyValueHistoryInput struct {
// The ID of the asset.
AssetId *string
// The inclusive end of the range from which to query historical data, expressed
// in seconds in Unix epoch time.
EndDate *time.Time
// The maximum number of results to return for each paginated request. A result
// set is returned in the two cases, whichever occurs first.
// - The size of the result set is equal to 4 MB.
// - The number of data points in the result set is equal to the value of
// maxResults . The maximum value of maxResults is 20000.
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
PropertyAlias *string
// The ID of the asset property.
PropertyId *string
// The quality by which to filter asset data.
Qualities []types.Quality
// The exclusive start of the range from which to query historical data, expressed
// in seconds in Unix epoch time.
StartDate *time.Time
// The chronological sorting order of the requested information. Default: ASCENDING
TimeOrdering types.TimeOrdering
noSmithyDocumentSerde
}
type GetAssetPropertyValueHistoryOutput struct {
// The asset property's value history.
//
// This member is required.
AssetPropertyValueHistory []types.AssetPropertyValue
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetAssetPropertyValueHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAssetPropertyValueHistory{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAssetPropertyValueHistory{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opGetAssetPropertyValueHistoryMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAssetPropertyValueHistory(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetAssetPropertyValueHistoryMiddleware struct {
}
func (*endpointPrefix_opGetAssetPropertyValueHistoryMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetAssetPropertyValueHistoryMiddleware) 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 = "data." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetAssetPropertyValueHistoryMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyValueHistoryMiddleware{}, `OperationSerializer`, middleware.After)
}
// GetAssetPropertyValueHistoryAPIClient is a client that implements the
// GetAssetPropertyValueHistory operation.
type GetAssetPropertyValueHistoryAPIClient interface {
GetAssetPropertyValueHistory(context.Context, *GetAssetPropertyValueHistoryInput, ...func(*Options)) (*GetAssetPropertyValueHistoryOutput, error)
}
var _ GetAssetPropertyValueHistoryAPIClient = (*Client)(nil)
// GetAssetPropertyValueHistoryPaginatorOptions is the paginator options for
// GetAssetPropertyValueHistory
type GetAssetPropertyValueHistoryPaginatorOptions struct {
// The maximum number of results to return for each paginated request. A result
// set is returned in the two cases, whichever occurs first.
// - The size of the result set is equal to 4 MB.
// - The number of data points in the result set is equal to the value of
// maxResults . The maximum value of maxResults is 20000.
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
}
// GetAssetPropertyValueHistoryPaginator is a paginator for
// GetAssetPropertyValueHistory
type GetAssetPropertyValueHistoryPaginator struct {
options GetAssetPropertyValueHistoryPaginatorOptions
client GetAssetPropertyValueHistoryAPIClient
params *GetAssetPropertyValueHistoryInput
nextToken *string
firstPage bool
}
// NewGetAssetPropertyValueHistoryPaginator returns a new
// GetAssetPropertyValueHistoryPaginator
func NewGetAssetPropertyValueHistoryPaginator(client GetAssetPropertyValueHistoryAPIClient, params *GetAssetPropertyValueHistoryInput, optFns ...func(*GetAssetPropertyValueHistoryPaginatorOptions)) *GetAssetPropertyValueHistoryPaginator {
if params == nil {
params = &GetAssetPropertyValueHistoryInput{}
}
options := GetAssetPropertyValueHistoryPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetAssetPropertyValueHistoryPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetAssetPropertyValueHistoryPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetAssetPropertyValueHistory page.
func (p *GetAssetPropertyValueHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAssetPropertyValueHistoryOutput, 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.GetAssetPropertyValueHistory(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_opGetAssetPropertyValueHistory(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "GetAssetPropertyValueHistory",
}
}
| 296 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Get interpolated values for an asset property for a specified time interval,
// during a period of time. If your time series is missing data points during the
// specified time interval, you can use interpolation to estimate the missing data.
// For example, you can use this operation to return the interpolated temperature
// values for a wind turbine every 24 hours over a duration of 7 days. To identify
// an asset property, you must specify one of the following:
// - The assetId and propertyId of an asset property.
// - A propertyAlias , which is a data stream alias (for example,
// /company/windfarm/3/turbine/7/temperature ). To define an asset property's
// alias, see UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html)
// .
func (c *Client) GetInterpolatedAssetPropertyValues(ctx context.Context, params *GetInterpolatedAssetPropertyValuesInput, optFns ...func(*Options)) (*GetInterpolatedAssetPropertyValuesOutput, error) {
if params == nil {
params = &GetInterpolatedAssetPropertyValuesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetInterpolatedAssetPropertyValues", params, optFns, c.addOperationGetInterpolatedAssetPropertyValuesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetInterpolatedAssetPropertyValuesOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetInterpolatedAssetPropertyValuesInput struct {
// The inclusive end of the range from which to interpolate data, expressed in
// seconds in Unix epoch time.
//
// This member is required.
EndTimeInSeconds *int64
// The time interval in seconds over which to interpolate data. Each interval
// starts when the previous one ends.
//
// This member is required.
IntervalInSeconds *int64
// The quality of the asset property value. You can use this parameter as a filter
// to choose only the asset property values that have a specific quality.
//
// This member is required.
Quality types.Quality
// The exclusive start of the range from which to interpolate data, expressed in
// seconds in Unix epoch time.
//
// This member is required.
StartTimeInSeconds *int64
// The interpolation type. Valid values: LINEAR_INTERPOLATION | LOCF_INTERPOLATION
// - LINEAR_INTERPOLATION – Estimates missing data using linear interpolation (https://en.wikipedia.org/wiki/Linear_interpolation)
// . For example, you can use this operation to return the interpolated temperature
// values for a wind turbine every 24 hours over a duration of 7 days. If the
// interpolation starts July 1, 2021, at 9 AM, IoT SiteWise returns the first
// interpolated value on July 2, 2021, at 9 AM, the second interpolated value on
// July 3, 2021, at 9 AM, and so on.
// - LOCF_INTERPOLATION – Estimates missing data using last observation carried
// forward interpolation If no data point is found for an interval, IoT SiteWise
// returns the last observed data point for the previous interval and carries
// forward this interpolated value until a new data point is found. For example,
// you can get the state of an on-off valve every 24 hours over a duration of 7
// days. If the interpolation starts July 1, 2021, at 9 AM, IoT SiteWise returns
// the last observed data point between July 1, 2021, at 9 AM and July 2, 2021, at
// 9 AM as the first interpolated value. If a data point isn't found after 9 AM on
// July 2, 2021, IoT SiteWise uses the same interpolated value for the rest of the
// days.
//
// This member is required.
Type *string
// The ID of the asset.
AssetId *string
// The nanosecond offset converted from endTimeInSeconds .
EndTimeOffsetInNanos *int32
// The query interval for the window, in seconds. IoT SiteWise computes each
// interpolated value by using data points from the timestamp of each interval,
// minus the window to the timestamp of each interval plus the window. If not
// specified, the window ranges between the start time minus the interval and the
// end time plus the interval.
// - If you specify a value for the intervalWindowInSeconds parameter, the value
// for the type parameter must be LINEAR_INTERPOLATION .
// - If a data point isn't found during the specified query window, IoT SiteWise
// won't return an interpolated value for the interval. This indicates that there's
// a gap in the ingested data points.
// For example, you can get the interpolated temperature values for a wind turbine
// every 24 hours over a duration of 7 days. If the interpolation starts on July 1,
// 2021, at 9 AM with a window of 2 hours, IoT SiteWise uses the data points from 7
// AM (9 AM minus 2 hours) to 11 AM (9 AM plus 2 hours) on July 2, 2021 to compute
// the first interpolated value. Next, IoT SiteWise uses the data points from 7 AM
// (9 AM minus 2 hours) to 11 AM (9 AM plus 2 hours) on July 3, 2021 to compute the
// second interpolated value, and so on.
IntervalWindowInSeconds *int64
// The maximum number of results to return for each paginated request. If not
// specified, the default value is 10.
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
PropertyAlias *string
// The ID of the asset property.
PropertyId *string
// The nanosecond offset converted from startTimeInSeconds .
StartTimeOffsetInNanos *int32
noSmithyDocumentSerde
}
type GetInterpolatedAssetPropertyValuesOutput struct {
// The requested interpolated values.
//
// This member is required.
InterpolatedAssetPropertyValues []types.InterpolatedAssetPropertyValue
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetInterpolatedAssetPropertyValuesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetInterpolatedAssetPropertyValues{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opGetInterpolatedAssetPropertyValuesMiddleware(stack); err != nil {
return err
}
if err = addOpGetInterpolatedAssetPropertyValuesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInterpolatedAssetPropertyValues(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetInterpolatedAssetPropertyValuesMiddleware struct {
}
func (*endpointPrefix_opGetInterpolatedAssetPropertyValuesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opGetInterpolatedAssetPropertyValuesMiddleware) 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 = "data." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opGetInterpolatedAssetPropertyValuesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opGetInterpolatedAssetPropertyValuesMiddleware{}, `OperationSerializer`, middleware.After)
}
// GetInterpolatedAssetPropertyValuesAPIClient is a client that implements the
// GetInterpolatedAssetPropertyValues operation.
type GetInterpolatedAssetPropertyValuesAPIClient interface {
GetInterpolatedAssetPropertyValues(context.Context, *GetInterpolatedAssetPropertyValuesInput, ...func(*Options)) (*GetInterpolatedAssetPropertyValuesOutput, error)
}
var _ GetInterpolatedAssetPropertyValuesAPIClient = (*Client)(nil)
// GetInterpolatedAssetPropertyValuesPaginatorOptions is the paginator options for
// GetInterpolatedAssetPropertyValues
type GetInterpolatedAssetPropertyValuesPaginatorOptions struct {
// The maximum number of results to return for each paginated request. If not
// specified, the default value is 10.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// GetInterpolatedAssetPropertyValuesPaginator is a paginator for
// GetInterpolatedAssetPropertyValues
type GetInterpolatedAssetPropertyValuesPaginator struct {
options GetInterpolatedAssetPropertyValuesPaginatorOptions
client GetInterpolatedAssetPropertyValuesAPIClient
params *GetInterpolatedAssetPropertyValuesInput
nextToken *string
firstPage bool
}
// NewGetInterpolatedAssetPropertyValuesPaginator returns a new
// GetInterpolatedAssetPropertyValuesPaginator
func NewGetInterpolatedAssetPropertyValuesPaginator(client GetInterpolatedAssetPropertyValuesAPIClient, params *GetInterpolatedAssetPropertyValuesInput, optFns ...func(*GetInterpolatedAssetPropertyValuesPaginatorOptions)) *GetInterpolatedAssetPropertyValuesPaginator {
if params == nil {
params = &GetInterpolatedAssetPropertyValuesInput{}
}
options := GetInterpolatedAssetPropertyValuesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetInterpolatedAssetPropertyValuesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetInterpolatedAssetPropertyValuesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetInterpolatedAssetPropertyValues page.
func (p *GetInterpolatedAssetPropertyValuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInterpolatedAssetPropertyValuesOutput, 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.GetInterpolatedAssetPropertyValues(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_opGetInterpolatedAssetPropertyValues(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "GetInterpolatedAssetPropertyValues",
}
}
| 350 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of access policies for an identity (an IAM Identity
// Center user, an IAM Identity Center group, or an IAM user) or an IoT SiteWise
// Monitor resource (a portal or project).
func (c *Client) ListAccessPolicies(ctx context.Context, params *ListAccessPoliciesInput, optFns ...func(*Options)) (*ListAccessPoliciesOutput, error) {
if params == nil {
params = &ListAccessPoliciesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAccessPolicies", params, optFns, c.addOperationListAccessPoliciesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAccessPoliciesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAccessPoliciesInput struct {
// The ARN of the IAM user. For more information, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
// in the IAM User Guide. This parameter is required if you specify IAM for
// identityType .
IamArn *string
// The ID of the identity. This parameter is required if you specify USER or GROUP
// for identityType .
IdentityId *string
// The type of identity (IAM Identity Center user, IAM Identity Center group, or
// IAM user). This parameter is required if you specify identityId .
IdentityType types.IdentityType
// The maximum number of results to return for each paginated request. Default: 50
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
// The ID of the resource. This parameter is required if you specify resourceType .
ResourceId *string
// The type of resource (portal or project). This parameter is required if you
// specify resourceId .
ResourceType types.ResourceType
noSmithyDocumentSerde
}
type ListAccessPoliciesOutput struct {
// A list that summarizes each access policy.
//
// This member is required.
AccessPolicySummaries []types.AccessPolicySummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAccessPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccessPolicies{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccessPolicies{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListAccessPoliciesMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessPolicies(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListAccessPoliciesMiddleware struct {
}
func (*endpointPrefix_opListAccessPoliciesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListAccessPoliciesMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListAccessPoliciesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListAccessPoliciesMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListAccessPoliciesAPIClient is a client that implements the ListAccessPolicies
// operation.
type ListAccessPoliciesAPIClient interface {
ListAccessPolicies(context.Context, *ListAccessPoliciesInput, ...func(*Options)) (*ListAccessPoliciesOutput, error)
}
var _ ListAccessPoliciesAPIClient = (*Client)(nil)
// ListAccessPoliciesPaginatorOptions is the paginator options for
// ListAccessPolicies
type ListAccessPoliciesPaginatorOptions struct {
// The maximum number of results to return for each paginated request. Default: 50
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAccessPoliciesPaginator is a paginator for ListAccessPolicies
type ListAccessPoliciesPaginator struct {
options ListAccessPoliciesPaginatorOptions
client ListAccessPoliciesAPIClient
params *ListAccessPoliciesInput
nextToken *string
firstPage bool
}
// NewListAccessPoliciesPaginator returns a new ListAccessPoliciesPaginator
func NewListAccessPoliciesPaginator(client ListAccessPoliciesAPIClient, params *ListAccessPoliciesInput, optFns ...func(*ListAccessPoliciesPaginatorOptions)) *ListAccessPoliciesPaginator {
if params == nil {
params = &ListAccessPoliciesInput{}
}
options := ListAccessPoliciesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAccessPoliciesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAccessPoliciesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAccessPolicies page.
func (p *ListAccessPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPoliciesOutput, 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.ListAccessPolicies(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_opListAccessPolicies(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListAccessPolicies",
}
}
| 273 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of properties associated with an asset model. If you
// update properties associated with the model before you finish listing all the
// properties, you need to start all over again.
func (c *Client) ListAssetModelProperties(ctx context.Context, params *ListAssetModelPropertiesInput, optFns ...func(*Options)) (*ListAssetModelPropertiesOutput, error) {
if params == nil {
params = &ListAssetModelPropertiesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssetModelProperties", params, optFns, c.addOperationListAssetModelPropertiesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssetModelPropertiesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssetModelPropertiesInput struct {
// The ID of the asset model.
//
// This member is required.
AssetModelId *string
// Filters the requested list of asset model properties. You can choose one of the
// following options:
// - ALL – The list includes all asset model properties for a given asset model
// ID.
// - BASE – The list includes only base asset model properties for a given asset
// model ID.
// Default: BASE
Filter types.ListAssetModelPropertiesFilter
// The maximum number of results to return for each paginated request. If not
// specified, the default value is 50.
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListAssetModelPropertiesOutput struct {
// A list that summarizes the properties associated with the specified asset model.
//
// This member is required.
AssetModelPropertySummaries []types.AssetModelPropertySummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssetModelPropertiesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssetModelProperties{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssetModelProperties{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListAssetModelPropertiesMiddleware(stack); err != nil {
return err
}
if err = addOpListAssetModelPropertiesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssetModelProperties(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListAssetModelPropertiesMiddleware struct {
}
func (*endpointPrefix_opListAssetModelPropertiesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListAssetModelPropertiesMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListAssetModelPropertiesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListAssetModelPropertiesMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListAssetModelPropertiesAPIClient is a client that implements the
// ListAssetModelProperties operation.
type ListAssetModelPropertiesAPIClient interface {
ListAssetModelProperties(context.Context, *ListAssetModelPropertiesInput, ...func(*Options)) (*ListAssetModelPropertiesOutput, error)
}
var _ ListAssetModelPropertiesAPIClient = (*Client)(nil)
// ListAssetModelPropertiesPaginatorOptions is the paginator options for
// ListAssetModelProperties
type ListAssetModelPropertiesPaginatorOptions struct {
// The maximum number of results to return for each paginated request. If not
// specified, the default value is 50.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAssetModelPropertiesPaginator is a paginator for ListAssetModelProperties
type ListAssetModelPropertiesPaginator struct {
options ListAssetModelPropertiesPaginatorOptions
client ListAssetModelPropertiesAPIClient
params *ListAssetModelPropertiesInput
nextToken *string
firstPage bool
}
// NewListAssetModelPropertiesPaginator returns a new
// ListAssetModelPropertiesPaginator
func NewListAssetModelPropertiesPaginator(client ListAssetModelPropertiesAPIClient, params *ListAssetModelPropertiesInput, optFns ...func(*ListAssetModelPropertiesPaginatorOptions)) *ListAssetModelPropertiesPaginator {
if params == nil {
params = &ListAssetModelPropertiesInput{}
}
options := ListAssetModelPropertiesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssetModelPropertiesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssetModelPropertiesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssetModelProperties page.
func (p *ListAssetModelPropertiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetModelPropertiesOutput, 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.ListAssetModelProperties(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_opListAssetModelProperties(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListAssetModelProperties",
}
}
| 273 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of summaries of all asset models.
func (c *Client) ListAssetModels(ctx context.Context, params *ListAssetModelsInput, optFns ...func(*Options)) (*ListAssetModelsOutput, error) {
if params == nil {
params = &ListAssetModelsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssetModels", params, optFns, c.addOperationListAssetModelsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssetModelsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssetModelsInput struct {
// The maximum number of results to return for each paginated request. Default: 50
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListAssetModelsOutput struct {
// A list that summarizes each asset model.
//
// This member is required.
AssetModelSummaries []types.AssetModelSummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssetModelsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssetModels{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssetModels{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListAssetModelsMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssetModels(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListAssetModelsMiddleware struct {
}
func (*endpointPrefix_opListAssetModelsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListAssetModelsMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListAssetModelsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListAssetModelsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListAssetModelsAPIClient is a client that implements the ListAssetModels
// operation.
type ListAssetModelsAPIClient interface {
ListAssetModels(context.Context, *ListAssetModelsInput, ...func(*Options)) (*ListAssetModelsOutput, error)
}
var _ ListAssetModelsAPIClient = (*Client)(nil)
// ListAssetModelsPaginatorOptions is the paginator options for ListAssetModels
type ListAssetModelsPaginatorOptions struct {
// The maximum number of results to return for each paginated request. Default: 50
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAssetModelsPaginator is a paginator for ListAssetModels
type ListAssetModelsPaginator struct {
options ListAssetModelsPaginatorOptions
client ListAssetModelsAPIClient
params *ListAssetModelsInput
nextToken *string
firstPage bool
}
// NewListAssetModelsPaginator returns a new ListAssetModelsPaginator
func NewListAssetModelsPaginator(client ListAssetModelsAPIClient, params *ListAssetModelsInput, optFns ...func(*ListAssetModelsPaginatorOptions)) *ListAssetModelsPaginator {
if params == nil {
params = &ListAssetModelsInput{}
}
options := ListAssetModelsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssetModelsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssetModelsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssetModels page.
func (p *ListAssetModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetModelsOutput, 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.ListAssetModels(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_opListAssetModels(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListAssetModels",
}
}
| 250 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of properties associated with an asset. If you
// update properties associated with the model before you finish listing all the
// properties, you need to start all over again.
func (c *Client) ListAssetProperties(ctx context.Context, params *ListAssetPropertiesInput, optFns ...func(*Options)) (*ListAssetPropertiesOutput, error) {
if params == nil {
params = &ListAssetPropertiesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssetProperties", params, optFns, c.addOperationListAssetPropertiesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssetPropertiesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssetPropertiesInput struct {
// The ID of the asset.
//
// This member is required.
AssetId *string
// Filters the requested list of asset properties. You can choose one of the
// following options:
// - ALL – The list includes all asset properties for a given asset model ID.
// - BASE – The list includes only base asset properties for a given asset model
// ID.
// Default: BASE
Filter types.ListAssetPropertiesFilter
// The maximum number of results to return for each paginated request. If not
// specified, the default value is 50.
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListAssetPropertiesOutput struct {
// A list that summarizes the properties associated with the specified asset.
//
// This member is required.
AssetPropertySummaries []types.AssetPropertySummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssetPropertiesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssetProperties{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssetProperties{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListAssetPropertiesMiddleware(stack); err != nil {
return err
}
if err = addOpListAssetPropertiesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssetProperties(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListAssetPropertiesMiddleware struct {
}
func (*endpointPrefix_opListAssetPropertiesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListAssetPropertiesMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListAssetPropertiesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListAssetPropertiesMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListAssetPropertiesAPIClient is a client that implements the
// ListAssetProperties operation.
type ListAssetPropertiesAPIClient interface {
ListAssetProperties(context.Context, *ListAssetPropertiesInput, ...func(*Options)) (*ListAssetPropertiesOutput, error)
}
var _ ListAssetPropertiesAPIClient = (*Client)(nil)
// ListAssetPropertiesPaginatorOptions is the paginator options for
// ListAssetProperties
type ListAssetPropertiesPaginatorOptions struct {
// The maximum number of results to return for each paginated request. If not
// specified, the default value is 50.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAssetPropertiesPaginator is a paginator for ListAssetProperties
type ListAssetPropertiesPaginator struct {
options ListAssetPropertiesPaginatorOptions
client ListAssetPropertiesAPIClient
params *ListAssetPropertiesInput
nextToken *string
firstPage bool
}
// NewListAssetPropertiesPaginator returns a new ListAssetPropertiesPaginator
func NewListAssetPropertiesPaginator(client ListAssetPropertiesAPIClient, params *ListAssetPropertiesInput, optFns ...func(*ListAssetPropertiesPaginatorOptions)) *ListAssetPropertiesPaginator {
if params == nil {
params = &ListAssetPropertiesInput{}
}
options := ListAssetPropertiesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssetPropertiesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssetPropertiesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssetProperties page.
func (p *ListAssetPropertiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetPropertiesOutput, 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.ListAssetProperties(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_opListAssetProperties(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListAssetProperties",
}
}
| 271 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of asset relationships for an asset. You can use
// this operation to identify an asset's root asset and all associated assets
// between that asset and its root.
func (c *Client) ListAssetRelationships(ctx context.Context, params *ListAssetRelationshipsInput, optFns ...func(*Options)) (*ListAssetRelationshipsOutput, error) {
if params == nil {
params = &ListAssetRelationshipsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssetRelationships", params, optFns, c.addOperationListAssetRelationshipsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssetRelationshipsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssetRelationshipsInput struct {
// The ID of the asset.
//
// This member is required.
AssetId *string
// The type of traversal to use to identify asset relationships. Choose the
// following option:
// - PATH_TO_ROOT – Identify the asset's parent assets up to the root asset. The
// asset that you specify in assetId is the first result in the list of
// assetRelationshipSummaries , and the root asset is the last result.
//
// This member is required.
TraversalType types.TraversalType
// The maximum number of results to return for each paginated request.
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListAssetRelationshipsOutput struct {
// A list that summarizes each asset relationship.
//
// This member is required.
AssetRelationshipSummaries []types.AssetRelationshipSummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssetRelationshipsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssetRelationships{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssetRelationships{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListAssetRelationshipsMiddleware(stack); err != nil {
return err
}
if err = addOpListAssetRelationshipsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssetRelationships(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListAssetRelationshipsMiddleware struct {
}
func (*endpointPrefix_opListAssetRelationshipsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListAssetRelationshipsMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListAssetRelationshipsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListAssetRelationshipsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListAssetRelationshipsAPIClient is a client that implements the
// ListAssetRelationships operation.
type ListAssetRelationshipsAPIClient interface {
ListAssetRelationships(context.Context, *ListAssetRelationshipsInput, ...func(*Options)) (*ListAssetRelationshipsOutput, error)
}
var _ ListAssetRelationshipsAPIClient = (*Client)(nil)
// ListAssetRelationshipsPaginatorOptions is the paginator options for
// ListAssetRelationships
type ListAssetRelationshipsPaginatorOptions struct {
// The maximum number of results to return for each paginated request.
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
}
// ListAssetRelationshipsPaginator is a paginator for ListAssetRelationships
type ListAssetRelationshipsPaginator struct {
options ListAssetRelationshipsPaginatorOptions
client ListAssetRelationshipsAPIClient
params *ListAssetRelationshipsInput
nextToken *string
firstPage bool
}
// NewListAssetRelationshipsPaginator returns a new ListAssetRelationshipsPaginator
func NewListAssetRelationshipsPaginator(client ListAssetRelationshipsAPIClient, params *ListAssetRelationshipsInput, optFns ...func(*ListAssetRelationshipsPaginatorOptions)) *ListAssetRelationshipsPaginator {
if params == nil {
params = &ListAssetRelationshipsInput{}
}
options := ListAssetRelationshipsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssetRelationshipsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssetRelationshipsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssetRelationships page.
func (p *ListAssetRelationshipsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetRelationshipsOutput, 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.ListAssetRelationships(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_opListAssetRelationships(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListAssetRelationships",
}
}
| 270 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of asset summaries. You can use this operation to do
// the following:
// - List assets based on a specific asset model.
// - List top-level assets.
//
// You can't use this operation to list all assets. To retrieve summaries for all
// of your assets, use ListAssetModels (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_ListAssetModels.html)
// to get all of your asset model IDs. Then, use ListAssets to get all assets for
// each asset model.
func (c *Client) ListAssets(ctx context.Context, params *ListAssetsInput, optFns ...func(*Options)) (*ListAssetsOutput, error) {
if params == nil {
params = &ListAssetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssets", params, optFns, c.addOperationListAssetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssetsInput struct {
// The ID of the asset model by which to filter the list of assets. This parameter
// is required if you choose ALL for filter .
AssetModelId *string
// The filter for the requested list of assets. Choose one of the following
// options:
// - ALL – The list includes all assets for a given asset model ID. The
// assetModelId parameter is required if you filter by ALL .
// - TOP_LEVEL – The list includes only top-level assets in the asset hierarchy
// tree.
// Default: ALL
Filter types.ListAssetsFilter
// The maximum number of results to return for each paginated request. Default: 50
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListAssetsOutput struct {
// A list that summarizes each asset.
//
// This member is required.
AssetSummaries []types.AssetSummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListAssetsMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListAssetsMiddleware struct {
}
func (*endpointPrefix_opListAssetsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListAssetsMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListAssetsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListAssetsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListAssetsAPIClient is a client that implements the ListAssets operation.
type ListAssetsAPIClient interface {
ListAssets(context.Context, *ListAssetsInput, ...func(*Options)) (*ListAssetsOutput, error)
}
var _ ListAssetsAPIClient = (*Client)(nil)
// ListAssetsPaginatorOptions is the paginator options for ListAssets
type ListAssetsPaginatorOptions struct {
// The maximum number of results to return for each paginated request. Default: 50
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAssetsPaginator is a paginator for ListAssets
type ListAssetsPaginator struct {
options ListAssetsPaginatorOptions
client ListAssetsAPIClient
params *ListAssetsInput
nextToken *string
firstPage bool
}
// NewListAssetsPaginator returns a new ListAssetsPaginator
func NewListAssetsPaginator(client ListAssetsAPIClient, params *ListAssetsInput, optFns ...func(*ListAssetsPaginatorOptions)) *ListAssetsPaginator {
if params == nil {
params = &ListAssetsInput{}
}
options := ListAssetsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssetsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssetsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssets page.
func (p *ListAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetsOutput, 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.ListAssets(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_opListAssets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListAssets",
}
}
| 270 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of associated assets. You can use this operation to
// do the following:
// - List child assets associated to a parent asset by a hierarchy that you
// specify.
// - List an asset's parent asset.
func (c *Client) ListAssociatedAssets(ctx context.Context, params *ListAssociatedAssetsInput, optFns ...func(*Options)) (*ListAssociatedAssetsOutput, error) {
if params == nil {
params = &ListAssociatedAssetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAssociatedAssets", params, optFns, c.addOperationListAssociatedAssetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAssociatedAssetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAssociatedAssetsInput struct {
// The ID of the asset to query.
//
// This member is required.
AssetId *string
// The ID of the hierarchy by which child assets are associated to the asset. To
// find a hierarchy ID, use the DescribeAsset (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAsset.html)
// or DescribeAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetModel.html)
// operations. This parameter is required if you choose CHILD for
// traversalDirection . For more information, see Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html)
// in the IoT SiteWise User Guide.
HierarchyId *string
// The maximum number of results to return for each paginated request. Default: 50
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
// The direction to list associated assets. Choose one of the following options:
// - CHILD – The list includes all child assets associated to the asset. The
// hierarchyId parameter is required if you choose CHILD .
// - PARENT – The list includes the asset's parent asset.
// Default: CHILD
TraversalDirection types.TraversalDirection
noSmithyDocumentSerde
}
type ListAssociatedAssetsOutput struct {
// A list that summarizes the associated assets.
//
// This member is required.
AssetSummaries []types.AssociatedAssetsSummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAssociatedAssetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAssociatedAssets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAssociatedAssets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListAssociatedAssetsMiddleware(stack); err != nil {
return err
}
if err = addOpListAssociatedAssetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAssociatedAssets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListAssociatedAssetsMiddleware struct {
}
func (*endpointPrefix_opListAssociatedAssetsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListAssociatedAssetsMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListAssociatedAssetsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListAssociatedAssetsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListAssociatedAssetsAPIClient is a client that implements the
// ListAssociatedAssets operation.
type ListAssociatedAssetsAPIClient interface {
ListAssociatedAssets(context.Context, *ListAssociatedAssetsInput, ...func(*Options)) (*ListAssociatedAssetsOutput, error)
}
var _ ListAssociatedAssetsAPIClient = (*Client)(nil)
// ListAssociatedAssetsPaginatorOptions is the paginator options for
// ListAssociatedAssets
type ListAssociatedAssetsPaginatorOptions struct {
// The maximum number of results to return for each paginated request. Default: 50
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListAssociatedAssetsPaginator is a paginator for ListAssociatedAssets
type ListAssociatedAssetsPaginator struct {
options ListAssociatedAssetsPaginatorOptions
client ListAssociatedAssetsAPIClient
params *ListAssociatedAssetsInput
nextToken *string
firstPage bool
}
// NewListAssociatedAssetsPaginator returns a new ListAssociatedAssetsPaginator
func NewListAssociatedAssetsPaginator(client ListAssociatedAssetsAPIClient, params *ListAssociatedAssetsInput, optFns ...func(*ListAssociatedAssetsPaginatorOptions)) *ListAssociatedAssetsPaginator {
if params == nil {
params = &ListAssociatedAssetsInput{}
}
options := ListAssociatedAssetsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAssociatedAssetsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAssociatedAssetsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAssociatedAssets page.
func (p *ListAssociatedAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociatedAssetsOutput, 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.ListAssociatedAssets(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_opListAssociatedAssets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListAssociatedAssets",
}
}
| 278 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of bulk import job requests. For more information,
// see List bulk import jobs (CLI) (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/ListBulkImportJobs.html)
// in the IoT SiteWise User Guide.
func (c *Client) ListBulkImportJobs(ctx context.Context, params *ListBulkImportJobsInput, optFns ...func(*Options)) (*ListBulkImportJobsOutput, error) {
if params == nil {
params = &ListBulkImportJobsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListBulkImportJobs", params, optFns, c.addOperationListBulkImportJobsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListBulkImportJobsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListBulkImportJobsInput struct {
// You can use a filter to select the bulk import jobs that you want to retrieve.
Filter types.ListBulkImportJobsFilter
// The maximum number of results to return for each paginated request.
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListBulkImportJobsOutput struct {
// One or more job summaries to list.
//
// This member is required.
JobSummaries []types.JobSummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListBulkImportJobsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListBulkImportJobs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBulkImportJobs{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListBulkImportJobsMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBulkImportJobs(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListBulkImportJobsMiddleware struct {
}
func (*endpointPrefix_opListBulkImportJobsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListBulkImportJobsMiddleware) 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 = "data." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListBulkImportJobsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListBulkImportJobsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListBulkImportJobsAPIClient is a client that implements the ListBulkImportJobs
// operation.
type ListBulkImportJobsAPIClient interface {
ListBulkImportJobs(context.Context, *ListBulkImportJobsInput, ...func(*Options)) (*ListBulkImportJobsOutput, error)
}
var _ ListBulkImportJobsAPIClient = (*Client)(nil)
// ListBulkImportJobsPaginatorOptions is the paginator options for
// ListBulkImportJobs
type ListBulkImportJobsPaginatorOptions struct {
// The maximum number of results to return for each paginated request.
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
}
// ListBulkImportJobsPaginator is a paginator for ListBulkImportJobs
type ListBulkImportJobsPaginator struct {
options ListBulkImportJobsPaginatorOptions
client ListBulkImportJobsAPIClient
params *ListBulkImportJobsInput
nextToken *string
firstPage bool
}
// NewListBulkImportJobsPaginator returns a new ListBulkImportJobsPaginator
func NewListBulkImportJobsPaginator(client ListBulkImportJobsAPIClient, params *ListBulkImportJobsInput, optFns ...func(*ListBulkImportJobsPaginatorOptions)) *ListBulkImportJobsPaginator {
if params == nil {
params = &ListBulkImportJobsInput{}
}
options := ListBulkImportJobsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListBulkImportJobsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListBulkImportJobsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListBulkImportJobs page.
func (p *ListBulkImportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBulkImportJobsOutput, 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.ListBulkImportJobs(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_opListBulkImportJobs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListBulkImportJobs",
}
}
| 256 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of dashboards for an IoT SiteWise Monitor project.
func (c *Client) ListDashboards(ctx context.Context, params *ListDashboardsInput, optFns ...func(*Options)) (*ListDashboardsOutput, error) {
if params == nil {
params = &ListDashboardsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDashboards", params, optFns, c.addOperationListDashboardsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDashboardsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListDashboardsInput struct {
// The ID of the project.
//
// This member is required.
ProjectId *string
// The maximum number of results to return for each paginated request. Default: 50
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListDashboardsOutput struct {
// A list that summarizes each dashboard in the project.
//
// This member is required.
DashboardSummaries []types.DashboardSummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDashboardsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListDashboards{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDashboards{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListDashboardsMiddleware(stack); err != nil {
return err
}
if err = addOpListDashboardsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDashboards(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListDashboardsMiddleware struct {
}
func (*endpointPrefix_opListDashboardsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListDashboardsMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListDashboardsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListDashboardsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListDashboardsAPIClient is a client that implements the ListDashboards
// operation.
type ListDashboardsAPIClient interface {
ListDashboards(context.Context, *ListDashboardsInput, ...func(*Options)) (*ListDashboardsOutput, error)
}
var _ ListDashboardsAPIClient = (*Client)(nil)
// ListDashboardsPaginatorOptions is the paginator options for ListDashboards
type ListDashboardsPaginatorOptions struct {
// The maximum number of results to return for each paginated request. Default: 50
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListDashboardsPaginator is a paginator for ListDashboards
type ListDashboardsPaginator struct {
options ListDashboardsPaginatorOptions
client ListDashboardsAPIClient
params *ListDashboardsInput
nextToken *string
firstPage bool
}
// NewListDashboardsPaginator returns a new ListDashboardsPaginator
func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator {
if params == nil {
params = &ListDashboardsInput{}
}
options := ListDashboardsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListDashboardsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListDashboardsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListDashboards page.
func (p *ListDashboardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDashboardsOutput, 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.ListDashboards(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_opListDashboards(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListDashboards",
}
}
| 258 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of gateways.
func (c *Client) ListGateways(ctx context.Context, params *ListGatewaysInput, optFns ...func(*Options)) (*ListGatewaysOutput, error) {
if params == nil {
params = &ListGatewaysInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListGateways", params, optFns, c.addOperationListGatewaysMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListGatewaysOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListGatewaysInput struct {
// The maximum number of results to return for each paginated request. Default: 50
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListGatewaysOutput struct {
// A list that summarizes each gateway.
//
// This member is required.
GatewaySummaries []types.GatewaySummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListGateways{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListGateways{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListGatewaysMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListGateways(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListGatewaysMiddleware struct {
}
func (*endpointPrefix_opListGatewaysMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListGatewaysMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListGatewaysMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListGatewaysMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListGatewaysAPIClient is a client that implements the ListGateways operation.
type ListGatewaysAPIClient interface {
ListGateways(context.Context, *ListGatewaysInput, ...func(*Options)) (*ListGatewaysOutput, error)
}
var _ ListGatewaysAPIClient = (*Client)(nil)
// ListGatewaysPaginatorOptions is the paginator options for ListGateways
type ListGatewaysPaginatorOptions struct {
// The maximum number of results to return for each paginated request. Default: 50
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListGatewaysPaginator is a paginator for ListGateways
type ListGatewaysPaginator struct {
options ListGatewaysPaginatorOptions
client ListGatewaysAPIClient
params *ListGatewaysInput
nextToken *string
firstPage bool
}
// NewListGatewaysPaginator returns a new ListGatewaysPaginator
func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator {
if params == nil {
params = &ListGatewaysInput{}
}
options := ListGatewaysPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListGatewaysPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListGatewaysPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListGateways page.
func (p *ListGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewaysOutput, 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.ListGateways(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_opListGateways(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListGateways",
}
}
| 249 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of IoT SiteWise Monitor portals.
func (c *Client) ListPortals(ctx context.Context, params *ListPortalsInput, optFns ...func(*Options)) (*ListPortalsOutput, error) {
if params == nil {
params = &ListPortalsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListPortals", params, optFns, c.addOperationListPortalsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListPortalsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListPortalsInput struct {
// The maximum number of results to return for each paginated request. Default: 50
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListPortalsOutput struct {
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// A list that summarizes each portal.
PortalSummaries []types.PortalSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListPortalsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListPortals{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPortals{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListPortalsMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPortals(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListPortalsMiddleware struct {
}
func (*endpointPrefix_opListPortalsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListPortalsMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListPortalsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListPortalsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListPortalsAPIClient is a client that implements the ListPortals operation.
type ListPortalsAPIClient interface {
ListPortals(context.Context, *ListPortalsInput, ...func(*Options)) (*ListPortalsOutput, error)
}
var _ ListPortalsAPIClient = (*Client)(nil)
// ListPortalsPaginatorOptions is the paginator options for ListPortals
type ListPortalsPaginatorOptions struct {
// The maximum number of results to return for each paginated request. Default: 50
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListPortalsPaginator is a paginator for ListPortals
type ListPortalsPaginator struct {
options ListPortalsPaginatorOptions
client ListPortalsAPIClient
params *ListPortalsInput
nextToken *string
firstPage bool
}
// NewListPortalsPaginator returns a new ListPortalsPaginator
func NewListPortalsPaginator(client ListPortalsAPIClient, params *ListPortalsInput, optFns ...func(*ListPortalsPaginatorOptions)) *ListPortalsPaginator {
if params == nil {
params = &ListPortalsInput{}
}
options := ListPortalsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListPortalsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListPortalsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListPortals page.
func (p *ListPortalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPortalsOutput, 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.ListPortals(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_opListPortals(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListPortals",
}
}
| 247 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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 paginated list of assets associated with an IoT SiteWise Monitor
// project.
func (c *Client) ListProjectAssets(ctx context.Context, params *ListProjectAssetsInput, optFns ...func(*Options)) (*ListProjectAssetsOutput, error) {
if params == nil {
params = &ListProjectAssetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListProjectAssets", params, optFns, c.addOperationListProjectAssetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListProjectAssetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListProjectAssetsInput struct {
// The ID of the project.
//
// This member is required.
ProjectId *string
// The maximum number of results to return for each paginated request. Default: 50
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListProjectAssetsOutput struct {
// A list that contains the IDs of each asset associated with the project.
//
// This member is required.
AssetIds []string
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListProjectAssetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListProjectAssets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProjectAssets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListProjectAssetsMiddleware(stack); err != nil {
return err
}
if err = addOpListProjectAssetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProjectAssets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListProjectAssetsMiddleware struct {
}
func (*endpointPrefix_opListProjectAssetsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListProjectAssetsMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListProjectAssetsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListProjectAssetsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListProjectAssetsAPIClient is a client that implements the ListProjectAssets
// operation.
type ListProjectAssetsAPIClient interface {
ListProjectAssets(context.Context, *ListProjectAssetsInput, ...func(*Options)) (*ListProjectAssetsOutput, error)
}
var _ ListProjectAssetsAPIClient = (*Client)(nil)
// ListProjectAssetsPaginatorOptions is the paginator options for ListProjectAssets
type ListProjectAssetsPaginatorOptions struct {
// The maximum number of results to return for each paginated request. Default: 50
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListProjectAssetsPaginator is a paginator for ListProjectAssets
type ListProjectAssetsPaginator struct {
options ListProjectAssetsPaginatorOptions
client ListProjectAssetsAPIClient
params *ListProjectAssetsInput
nextToken *string
firstPage bool
}
// NewListProjectAssetsPaginator returns a new ListProjectAssetsPaginator
func NewListProjectAssetsPaginator(client ListProjectAssetsAPIClient, params *ListProjectAssetsInput, optFns ...func(*ListProjectAssetsPaginatorOptions)) *ListProjectAssetsPaginator {
if params == nil {
params = &ListProjectAssetsInput{}
}
options := ListProjectAssetsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListProjectAssetsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListProjectAssetsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListProjectAssets page.
func (p *ListProjectAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectAssetsOutput, 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.ListProjectAssets(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_opListProjectAssets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListProjectAssets",
}
}
| 258 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of projects for an IoT SiteWise Monitor portal.
func (c *Client) ListProjects(ctx context.Context, params *ListProjectsInput, optFns ...func(*Options)) (*ListProjectsOutput, error) {
if params == nil {
params = &ListProjectsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListProjects", params, optFns, c.addOperationListProjectsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListProjectsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListProjectsInput struct {
// The ID of the portal.
//
// This member is required.
PortalId *string
// The maximum number of results to return for each paginated request. Default: 50
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
noSmithyDocumentSerde
}
type ListProjectsOutput struct {
// A list that summarizes each project in the portal.
//
// This member is required.
ProjectSummaries []types.ProjectSummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListProjectsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListProjects{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProjects{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListProjectsMiddleware(stack); err != nil {
return err
}
if err = addOpListProjectsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProjects(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListProjectsMiddleware struct {
}
func (*endpointPrefix_opListProjectsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListProjectsMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListProjectsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListProjectsMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListProjectsAPIClient is a client that implements the ListProjects operation.
type ListProjectsAPIClient interface {
ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error)
}
var _ ListProjectsAPIClient = (*Client)(nil)
// ListProjectsPaginatorOptions is the paginator options for ListProjects
type ListProjectsPaginatorOptions struct {
// The maximum number of results to return for each paginated request. Default: 50
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListProjectsPaginator is a paginator for ListProjects
type ListProjectsPaginator struct {
options ListProjectsPaginatorOptions
client ListProjectsAPIClient
params *ListProjectsInput
nextToken *string
firstPage bool
}
// NewListProjectsPaginator returns a new ListProjectsPaginator
func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator {
if params == nil {
params = &ListProjectsInput{}
}
options := ListProjectsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListProjectsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListProjectsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListProjects page.
func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, 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.ListProjects(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_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListProjects",
}
}
| 257 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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 the list of tags for an IoT SiteWise 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 ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the resource.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The list of key-value pairs that contain metadata for the resource. For more
// information, see Tagging your IoT SiteWise resources (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html)
// in the IoT SiteWise User Guide.
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 = "api." + 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: "iotsitewise",
OperationName: "ListTagsForResource",
}
}
| 158 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a paginated list of time series (data streams).
func (c *Client) ListTimeSeries(ctx context.Context, params *ListTimeSeriesInput, optFns ...func(*Options)) (*ListTimeSeriesOutput, error) {
if params == nil {
params = &ListTimeSeriesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTimeSeries", params, optFns, c.addOperationListTimeSeriesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTimeSeriesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTimeSeriesInput struct {
// The alias prefix of the time series.
AliasPrefix *string
// The ID of the asset in which the asset property was created.
AssetId *string
// The maximum number of results to return for each paginated request.
MaxResults *int32
// The token to be used for the next set of paginated results.
NextToken *string
// The type of the time series. The time series type can be one of the following
// values:
// - ASSOCIATED – The time series is associated with an asset property.
// - DISASSOCIATED – The time series isn't associated with any asset property.
TimeSeriesType types.ListTimeSeriesType
noSmithyDocumentSerde
}
type ListTimeSeriesOutput struct {
// One or more time series summaries to list.
//
// This member is required.
TimeSeriesSummaries []types.TimeSeriesSummary
// The token for the next set of results, or null if there are no additional
// results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTimeSeriesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTimeSeries{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTimeSeries{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListTimeSeriesMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTimeSeries(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListTimeSeriesMiddleware struct {
}
func (*endpointPrefix_opListTimeSeriesMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opListTimeSeriesMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opListTimeSeriesMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opListTimeSeriesMiddleware{}, `OperationSerializer`, middleware.After)
}
// ListTimeSeriesAPIClient is a client that implements the ListTimeSeries
// operation.
type ListTimeSeriesAPIClient interface {
ListTimeSeries(context.Context, *ListTimeSeriesInput, ...func(*Options)) (*ListTimeSeriesOutput, error)
}
var _ ListTimeSeriesAPIClient = (*Client)(nil)
// ListTimeSeriesPaginatorOptions is the paginator options for ListTimeSeries
type ListTimeSeriesPaginatorOptions struct {
// The maximum number of results to return for each paginated request.
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
}
// ListTimeSeriesPaginator is a paginator for ListTimeSeries
type ListTimeSeriesPaginator struct {
options ListTimeSeriesPaginatorOptions
client ListTimeSeriesAPIClient
params *ListTimeSeriesInput
nextToken *string
firstPage bool
}
// NewListTimeSeriesPaginator returns a new ListTimeSeriesPaginator
func NewListTimeSeriesPaginator(client ListTimeSeriesAPIClient, params *ListTimeSeriesInput, optFns ...func(*ListTimeSeriesPaginatorOptions)) *ListTimeSeriesPaginator {
if params == nil {
params = &ListTimeSeriesInput{}
}
options := ListTimeSeriesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTimeSeriesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTimeSeriesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTimeSeries page.
func (p *ListTimeSeriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTimeSeriesOutput, 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.ListTimeSeries(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_opListTimeSeries(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "ListTimeSeries",
}
}
| 262 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets the default encryption configuration for the Amazon Web Services account.
// For more information, see Key management (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/key-management.html)
// in the IoT SiteWise User Guide.
func (c *Client) PutDefaultEncryptionConfiguration(ctx context.Context, params *PutDefaultEncryptionConfigurationInput, optFns ...func(*Options)) (*PutDefaultEncryptionConfigurationOutput, error) {
if params == nil {
params = &PutDefaultEncryptionConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutDefaultEncryptionConfiguration", params, optFns, c.addOperationPutDefaultEncryptionConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutDefaultEncryptionConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutDefaultEncryptionConfigurationInput struct {
// The type of encryption used for the encryption configuration.
//
// This member is required.
EncryptionType types.EncryptionType
// The Key ID of the customer managed key used for KMS encryption. This is
// required if you use KMS_BASED_ENCRYPTION .
KmsKeyId *string
noSmithyDocumentSerde
}
type PutDefaultEncryptionConfigurationOutput struct {
// The status of the account configuration. This contains the ConfigurationState .
// If there is an error, it also contains the ErrorDetails .
//
// This member is required.
ConfigurationStatus *types.ConfigurationStatus
// The type of encryption used for the encryption configuration.
//
// This member is required.
EncryptionType types.EncryptionType
// The Key ARN of the KMS key used for KMS encryption if you use
// KMS_BASED_ENCRYPTION .
KmsKeyArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutDefaultEncryptionConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutDefaultEncryptionConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutDefaultEncryptionConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opPutDefaultEncryptionConfigurationMiddleware(stack); err != nil {
return err
}
if err = addOpPutDefaultEncryptionConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutDefaultEncryptionConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutDefaultEncryptionConfigurationMiddleware struct {
}
func (*endpointPrefix_opPutDefaultEncryptionConfigurationMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutDefaultEncryptionConfigurationMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutDefaultEncryptionConfigurationMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutDefaultEncryptionConfigurationMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutDefaultEncryptionConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "PutDefaultEncryptionConfiguration",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets logging options for IoT SiteWise.
func (c *Client) PutLoggingOptions(ctx context.Context, params *PutLoggingOptionsInput, optFns ...func(*Options)) (*PutLoggingOptionsOutput, error) {
if params == nil {
params = &PutLoggingOptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutLoggingOptions", params, optFns, c.addOperationPutLoggingOptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutLoggingOptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutLoggingOptionsInput struct {
// The logging options to set.
//
// This member is required.
LoggingOptions *types.LoggingOptions
noSmithyDocumentSerde
}
type PutLoggingOptionsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutLoggingOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutLoggingOptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutLoggingOptions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opPutLoggingOptionsMiddleware(stack); err != nil {
return err
}
if err = addOpPutLoggingOptionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutLoggingOptions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutLoggingOptionsMiddleware struct {
}
func (*endpointPrefix_opPutLoggingOptionsMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutLoggingOptionsMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutLoggingOptionsMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutLoggingOptionsMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutLoggingOptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "PutLoggingOptions",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Configures storage settings for IoT SiteWise.
func (c *Client) PutStorageConfiguration(ctx context.Context, params *PutStorageConfigurationInput, optFns ...func(*Options)) (*PutStorageConfigurationOutput, error) {
if params == nil {
params = &PutStorageConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutStorageConfiguration", params, optFns, c.addOperationPutStorageConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutStorageConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutStorageConfigurationInput struct {
// The storage tier that you specified for your data. The storageType parameter
// can be one of the following values:
// - SITEWISE_DEFAULT_STORAGE – IoT SiteWise saves your data into the hot tier.
// The hot tier is a service-managed database.
// - MULTI_LAYER_STORAGE – IoT SiteWise saves your data in both the cold tier and
// the hot tier. The cold tier is a customer-managed Amazon S3 bucket.
//
// This member is required.
StorageType types.StorageType
// Contains the storage configuration for time series (data streams) that aren't
// associated with asset properties. The disassociatedDataStorage can be one of
// the following values:
// - ENABLED – IoT SiteWise accepts time series that aren't associated with asset
// properties. After the disassociatedDataStorage is enabled, you can't disable
// it.
// - DISABLED – IoT SiteWise doesn't accept time series (data streams) that
// aren't associated with asset properties.
// For more information, see Data streams (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/data-streams.html)
// in the IoT SiteWise User Guide.
DisassociatedDataStorage types.DisassociatedDataStorageState
// Identifies a storage destination. If you specified MULTI_LAYER_STORAGE for the
// storage type, you must specify a MultiLayerStorage object.
MultiLayerStorage *types.MultiLayerStorage
// How many days your data is kept in the hot tier. By default, your data is kept
// indefinitely in the hot tier.
RetentionPeriod *types.RetentionPeriod
noSmithyDocumentSerde
}
type PutStorageConfigurationOutput struct {
// Contains current status information for the configuration.
//
// This member is required.
ConfigurationStatus *types.ConfigurationStatus
// The storage tier that you specified for your data. The storageType parameter
// can be one of the following values:
// - SITEWISE_DEFAULT_STORAGE – IoT SiteWise saves your data into the hot tier.
// The hot tier is a service-managed database.
// - MULTI_LAYER_STORAGE – IoT SiteWise saves your data in both the cold tier and
// the hot tier. The cold tier is a customer-managed Amazon S3 bucket.
//
// This member is required.
StorageType types.StorageType
// Contains the storage configuration for time series (data streams) that aren't
// associated with asset properties. The disassociatedDataStorage can be one of
// the following values:
// - ENABLED – IoT SiteWise accepts time series that aren't associated with asset
// properties. After the disassociatedDataStorage is enabled, you can't disable
// it.
// - DISABLED – IoT SiteWise doesn't accept time series (data streams) that
// aren't associated with asset properties.
// For more information, see Data streams (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/data-streams.html)
// in the IoT SiteWise User Guide.
DisassociatedDataStorage types.DisassociatedDataStorageState
// Contains information about the storage destination.
MultiLayerStorage *types.MultiLayerStorage
// How many days your data is kept in the hot tier. By default, your data is kept
// indefinitely in the hot tier.
RetentionPeriod *types.RetentionPeriod
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutStorageConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutStorageConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutStorageConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opPutStorageConfigurationMiddleware(stack); err != nil {
return err
}
if err = addOpPutStorageConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutStorageConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutStorageConfigurationMiddleware struct {
}
func (*endpointPrefix_opPutStorageConfigurationMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opPutStorageConfigurationMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opPutStorageConfigurationMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opPutStorageConfigurationMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opPutStorageConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "PutStorageConfiguration",
}
}
| 212 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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"
)
// Adds tags to an IoT SiteWise resource. If a tag already exists for the
// resource, this operation updates the tag's value.
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the resource to tag.
//
// This member is required.
ResourceArn *string
// A list of key-value pairs that contain metadata for the resource. For more
// information, see Tagging your IoT SiteWise resources (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html)
// in the IoT SiteWise User Guide.
//
// 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 = "api." + 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: "iotsitewise",
OperationName: "TagResource",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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 a tag from an IoT SiteWise 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 ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the resource to untag.
//
// This member is required.
ResourceArn *string
// A list of keys for tags to remove from the resource.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = 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 = "api." + 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: "iotsitewise",
OperationName: "UntagResource",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an existing access policy that specifies an identity's access to an IoT
// SiteWise Monitor portal or project resource.
func (c *Client) UpdateAccessPolicy(ctx context.Context, params *UpdateAccessPolicyInput, optFns ...func(*Options)) (*UpdateAccessPolicyOutput, error) {
if params == nil {
params = &UpdateAccessPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAccessPolicy", params, optFns, c.addOperationUpdateAccessPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAccessPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAccessPolicyInput struct {
// The ID of the access policy.
//
// This member is required.
AccessPolicyId *string
// The identity for this access policy. Choose an IAM Identity Center user, an IAM
// Identity Center group, or an IAM user.
//
// This member is required.
AccessPolicyIdentity *types.Identity
// The permission level for this access policy. Note that a project ADMINISTRATOR
// is also known as a project owner.
//
// This member is required.
AccessPolicyPermission types.Permission
// The IoT SiteWise Monitor resource for this access policy. Choose either a
// portal or a project.
//
// This member is required.
AccessPolicyResource *types.Resource
// A unique case-sensitive identifier that you can provide to ensure the
// idempotency of the request. Don't reuse this client token if a new idempotent
// request is required.
ClientToken *string
noSmithyDocumentSerde
}
type UpdateAccessPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAccessPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAccessPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAccessPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdateAccessPolicyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateAccessPolicyMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateAccessPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAccessPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateAccessPolicyMiddleware struct {
}
func (*endpointPrefix_opUpdateAccessPolicyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateAccessPolicyMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateAccessPolicyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateAccessPolicyMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpUpdateAccessPolicy struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateAccessPolicy) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateAccessPolicy) 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.(*UpdateAccessPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAccessPolicyInput ")
}
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_opUpdateAccessPolicyMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAccessPolicy{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateAccessPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "UpdateAccessPolicy",
}
}
| 212 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an asset's name. For more information, see Updating assets and models (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/update-assets-and-models.html)
// in the IoT SiteWise User Guide.
func (c *Client) UpdateAsset(ctx context.Context, params *UpdateAssetInput, optFns ...func(*Options)) (*UpdateAssetOutput, error) {
if params == nil {
params = &UpdateAssetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAsset", params, optFns, c.addOperationUpdateAssetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAssetOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAssetInput struct {
// The ID of the asset to update.
//
// This member is required.
AssetId *string
// A friendly name for the asset.
//
// This member is required.
AssetName *string
// A description for the asset.
AssetDescription *string
// A unique case-sensitive identifier that you can provide to ensure the
// idempotency of the request. Don't reuse this client token if a new idempotent
// request is required.
ClientToken *string
noSmithyDocumentSerde
}
type UpdateAssetOutput struct {
// The status of the asset, which contains a state ( UPDATING after successfully
// calling this operation) and any error message.
//
// This member is required.
AssetStatus *types.AssetStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAssetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAsset{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAsset{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdateAssetMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateAssetMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateAssetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAsset(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateAssetMiddleware struct {
}
func (*endpointPrefix_opUpdateAssetMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateAssetMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateAssetMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateAssetMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpUpdateAsset struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateAsset) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateAsset) 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.(*UpdateAssetInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAssetInput ")
}
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_opUpdateAssetMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAsset{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateAsset(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "UpdateAsset",
}
}
| 209 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an asset model and all of the assets that were created from the model.
// Each asset created from the model inherits the updated asset model's property
// and hierarchy definitions. For more information, see Updating assets and models (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/update-assets-and-models.html)
// in the IoT SiteWise User Guide. This operation overwrites the existing model
// with the provided model. To avoid deleting your asset model's properties or
// hierarchies, you must include their IDs and definitions in the updated asset
// model payload. For more information, see DescribeAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetModel.html)
// . If you remove a property from an asset model, IoT SiteWise deletes all
// previous data for that property. If you remove a hierarchy definition from an
// asset model, IoT SiteWise disassociates every asset associated with that
// hierarchy. You can't change the type or data type of an existing property.
func (c *Client) UpdateAssetModel(ctx context.Context, params *UpdateAssetModelInput, optFns ...func(*Options)) (*UpdateAssetModelOutput, error) {
if params == nil {
params = &UpdateAssetModelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAssetModel", params, optFns, c.addOperationUpdateAssetModelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAssetModelOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAssetModelInput struct {
// The ID of the asset model to update.
//
// This member is required.
AssetModelId *string
// A unique, friendly name for the asset model.
//
// This member is required.
AssetModelName *string
// The composite asset models that are part of this asset model. Composite asset
// models are asset models that contain specific properties. Each composite model
// has a type that defines the properties that the composite model supports. Use
// composite asset models to define alarms on this asset model.
AssetModelCompositeModels []types.AssetModelCompositeModel
// A description for the asset model.
AssetModelDescription *string
// The updated hierarchy definitions of the asset model. Each hierarchy specifies
// an asset model whose assets can be children of any other assets created from
// this asset model. For more information, see Asset hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html)
// in the IoT SiteWise User Guide. You can specify up to 10 hierarchies per asset
// model. For more information, see Quotas (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html)
// in the IoT SiteWise User Guide.
AssetModelHierarchies []types.AssetModelHierarchy
// The updated property definitions of the asset model. For more information, see
// Asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-properties.html)
// in the IoT SiteWise User Guide. You can specify up to 200 properties per asset
// model. For more information, see Quotas (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html)
// in the IoT SiteWise User Guide.
AssetModelProperties []types.AssetModelProperty
// A unique case-sensitive identifier that you can provide to ensure the
// idempotency of the request. Don't reuse this client token if a new idempotent
// request is required.
ClientToken *string
noSmithyDocumentSerde
}
type UpdateAssetModelOutput struct {
// The status of the asset model, which contains a state ( UPDATING after
// successfully calling this operation) and any error message.
//
// This member is required.
AssetModelStatus *types.AssetModelStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAssetModelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAssetModel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAssetModel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdateAssetModelMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateAssetModelMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateAssetModelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAssetModel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateAssetModelMiddleware struct {
}
func (*endpointPrefix_opUpdateAssetModelMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateAssetModelMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateAssetModelMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateAssetModelMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpUpdateAssetModel struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateAssetModel) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateAssetModel) 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.(*UpdateAssetModelInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAssetModelInput ")
}
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_opUpdateAssetModelMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAssetModel{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateAssetModel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "UpdateAssetModel",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an asset property's alias and notification state. This operation
// overwrites the property's existing alias and notification state. To keep your
// existing property's alias or notification state, you must include the existing
// values in the UpdateAssetProperty request. For more information, see
// DescribeAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeAssetProperty.html)
// .
func (c *Client) UpdateAssetProperty(ctx context.Context, params *UpdateAssetPropertyInput, optFns ...func(*Options)) (*UpdateAssetPropertyOutput, error) {
if params == nil {
params = &UpdateAssetPropertyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAssetProperty", params, optFns, c.addOperationUpdateAssetPropertyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAssetPropertyOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAssetPropertyInput struct {
// The ID of the asset to be updated.
//
// This member is required.
AssetId *string
// The ID of the asset property to be updated.
//
// This member is required.
PropertyId *string
// A unique case-sensitive identifier that you can provide to ensure the
// idempotency of the request. Don't reuse this client token if a new idempotent
// request is required.
ClientToken *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide. If you omit this parameter, the alias is removed
// from the property.
PropertyAlias *string
// The MQTT notification state (enabled or disabled) for this asset property. When
// the notification state is enabled, IoT SiteWise publishes property value updates
// to a unique MQTT topic. For more information, see Interacting with other
// services (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/interact-with-other-services.html)
// in the IoT SiteWise User Guide. If you omit this parameter, the notification
// state is set to DISABLED .
PropertyNotificationState types.PropertyNotificationState
// The unit of measure (such as Newtons or RPM) of the asset property. If you
// don't specify a value for this parameter, the service uses the value of the
// assetModelProperty in the asset model.
PropertyUnit *string
noSmithyDocumentSerde
}
type UpdateAssetPropertyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAssetPropertyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAssetProperty{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAssetProperty{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdateAssetPropertyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateAssetPropertyMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateAssetPropertyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAssetProperty(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateAssetPropertyMiddleware struct {
}
func (*endpointPrefix_opUpdateAssetPropertyMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateAssetPropertyMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateAssetPropertyMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateAssetPropertyMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpUpdateAssetProperty struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateAssetProperty) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateAssetProperty) 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.(*UpdateAssetPropertyInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateAssetPropertyInput ")
}
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_opUpdateAssetPropertyMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateAssetProperty{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateAssetProperty(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "UpdateAssetProperty",
}
}
| 223 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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"
)
// Updates an IoT SiteWise Monitor dashboard.
func (c *Client) UpdateDashboard(ctx context.Context, params *UpdateDashboardInput, optFns ...func(*Options)) (*UpdateDashboardOutput, error) {
if params == nil {
params = &UpdateDashboardInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateDashboard", params, optFns, c.addOperationUpdateDashboardMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateDashboardOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateDashboardInput struct {
// The new dashboard definition, as specified in a JSON literal. For detailed
// information, see Creating dashboards (CLI) (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/create-dashboards-using-aws-cli.html)
// in the IoT SiteWise User Guide.
//
// This member is required.
DashboardDefinition *string
// The ID of the dashboard to update.
//
// This member is required.
DashboardId *string
// A new friendly name for the dashboard.
//
// This member is required.
DashboardName *string
// A unique case-sensitive identifier that you can provide to ensure the
// idempotency of the request. Don't reuse this client token if a new idempotent
// request is required.
ClientToken *string
// A new description for the dashboard.
DashboardDescription *string
noSmithyDocumentSerde
}
type UpdateDashboardOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateDashboardMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDashboard{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDashboard{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdateDashboardMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateDashboardMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateDashboardValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDashboard(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateDashboardMiddleware struct {
}
func (*endpointPrefix_opUpdateDashboardMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateDashboardMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateDashboardMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateDashboardMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpUpdateDashboard struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateDashboard) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateDashboard) 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.(*UpdateDashboardInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateDashboardInput ")
}
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_opUpdateDashboardMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateDashboard{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateDashboard(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "UpdateDashboard",
}
}
| 207 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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"
)
// Updates a gateway's name.
func (c *Client) UpdateGateway(ctx context.Context, params *UpdateGatewayInput, optFns ...func(*Options)) (*UpdateGatewayOutput, error) {
if params == nil {
params = &UpdateGatewayInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateGateway", params, optFns, c.addOperationUpdateGatewayMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateGatewayOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateGatewayInput struct {
// The ID of the gateway to update.
//
// This member is required.
GatewayId *string
// A unique, friendly name for the gateway.
//
// This member is required.
GatewayName *string
noSmithyDocumentSerde
}
type UpdateGatewayOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateGateway{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateGateway{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdateGatewayMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateGatewayValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateGateway(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateGatewayMiddleware struct {
}
func (*endpointPrefix_opUpdateGatewayMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateGatewayMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateGatewayMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateGatewayMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdateGateway(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "UpdateGateway",
}
}
| 156 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a gateway capability configuration or defines a new capability
// configuration. Each gateway capability defines data sources for a gateway. A
// capability configuration can contain multiple data source configurations. If you
// define OPC-UA sources for a gateway in the IoT SiteWise console, all of your
// OPC-UA sources are stored in one capability configuration. To list all
// capability configurations for a gateway, use DescribeGateway (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGateway.html)
// .
func (c *Client) UpdateGatewayCapabilityConfiguration(ctx context.Context, params *UpdateGatewayCapabilityConfigurationInput, optFns ...func(*Options)) (*UpdateGatewayCapabilityConfigurationOutput, error) {
if params == nil {
params = &UpdateGatewayCapabilityConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateGatewayCapabilityConfiguration", params, optFns, c.addOperationUpdateGatewayCapabilityConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateGatewayCapabilityConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateGatewayCapabilityConfigurationInput struct {
// The JSON document that defines the configuration for the gateway capability.
// For more information, see Configuring data sources (CLI) (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/configure-sources.html#configure-source-cli)
// in the IoT SiteWise User Guide.
//
// This member is required.
CapabilityConfiguration *string
// The namespace of the gateway capability configuration to be updated. For
// example, if you configure OPC-UA sources from the IoT SiteWise console, your
// OPC-UA capability configuration has the namespace
// iotsitewise:opcuacollector:version , where version is a number such as 1 .
//
// This member is required.
CapabilityNamespace *string
// The ID of the gateway to be updated.
//
// This member is required.
GatewayId *string
noSmithyDocumentSerde
}
type UpdateGatewayCapabilityConfigurationOutput struct {
// The namespace of the gateway capability.
//
// This member is required.
CapabilityNamespace *string
// The synchronization status of the capability configuration. The sync status can
// be one of the following:
// - IN_SYNC – The gateway is running the capability configuration.
// - OUT_OF_SYNC – The gateway hasn't received the capability configuration.
// - SYNC_FAILED – The gateway rejected the capability configuration.
// After you update a capability configuration, its sync status is OUT_OF_SYNC
// until the gateway receives and applies or rejects the updated configuration.
//
// This member is required.
CapabilitySyncStatus types.CapabilitySyncStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateGatewayCapabilityConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateGatewayCapabilityConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdateGatewayCapabilityConfigurationMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateGatewayCapabilityConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateGatewayCapabilityConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateGatewayCapabilityConfigurationMiddleware struct {
}
func (*endpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware) 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 = "api." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateGatewayCapabilityConfigurationMiddleware{}, `OperationSerializer`, middleware.After)
}
func newServiceMetadataMiddleware_opUpdateGatewayCapabilityConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "UpdateGatewayCapabilityConfiguration",
}
}
| 190 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an IoT SiteWise Monitor portal.
func (c *Client) UpdatePortal(ctx context.Context, params *UpdatePortalInput, optFns ...func(*Options)) (*UpdatePortalOutput, error) {
if params == nil {
params = &UpdatePortalInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdatePortal", params, optFns, c.addOperationUpdatePortalMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdatePortalOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdatePortalInput struct {
// The Amazon Web Services administrator's contact email address.
//
// This member is required.
PortalContactEmail *string
// The ID of the portal to update.
//
// This member is required.
PortalId *string
// A new friendly name for the portal.
//
// This member is required.
PortalName *string
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of a service role that allows the portal's users to access your IoT SiteWise
// resources on your behalf. For more information, see Using service roles for IoT
// SiteWise Monitor (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html)
// in the IoT SiteWise User Guide.
//
// This member is required.
RoleArn *string
// Contains the configuration information of an alarm created in an IoT SiteWise
// Monitor portal. You can use the alarm to monitor an asset property and get
// notified when the asset property value is outside a specified range. For more
// information, see Monitoring with alarms (https://docs.aws.amazon.com/iot-sitewise/latest/appguide/monitor-alarms.html)
// in the IoT SiteWise Application Guide.
Alarms *types.Alarms
// A unique case-sensitive identifier that you can provide to ensure the
// idempotency of the request. Don't reuse this client token if a new idempotent
// request is required.
ClientToken *string
// The email address that sends alarm notifications.
NotificationSenderEmail *string
// A new description for the portal.
PortalDescription *string
// Contains an image that is one of the following:
// - An image file. Choose this option to upload a new image.
// - The ID of an existing image. Choose this option to keep an existing image.
PortalLogoImage *types.Image
noSmithyDocumentSerde
}
type UpdatePortalOutput struct {
// The status of the portal, which contains a state ( UPDATING after successfully
// calling this operation) and any error message.
//
// This member is required.
PortalStatus *types.PortalStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdatePortalMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePortal{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePortal{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdatePortalMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdatePortalMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdatePortalValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePortal(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdatePortalMiddleware struct {
}
func (*endpointPrefix_opUpdatePortalMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdatePortalMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdatePortalMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdatePortalMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpUpdatePortal struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdatePortal) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdatePortal) 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.(*UpdatePortalInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdatePortalInput ")
}
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_opUpdatePortalMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdatePortal{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdatePortal(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "UpdatePortal",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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"
)
// Updates an IoT SiteWise Monitor project.
func (c *Client) UpdateProject(ctx context.Context, params *UpdateProjectInput, optFns ...func(*Options)) (*UpdateProjectOutput, error) {
if params == nil {
params = &UpdateProjectInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateProject", params, optFns, c.addOperationUpdateProjectMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateProjectOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateProjectInput struct {
// The ID of the project to update.
//
// This member is required.
ProjectId *string
// A new friendly name for the project.
//
// This member is required.
ProjectName *string
// A unique case-sensitive identifier that you can provide to ensure the
// idempotency of the request. Don't reuse this client token if a new idempotent
// request is required.
ClientToken *string
// A new description for the project.
ProjectDescription *string
noSmithyDocumentSerde
}
type UpdateProjectOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateProjectMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateProject{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateProject{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opUpdateProjectMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateProjectMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateProjectValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProject(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateProjectMiddleware struct {
}
func (*endpointPrefix_opUpdateProjectMiddleware) ID() string {
return "EndpointHostPrefix"
}
func (m *endpointPrefix_opUpdateProjectMiddleware) 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 = "monitor." + req.URL.Host
return next.HandleSerialize(ctx, in)
}
func addEndpointPrefix_opUpdateProjectMiddleware(stack *middleware.Stack) error {
return stack.Serialize.Insert(&endpointPrefix_opUpdateProjectMiddleware{}, `OperationSerializer`, middleware.After)
}
type idempotencyToken_initializeOpUpdateProject struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateProject) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateProject) 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.(*UpdateProjectInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateProjectInput ")
}
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_opUpdateProjectMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateProject{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateProject(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotsitewise",
OperationName: "UpdateProject",
}
}
| 200 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package iotsitewise provides the API client, operations, and parameter types
// for AWS IoT SiteWise.
//
// Welcome to the IoT SiteWise API Reference. IoT SiteWise is an Amazon Web
// Services service that connects Industrial Internet of Things (IIoT) (https://en.wikipedia.org/wiki/Internet_of_things#Industrial_applications)
// devices to the power of the Amazon Web Services Cloud. For more information, see
// the IoT SiteWise User Guide (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/)
// . For information about IoT SiteWise quotas, see Quotas (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html)
// in the IoT SiteWise User Guide.
package iotsitewise
| 13 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
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/iotsitewise/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 = "iotsitewise"
}
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 iotsitewise
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.29.2"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/iotsitewise/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_serializeOpAssociateAssets struct {
}
func (*awsRestjson1_serializeOpAssociateAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAssociateAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/associate")
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_serializeOpHttpBindingsAssociateAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentAssociateAssetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAssociateAssetsInput(v *AssociateAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentAssociateAssetsInput(v *AssociateAssetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChildAssetId != nil {
ok := object.Key("childAssetId")
ok.String(*v.ChildAssetId)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.HierarchyId != nil {
ok := object.Key("hierarchyId")
ok.String(*v.HierarchyId)
}
return nil
}
type awsRestjson1_serializeOpAssociateTimeSeriesToAssetProperty struct {
}
func (*awsRestjson1_serializeOpAssociateTimeSeriesToAssetProperty) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAssociateTimeSeriesToAssetProperty) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateTimeSeriesToAssetPropertyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries/associate")
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_serializeOpHttpBindingsAssociateTimeSeriesToAssetPropertyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentAssociateTimeSeriesToAssetPropertyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAssociateTimeSeriesToAssetPropertyInput(v *AssociateTimeSeriesToAssetPropertyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Alias != nil {
encoder.SetQuery("alias").String(*v.Alias)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
func awsRestjson1_serializeOpDocumentAssociateTimeSeriesToAssetPropertyInput(v *AssociateTimeSeriesToAssetPropertyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpBatchAssociateProjectAssets struct {
}
func (*awsRestjson1_serializeOpBatchAssociateProjectAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchAssociateProjectAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchAssociateProjectAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}/assets/associate")
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_serializeOpHttpBindingsBatchAssociateProjectAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchAssociateProjectAssetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchAssociateProjectAssetsInput(v *BatchAssociateProjectAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchAssociateProjectAssetsInput(v *BatchAssociateProjectAssetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetIds != nil {
ok := object.Key("assetIds")
if err := awsRestjson1_serializeDocumentIDs(v.AssetIds, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpBatchDisassociateProjectAssets struct {
}
func (*awsRestjson1_serializeOpBatchDisassociateProjectAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchDisassociateProjectAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchDisassociateProjectAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}/assets/disassociate")
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_serializeOpHttpBindingsBatchDisassociateProjectAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchDisassociateProjectAssetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchDisassociateProjectAssetsInput(v *BatchDisassociateProjectAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchDisassociateProjectAssetsInput(v *BatchDisassociateProjectAssetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetIds != nil {
ok := object.Key("assetIds")
if err := awsRestjson1_serializeDocumentIDs(v.AssetIds, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpBatchGetAssetPropertyAggregates struct {
}
func (*awsRestjson1_serializeOpBatchGetAssetPropertyAggregates) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchGetAssetPropertyAggregates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchGetAssetPropertyAggregatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/batch/aggregates")
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_serializeOpDocumentBatchGetAssetPropertyAggregatesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchGetAssetPropertyAggregatesInput(v *BatchGetAssetPropertyAggregatesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchGetAssetPropertyAggregatesInput(v *BatchGetAssetPropertyAggregatesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Entries != nil {
ok := object.Key("entries")
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyAggregatesEntries(v.Entries, 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_serializeOpBatchGetAssetPropertyValue struct {
}
func (*awsRestjson1_serializeOpBatchGetAssetPropertyValue) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchGetAssetPropertyValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchGetAssetPropertyValueInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/batch/latest")
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_serializeOpDocumentBatchGetAssetPropertyValueInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchGetAssetPropertyValueInput(v *BatchGetAssetPropertyValueInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchGetAssetPropertyValueInput(v *BatchGetAssetPropertyValueInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Entries != nil {
ok := object.Key("entries")
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyValueEntries(v.Entries, ok); err != nil {
return err
}
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpBatchGetAssetPropertyValueHistory struct {
}
func (*awsRestjson1_serializeOpBatchGetAssetPropertyValueHistory) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchGetAssetPropertyValueHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchGetAssetPropertyValueHistoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/batch/history")
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_serializeOpDocumentBatchGetAssetPropertyValueHistoryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchGetAssetPropertyValueHistoryInput(v *BatchGetAssetPropertyValueHistoryInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchGetAssetPropertyValueHistoryInput(v *BatchGetAssetPropertyValueHistoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Entries != nil {
ok := object.Key("entries")
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyValueHistoryEntries(v.Entries, 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_serializeOpBatchPutAssetPropertyValue struct {
}
func (*awsRestjson1_serializeOpBatchPutAssetPropertyValue) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchPutAssetPropertyValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*BatchPutAssetPropertyValueInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties")
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_serializeOpDocumentBatchPutAssetPropertyValueInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsBatchPutAssetPropertyValueInput(v *BatchPutAssetPropertyValueInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchPutAssetPropertyValueInput(v *BatchPutAssetPropertyValueInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Entries != nil {
ok := object.Key("entries")
if err := awsRestjson1_serializeDocumentPutAssetPropertyValueEntries(v.Entries, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateAccessPolicy struct {
}
func (*awsRestjson1_serializeOpCreateAccessPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateAccessPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies")
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_serializeOpDocumentCreateAccessPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateAccessPolicyInput(v *CreateAccessPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAccessPolicyInput(v *CreateAccessPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessPolicyIdentity != nil {
ok := object.Key("accessPolicyIdentity")
if err := awsRestjson1_serializeDocumentIdentity(v.AccessPolicyIdentity, ok); err != nil {
return err
}
}
if len(v.AccessPolicyPermission) > 0 {
ok := object.Key("accessPolicyPermission")
ok.String(string(v.AccessPolicyPermission))
}
if v.AccessPolicyResource != nil {
ok := object.Key("accessPolicyResource")
if err := awsRestjson1_serializeDocumentResource(v.AccessPolicyResource, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateAsset struct {
}
func (*awsRestjson1_serializeOpCreateAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets")
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_serializeOpDocumentCreateAssetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateAssetInput(v *CreateAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAssetInput(v *CreateAssetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetDescription != nil {
ok := object.Key("assetDescription")
ok.String(*v.AssetDescription)
}
if v.AssetModelId != nil {
ok := object.Key("assetModelId")
ok.String(*v.AssetModelId)
}
if v.AssetName != nil {
ok := object.Key("assetName")
ok.String(*v.AssetName)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateAssetModel struct {
}
func (*awsRestjson1_serializeOpCreateAssetModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateAssetModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models")
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_serializeOpDocumentCreateAssetModelInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateAssetModelInput(v *CreateAssetModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAssetModelInput(v *CreateAssetModelInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetModelCompositeModels != nil {
ok := object.Key("assetModelCompositeModels")
if err := awsRestjson1_serializeDocumentAssetModelCompositeModelDefinitions(v.AssetModelCompositeModels, ok); err != nil {
return err
}
}
if v.AssetModelDescription != nil {
ok := object.Key("assetModelDescription")
ok.String(*v.AssetModelDescription)
}
if v.AssetModelHierarchies != nil {
ok := object.Key("assetModelHierarchies")
if err := awsRestjson1_serializeDocumentAssetModelHierarchyDefinitions(v.AssetModelHierarchies, ok); err != nil {
return err
}
}
if v.AssetModelName != nil {
ok := object.Key("assetModelName")
ok.String(*v.AssetModelName)
}
if v.AssetModelProperties != nil {
ok := object.Key("assetModelProperties")
if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v.AssetModelProperties, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateBulkImportJob struct {
}
func (*awsRestjson1_serializeOpCreateBulkImportJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateBulkImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateBulkImportJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobs")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateBulkImportJobInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateBulkImportJobInput(v *CreateBulkImportJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateBulkImportJobInput(v *CreateBulkImportJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ErrorReportLocation != nil {
ok := object.Key("errorReportLocation")
if err := awsRestjson1_serializeDocumentErrorReportLocation(v.ErrorReportLocation, ok); err != nil {
return err
}
}
if v.Files != nil {
ok := object.Key("files")
if err := awsRestjson1_serializeDocumentFiles(v.Files, ok); err != nil {
return err
}
}
if v.JobConfiguration != nil {
ok := object.Key("jobConfiguration")
if err := awsRestjson1_serializeDocumentJobConfiguration(v.JobConfiguration, ok); err != nil {
return err
}
}
if v.JobName != nil {
ok := object.Key("jobName")
ok.String(*v.JobName)
}
if v.JobRoleArn != nil {
ok := object.Key("jobRoleArn")
ok.String(*v.JobRoleArn)
}
return nil
}
type awsRestjson1_serializeOpCreateDashboard struct {
}
func (*awsRestjson1_serializeOpCreateDashboard) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDashboardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards")
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_serializeOpDocumentCreateDashboardInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDashboardInput(v *CreateDashboardInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDashboardInput(v *CreateDashboardInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.DashboardDefinition != nil {
ok := object.Key("dashboardDefinition")
ok.String(*v.DashboardDefinition)
}
if v.DashboardDescription != nil {
ok := object.Key("dashboardDescription")
ok.String(*v.DashboardDescription)
}
if v.DashboardName != nil {
ok := object.Key("dashboardName")
ok.String(*v.DashboardName)
}
if v.ProjectId != nil {
ok := object.Key("projectId")
ok.String(*v.ProjectId)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateGateway struct {
}
func (*awsRestjson1_serializeOpCreateGateway) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateGatewayInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways")
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_serializeOpDocumentCreateGatewayInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateGatewayInput(v *CreateGatewayInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateGatewayInput(v *CreateGatewayInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayName != nil {
ok := object.Key("gatewayName")
ok.String(*v.GatewayName)
}
if v.GatewayPlatform != nil {
ok := object.Key("gatewayPlatform")
if err := awsRestjson1_serializeDocumentGatewayPlatform(v.GatewayPlatform, 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_serializeOpCreatePortal struct {
}
func (*awsRestjson1_serializeOpCreatePortal) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreatePortal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreatePortalInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals")
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_serializeOpDocumentCreatePortalInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreatePortalInput(v *CreatePortalInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreatePortalInput(v *CreatePortalInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Alarms != nil {
ok := object.Key("alarms")
if err := awsRestjson1_serializeDocumentAlarms(v.Alarms, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.NotificationSenderEmail != nil {
ok := object.Key("notificationSenderEmail")
ok.String(*v.NotificationSenderEmail)
}
if len(v.PortalAuthMode) > 0 {
ok := object.Key("portalAuthMode")
ok.String(string(v.PortalAuthMode))
}
if v.PortalContactEmail != nil {
ok := object.Key("portalContactEmail")
ok.String(*v.PortalContactEmail)
}
if v.PortalDescription != nil {
ok := object.Key("portalDescription")
ok.String(*v.PortalDescription)
}
if v.PortalLogoImageFile != nil {
ok := object.Key("portalLogoImageFile")
if err := awsRestjson1_serializeDocumentImageFile(v.PortalLogoImageFile, ok); err != nil {
return err
}
}
if v.PortalName != nil {
ok := object.Key("portalName")
ok.String(*v.PortalName)
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateProject struct {
}
func (*awsRestjson1_serializeOpCreateProject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateProjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects")
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_serializeOpDocumentCreateProjectInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateProjectInput(v *CreateProjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.PortalId != nil {
ok := object.Key("portalId")
ok.String(*v.PortalId)
}
if v.ProjectDescription != nil {
ok := object.Key("projectDescription")
ok.String(*v.ProjectDescription)
}
if v.ProjectName != nil {
ok := object.Key("projectName")
ok.String(*v.ProjectName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteAccessPolicy struct {
}
func (*awsRestjson1_serializeOpDeleteAccessPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAccessPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies/{accessPolicyId}")
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_serializeOpHttpBindingsDeleteAccessPolicyInput(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_serializeOpHttpBindingsDeleteAccessPolicyInput(v *DeleteAccessPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccessPolicyId == nil || len(*v.AccessPolicyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member accessPolicyId must not be empty")}
}
if v.AccessPolicyId != nil {
if err := encoder.SetURI("accessPolicyId").String(*v.AccessPolicyId); err != nil {
return err
}
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpDeleteAsset struct {
}
func (*awsRestjson1_serializeOpDeleteAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}")
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_serializeOpHttpBindingsDeleteAssetInput(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_serializeOpHttpBindingsDeleteAssetInput(v *DeleteAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpDeleteAssetModel struct {
}
func (*awsRestjson1_serializeOpDeleteAssetModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAssetModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}")
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_serializeOpHttpBindingsDeleteAssetModelInput(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_serializeOpHttpBindingsDeleteAssetModelInput(v *DeleteAssetModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpDeleteDashboard struct {
}
func (*awsRestjson1_serializeOpDeleteDashboard) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDashboardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards/{dashboardId}")
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_serializeOpHttpBindingsDeleteDashboardInput(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_serializeOpHttpBindingsDeleteDashboardInput(v *DeleteDashboardInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
if v.DashboardId == nil || len(*v.DashboardId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member dashboardId must not be empty")}
}
if v.DashboardId != nil {
if err := encoder.SetURI("dashboardId").String(*v.DashboardId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteGateway struct {
}
func (*awsRestjson1_serializeOpDeleteGateway) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteGatewayInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}")
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_serializeOpHttpBindingsDeleteGatewayInput(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_serializeOpHttpBindingsDeleteGatewayInput(v *DeleteGatewayInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeletePortal struct {
}
func (*awsRestjson1_serializeOpDeletePortal) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeletePortal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeletePortalInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals/{portalId}")
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_serializeOpHttpBindingsDeletePortalInput(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_serializeOpHttpBindingsDeletePortalInput(v *DeletePortalInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
if v.PortalId == nil || len(*v.PortalId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member portalId must not be empty")}
}
if v.PortalId != nil {
if err := encoder.SetURI("portalId").String(*v.PortalId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteProject struct {
}
func (*awsRestjson1_serializeOpDeleteProject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteProjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}")
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_serializeOpHttpBindingsDeleteProjectInput(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_serializeOpHttpBindingsDeleteProjectInput(v *DeleteProjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteTimeSeries struct {
}
func (*awsRestjson1_serializeOpDeleteTimeSeries) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteTimeSeries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteTimeSeriesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries/delete")
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_serializeOpHttpBindingsDeleteTimeSeriesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDeleteTimeSeriesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeleteTimeSeriesInput(v *DeleteTimeSeriesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Alias != nil {
encoder.SetQuery("alias").String(*v.Alias)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteTimeSeriesInput(v *DeleteTimeSeriesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpDescribeAccessPolicy struct {
}
func (*awsRestjson1_serializeOpDescribeAccessPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAccessPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies/{accessPolicyId}")
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_serializeOpHttpBindingsDescribeAccessPolicyInput(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_serializeOpHttpBindingsDescribeAccessPolicyInput(v *DescribeAccessPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccessPolicyId == nil || len(*v.AccessPolicyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member accessPolicyId must not be empty")}
}
if v.AccessPolicyId != nil {
if err := encoder.SetURI("accessPolicyId").String(*v.AccessPolicyId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeAsset struct {
}
func (*awsRestjson1_serializeOpDescribeAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}")
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_serializeOpHttpBindingsDescribeAssetInput(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_serializeOpHttpBindingsDescribeAssetInput(v *DescribeAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.ExcludeProperties {
encoder.SetQuery("excludeProperties").Boolean(v.ExcludeProperties)
}
return nil
}
type awsRestjson1_serializeOpDescribeAssetModel struct {
}
func (*awsRestjson1_serializeOpDescribeAssetModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAssetModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}")
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_serializeOpHttpBindingsDescribeAssetModelInput(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_serializeOpHttpBindingsDescribeAssetModelInput(v *DescribeAssetModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.ExcludeProperties {
encoder.SetQuery("excludeProperties").Boolean(v.ExcludeProperties)
}
return nil
}
type awsRestjson1_serializeOpDescribeAssetProperty struct {
}
func (*awsRestjson1_serializeOpDescribeAssetProperty) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAssetProperty) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAssetPropertyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties/{propertyId}")
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_serializeOpHttpBindingsDescribeAssetPropertyInput(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_serializeOpHttpBindingsDescribeAssetPropertyInput(v *DescribeAssetPropertyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.PropertyId == nil || len(*v.PropertyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member propertyId must not be empty")}
}
if v.PropertyId != nil {
if err := encoder.SetURI("propertyId").String(*v.PropertyId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeBulkImportJob struct {
}
func (*awsRestjson1_serializeOpDescribeBulkImportJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeBulkImportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeBulkImportJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobs/{jobId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeBulkImportJobInput(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_serializeOpHttpBindingsDescribeBulkImportJobInput(v *DescribeBulkImportJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("jobId").String(*v.JobId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeDashboard struct {
}
func (*awsRestjson1_serializeOpDescribeDashboard) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeDashboardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards/{dashboardId}")
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_serializeOpHttpBindingsDescribeDashboardInput(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_serializeOpHttpBindingsDescribeDashboardInput(v *DescribeDashboardInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DashboardId == nil || len(*v.DashboardId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member dashboardId must not be empty")}
}
if v.DashboardId != nil {
if err := encoder.SetURI("dashboardId").String(*v.DashboardId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeDefaultEncryptionConfiguration struct {
}
func (*awsRestjson1_serializeOpDescribeDefaultEncryptionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeDefaultEncryptionConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeDefaultEncryptionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/configuration/account/encryption")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeDefaultEncryptionConfigurationInput(v *DescribeDefaultEncryptionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDescribeGateway struct {
}
func (*awsRestjson1_serializeOpDescribeGateway) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeGatewayInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}")
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_serializeOpHttpBindingsDescribeGatewayInput(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_serializeOpHttpBindingsDescribeGatewayInput(v *DescribeGatewayInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration struct {
}
func (*awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeGatewayCapabilityConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}/capability/{capabilityNamespace}")
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_serializeOpHttpBindingsDescribeGatewayCapabilityConfigurationInput(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_serializeOpHttpBindingsDescribeGatewayCapabilityConfigurationInput(v *DescribeGatewayCapabilityConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CapabilityNamespace == nil || len(*v.CapabilityNamespace) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member capabilityNamespace must not be empty")}
}
if v.CapabilityNamespace != nil {
if err := encoder.SetURI("capabilityNamespace").String(*v.CapabilityNamespace); err != nil {
return err
}
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeLoggingOptions struct {
}
func (*awsRestjson1_serializeOpDescribeLoggingOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeLoggingOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeLoggingOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/logging")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeLoggingOptionsInput(v *DescribeLoggingOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDescribePortal struct {
}
func (*awsRestjson1_serializeOpDescribePortal) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribePortal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribePortalInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals/{portalId}")
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_serializeOpHttpBindingsDescribePortalInput(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_serializeOpHttpBindingsDescribePortalInput(v *DescribePortalInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PortalId == nil || len(*v.PortalId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member portalId must not be empty")}
}
if v.PortalId != nil {
if err := encoder.SetURI("portalId").String(*v.PortalId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeProject struct {
}
func (*awsRestjson1_serializeOpDescribeProject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeProjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}")
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_serializeOpHttpBindingsDescribeProjectInput(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_serializeOpHttpBindingsDescribeProjectInput(v *DescribeProjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeStorageConfiguration struct {
}
func (*awsRestjson1_serializeOpDescribeStorageConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeStorageConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStorageConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/configuration/account/storage")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeStorageConfigurationInput(v *DescribeStorageConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDescribeTimeSeries struct {
}
func (*awsRestjson1_serializeOpDescribeTimeSeries) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeTimeSeries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeTimeSeriesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries/describe")
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_serializeOpHttpBindingsDescribeTimeSeriesInput(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_serializeOpHttpBindingsDescribeTimeSeriesInput(v *DescribeTimeSeriesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Alias != nil {
encoder.SetQuery("alias").String(*v.Alias)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
type awsRestjson1_serializeOpDisassociateAssets struct {
}
func (*awsRestjson1_serializeOpDisassociateAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDisassociateAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/disassociate")
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_serializeOpHttpBindingsDisassociateAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDisassociateAssetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDisassociateAssetsInput(v *DisassociateAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentDisassociateAssetsInput(v *DisassociateAssetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChildAssetId != nil {
ok := object.Key("childAssetId")
ok.String(*v.ChildAssetId)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.HierarchyId != nil {
ok := object.Key("hierarchyId")
ok.String(*v.HierarchyId)
}
return nil
}
type awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty struct {
}
func (*awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateTimeSeriesFromAssetPropertyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries/disassociate")
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_serializeOpHttpBindingsDisassociateTimeSeriesFromAssetPropertyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDisassociateTimeSeriesFromAssetPropertyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeSeriesFromAssetPropertyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Alias != nil {
encoder.SetQuery("alias").String(*v.Alias)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
func awsRestjson1_serializeOpDocumentDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeSeriesFromAssetPropertyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpGetAssetPropertyAggregates struct {
}
func (*awsRestjson1_serializeOpGetAssetPropertyAggregates) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAssetPropertyAggregates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetAssetPropertyAggregatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/aggregates")
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_serializeOpHttpBindingsGetAssetPropertyAggregatesInput(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_serializeOpHttpBindingsGetAssetPropertyAggregatesInput(v *GetAssetPropertyAggregatesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AggregateTypes != nil {
for i := range v.AggregateTypes {
encoder.AddQuery("aggregateTypes").String(string(v.AggregateTypes[i]))
}
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.EndDate != nil {
encoder.SetQuery("endDate").String(smithytime.FormatDateTime(*v.EndDate))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PropertyAlias != nil {
encoder.SetQuery("propertyAlias").String(*v.PropertyAlias)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
if v.Qualities != nil {
for i := range v.Qualities {
encoder.AddQuery("qualities").String(string(v.Qualities[i]))
}
}
if v.Resolution != nil {
encoder.SetQuery("resolution").String(*v.Resolution)
}
if v.StartDate != nil {
encoder.SetQuery("startDate").String(smithytime.FormatDateTime(*v.StartDate))
}
if len(v.TimeOrdering) > 0 {
encoder.SetQuery("timeOrdering").String(string(v.TimeOrdering))
}
return nil
}
type awsRestjson1_serializeOpGetAssetPropertyValue struct {
}
func (*awsRestjson1_serializeOpGetAssetPropertyValue) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAssetPropertyValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetAssetPropertyValueInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/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_serializeOpHttpBindingsGetAssetPropertyValueInput(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_serializeOpHttpBindingsGetAssetPropertyValueInput(v *GetAssetPropertyValueInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyAlias != nil {
encoder.SetQuery("propertyAlias").String(*v.PropertyAlias)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
type awsRestjson1_serializeOpGetAssetPropertyValueHistory struct {
}
func (*awsRestjson1_serializeOpGetAssetPropertyValueHistory) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAssetPropertyValueHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetAssetPropertyValueHistoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/history")
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_serializeOpHttpBindingsGetAssetPropertyValueHistoryInput(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_serializeOpHttpBindingsGetAssetPropertyValueHistoryInput(v *GetAssetPropertyValueHistoryInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.EndDate != nil {
encoder.SetQuery("endDate").String(smithytime.FormatDateTime(*v.EndDate))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PropertyAlias != nil {
encoder.SetQuery("propertyAlias").String(*v.PropertyAlias)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
if v.Qualities != nil {
for i := range v.Qualities {
encoder.AddQuery("qualities").String(string(v.Qualities[i]))
}
}
if v.StartDate != nil {
encoder.SetQuery("startDate").String(smithytime.FormatDateTime(*v.StartDate))
}
if len(v.TimeOrdering) > 0 {
encoder.SetQuery("timeOrdering").String(string(v.TimeOrdering))
}
return nil
}
type awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues struct {
}
func (*awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetInterpolatedAssetPropertyValuesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/interpolated")
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_serializeOpHttpBindingsGetInterpolatedAssetPropertyValuesInput(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_serializeOpHttpBindingsGetInterpolatedAssetPropertyValuesInput(v *GetInterpolatedAssetPropertyValuesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.EndTimeInSeconds != nil {
encoder.SetQuery("endTimeInSeconds").Long(*v.EndTimeInSeconds)
}
if v.EndTimeOffsetInNanos != nil {
encoder.SetQuery("endTimeOffsetInNanos").Integer(*v.EndTimeOffsetInNanos)
}
if v.IntervalInSeconds != nil {
encoder.SetQuery("intervalInSeconds").Long(*v.IntervalInSeconds)
}
if v.IntervalWindowInSeconds != nil {
encoder.SetQuery("intervalWindowInSeconds").Long(*v.IntervalWindowInSeconds)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PropertyAlias != nil {
encoder.SetQuery("propertyAlias").String(*v.PropertyAlias)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
if len(v.Quality) > 0 {
encoder.SetQuery("quality").String(string(v.Quality))
}
if v.StartTimeInSeconds != nil {
encoder.SetQuery("startTimeInSeconds").Long(*v.StartTimeInSeconds)
}
if v.StartTimeOffsetInNanos != nil {
encoder.SetQuery("startTimeOffsetInNanos").Integer(*v.StartTimeOffsetInNanos)
}
if v.Type != nil {
encoder.SetQuery("type").String(*v.Type)
}
return nil
}
type awsRestjson1_serializeOpListAccessPolicies struct {
}
func (*awsRestjson1_serializeOpListAccessPolicies) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAccessPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAccessPoliciesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListAccessPoliciesInput(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_serializeOpHttpBindingsListAccessPoliciesInput(v *ListAccessPoliciesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IamArn != nil {
encoder.SetQuery("iamArn").String(*v.IamArn)
}
if v.IdentityId != nil {
encoder.SetQuery("identityId").String(*v.IdentityId)
}
if len(v.IdentityType) > 0 {
encoder.SetQuery("identityType").String(string(v.IdentityType))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.ResourceId != nil {
encoder.SetQuery("resourceId").String(*v.ResourceId)
}
if len(v.ResourceType) > 0 {
encoder.SetQuery("resourceType").String(string(v.ResourceType))
}
return nil
}
type awsRestjson1_serializeOpListAssetModelProperties struct {
}
func (*awsRestjson1_serializeOpListAssetModelProperties) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssetModelProperties) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAssetModelPropertiesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/properties")
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_serializeOpHttpBindingsListAssetModelPropertiesInput(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_serializeOpHttpBindingsListAssetModelPropertiesInput(v *ListAssetModelPropertiesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if len(v.Filter) > 0 {
encoder.SetQuery("filter").String(string(v.Filter))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAssetModels struct {
}
func (*awsRestjson1_serializeOpListAssetModels) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssetModels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAssetModelsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models")
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_serializeOpHttpBindingsListAssetModelsInput(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_serializeOpHttpBindingsListAssetModelsInput(v *ListAssetModelsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAssetProperties struct {
}
func (*awsRestjson1_serializeOpListAssetProperties) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssetProperties) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAssetPropertiesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties")
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_serializeOpHttpBindingsListAssetPropertiesInput(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_serializeOpHttpBindingsListAssetPropertiesInput(v *ListAssetPropertiesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if len(v.Filter) > 0 {
encoder.SetQuery("filter").String(string(v.Filter))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAssetRelationships struct {
}
func (*awsRestjson1_serializeOpListAssetRelationships) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssetRelationships) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAssetRelationshipsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/assetRelationships")
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_serializeOpHttpBindingsListAssetRelationshipsInput(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_serializeOpHttpBindingsListAssetRelationshipsInput(v *ListAssetRelationshipsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if len(v.TraversalType) > 0 {
encoder.SetQuery("traversalType").String(string(v.TraversalType))
}
return nil
}
type awsRestjson1_serializeOpListAssets struct {
}
func (*awsRestjson1_serializeOpListAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets")
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_serializeOpHttpBindingsListAssetsInput(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_serializeOpHttpBindingsListAssetsInput(v *ListAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId != nil {
encoder.SetQuery("assetModelId").String(*v.AssetModelId)
}
if len(v.Filter) > 0 {
encoder.SetQuery("filter").String(string(v.Filter))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAssociatedAssets struct {
}
func (*awsRestjson1_serializeOpListAssociatedAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssociatedAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAssociatedAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/hierarchies")
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_serializeOpHttpBindingsListAssociatedAssetsInput(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_serializeOpHttpBindingsListAssociatedAssetsInput(v *ListAssociatedAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.HierarchyId != nil {
encoder.SetQuery("hierarchyId").String(*v.HierarchyId)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if len(v.TraversalDirection) > 0 {
encoder.SetQuery("traversalDirection").String(string(v.TraversalDirection))
}
return nil
}
type awsRestjson1_serializeOpListBulkImportJobs struct {
}
func (*awsRestjson1_serializeOpListBulkImportJobs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListBulkImportJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListBulkImportJobsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobs")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListBulkImportJobsInput(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_serializeOpHttpBindingsListBulkImportJobsInput(v *ListBulkImportJobsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.Filter) > 0 {
encoder.SetQuery("filter").String(string(v.Filter))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListDashboards struct {
}
func (*awsRestjson1_serializeOpListDashboards) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDashboards) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListDashboardsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards")
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_serializeOpHttpBindingsListDashboardsInput(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_serializeOpHttpBindingsListDashboardsInput(v *ListDashboardsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.ProjectId != nil {
encoder.SetQuery("projectId").String(*v.ProjectId)
}
return nil
}
type awsRestjson1_serializeOpListGateways struct {
}
func (*awsRestjson1_serializeOpListGateways) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListGateways) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListGatewaysInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways")
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_serializeOpHttpBindingsListGatewaysInput(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_serializeOpHttpBindingsListGatewaysInput(v *ListGatewaysInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListPortals struct {
}
func (*awsRestjson1_serializeOpListPortals) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListPortals) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListPortalsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals")
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_serializeOpHttpBindingsListPortalsInput(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_serializeOpHttpBindingsListPortalsInput(v *ListPortalsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListProjectAssets struct {
}
func (*awsRestjson1_serializeOpListProjectAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListProjectAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListProjectAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}/assets")
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_serializeOpHttpBindingsListProjectAssetsInput(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_serializeOpHttpBindingsListProjectAssetsInput(v *ListProjectAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListProjects struct {
}
func (*awsRestjson1_serializeOpListProjects) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListProjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListProjectsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects")
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_serializeOpHttpBindingsListProjectsInput(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_serializeOpHttpBindingsListProjectsInput(v *ListProjectsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PortalId != nil {
encoder.SetQuery("portalId").String(*v.PortalId)
}
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")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn != nil {
encoder.SetQuery("resourceArn").String(*v.ResourceArn)
}
return nil
}
type awsRestjson1_serializeOpListTimeSeries struct {
}
func (*awsRestjson1_serializeOpListTimeSeries) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTimeSeries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTimeSeriesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries")
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_serializeOpHttpBindingsListTimeSeriesInput(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_serializeOpHttpBindingsListTimeSeriesInput(v *ListTimeSeriesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AliasPrefix != nil {
encoder.SetQuery("aliasPrefix").String(*v.AliasPrefix)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if len(v.TimeSeriesType) > 0 {
encoder.SetQuery("timeSeriesType").String(string(v.TimeSeriesType))
}
return nil
}
type awsRestjson1_serializeOpPutDefaultEncryptionConfiguration struct {
}
func (*awsRestjson1_serializeOpPutDefaultEncryptionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutDefaultEncryptionConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutDefaultEncryptionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/configuration/account/encryption")
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_serializeOpDocumentPutDefaultEncryptionConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutDefaultEncryptionConfigurationInput(v *PutDefaultEncryptionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutDefaultEncryptionConfigurationInput(v *PutDefaultEncryptionConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.EncryptionType) > 0 {
ok := object.Key("encryptionType")
ok.String(string(v.EncryptionType))
}
if v.KmsKeyId != nil {
ok := object.Key("kmsKeyId")
ok.String(*v.KmsKeyId)
}
return nil
}
type awsRestjson1_serializeOpPutLoggingOptions struct {
}
func (*awsRestjson1_serializeOpPutLoggingOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutLoggingOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutLoggingOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/logging")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutLoggingOptionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutLoggingOptionsInput(v *PutLoggingOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutLoggingOptionsInput(v *PutLoggingOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LoggingOptions != nil {
ok := object.Key("loggingOptions")
if err := awsRestjson1_serializeDocumentLoggingOptions(v.LoggingOptions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutStorageConfiguration struct {
}
func (*awsRestjson1_serializeOpPutStorageConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutStorageConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutStorageConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/configuration/account/storage")
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_serializeOpDocumentPutStorageConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutStorageConfigurationInput(v *PutStorageConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutStorageConfigurationInput(v *PutStorageConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DisassociatedDataStorage) > 0 {
ok := object.Key("disassociatedDataStorage")
ok.String(string(v.DisassociatedDataStorage))
}
if v.MultiLayerStorage != nil {
ok := object.Key("multiLayerStorage")
if err := awsRestjson1_serializeDocumentMultiLayerStorage(v.MultiLayerStorage, ok); err != nil {
return err
}
}
if v.RetentionPeriod != nil {
ok := object.Key("retentionPeriod")
if err := awsRestjson1_serializeDocumentRetentionPeriod(v.RetentionPeriod, ok); err != nil {
return err
}
}
if len(v.StorageType) > 0 {
ok := object.Key("storageType")
ok.String(string(v.StorageType))
}
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")
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 {
encoder.SetQuery("resourceArn").String(*v.ResourceArn)
}
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")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn != nil {
encoder.SetQuery("resourceArn").String(*v.ResourceArn)
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("tagKeys").String(v.TagKeys[i])
}
}
return nil
}
type awsRestjson1_serializeOpUpdateAccessPolicy struct {
}
func (*awsRestjson1_serializeOpUpdateAccessPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateAccessPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies/{accessPolicyId}")
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_serializeOpHttpBindingsUpdateAccessPolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAccessPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateAccessPolicyInput(v *UpdateAccessPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccessPolicyId == nil || len(*v.AccessPolicyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member accessPolicyId must not be empty")}
}
if v.AccessPolicyId != nil {
if err := encoder.SetURI("accessPolicyId").String(*v.AccessPolicyId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAccessPolicyInput(v *UpdateAccessPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessPolicyIdentity != nil {
ok := object.Key("accessPolicyIdentity")
if err := awsRestjson1_serializeDocumentIdentity(v.AccessPolicyIdentity, ok); err != nil {
return err
}
}
if len(v.AccessPolicyPermission) > 0 {
ok := object.Key("accessPolicyPermission")
ok.String(string(v.AccessPolicyPermission))
}
if v.AccessPolicyResource != nil {
ok := object.Key("accessPolicyResource")
if err := awsRestjson1_serializeDocumentResource(v.AccessPolicyResource, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpUpdateAsset struct {
}
func (*awsRestjson1_serializeOpUpdateAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}")
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_serializeOpHttpBindingsUpdateAssetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAssetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateAssetInput(v *UpdateAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAssetInput(v *UpdateAssetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetDescription != nil {
ok := object.Key("assetDescription")
ok.String(*v.AssetDescription)
}
if v.AssetName != nil {
ok := object.Key("assetName")
ok.String(*v.AssetName)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpUpdateAssetModel struct {
}
func (*awsRestjson1_serializeOpUpdateAssetModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateAssetModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}")
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_serializeOpHttpBindingsUpdateAssetModelInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAssetModelInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateAssetModelInput(v *UpdateAssetModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAssetModelInput(v *UpdateAssetModelInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetModelCompositeModels != nil {
ok := object.Key("assetModelCompositeModels")
if err := awsRestjson1_serializeDocumentAssetModelCompositeModels(v.AssetModelCompositeModels, ok); err != nil {
return err
}
}
if v.AssetModelDescription != nil {
ok := object.Key("assetModelDescription")
ok.String(*v.AssetModelDescription)
}
if v.AssetModelHierarchies != nil {
ok := object.Key("assetModelHierarchies")
if err := awsRestjson1_serializeDocumentAssetModelHierarchies(v.AssetModelHierarchies, ok); err != nil {
return err
}
}
if v.AssetModelName != nil {
ok := object.Key("assetModelName")
ok.String(*v.AssetModelName)
}
if v.AssetModelProperties != nil {
ok := object.Key("assetModelProperties")
if err := awsRestjson1_serializeDocumentAssetModelProperties(v.AssetModelProperties, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpUpdateAssetProperty struct {
}
func (*awsRestjson1_serializeOpUpdateAssetProperty) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAssetProperty) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateAssetPropertyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties/{propertyId}")
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_serializeOpHttpBindingsUpdateAssetPropertyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAssetPropertyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateAssetPropertyInput(v *UpdateAssetPropertyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.PropertyId == nil || len(*v.PropertyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member propertyId must not be empty")}
}
if v.PropertyId != nil {
if err := encoder.SetURI("propertyId").String(*v.PropertyId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAssetPropertyInput(v *UpdateAssetPropertyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if len(v.PropertyNotificationState) > 0 {
ok := object.Key("propertyNotificationState")
ok.String(string(v.PropertyNotificationState))
}
if v.PropertyUnit != nil {
ok := object.Key("propertyUnit")
ok.String(*v.PropertyUnit)
}
return nil
}
type awsRestjson1_serializeOpUpdateDashboard struct {
}
func (*awsRestjson1_serializeOpUpdateDashboard) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateDashboardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards/{dashboardId}")
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_serializeOpHttpBindingsUpdateDashboardInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateDashboardInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateDashboardInput(v *UpdateDashboardInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DashboardId == nil || len(*v.DashboardId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member dashboardId must not be empty")}
}
if v.DashboardId != nil {
if err := encoder.SetURI("dashboardId").String(*v.DashboardId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateDashboardInput(v *UpdateDashboardInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.DashboardDefinition != nil {
ok := object.Key("dashboardDefinition")
ok.String(*v.DashboardDefinition)
}
if v.DashboardDescription != nil {
ok := object.Key("dashboardDescription")
ok.String(*v.DashboardDescription)
}
if v.DashboardName != nil {
ok := object.Key("dashboardName")
ok.String(*v.DashboardName)
}
return nil
}
type awsRestjson1_serializeOpUpdateGateway struct {
}
func (*awsRestjson1_serializeOpUpdateGateway) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateGatewayInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}")
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_serializeOpHttpBindingsUpdateGatewayInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateGatewayInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateGatewayInput(v *UpdateGatewayInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateGatewayInput(v *UpdateGatewayInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayName != nil {
ok := object.Key("gatewayName")
ok.String(*v.GatewayName)
}
return nil
}
type awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration struct {
}
func (*awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateGatewayCapabilityConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}/capability")
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_serializeOpHttpBindingsUpdateGatewayCapabilityConfigurationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateGatewayCapabilityConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateGatewayCapabilityConfigurationInput(v *UpdateGatewayCapabilityConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateGatewayCapabilityConfigurationInput(v *UpdateGatewayCapabilityConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CapabilityConfiguration != nil {
ok := object.Key("capabilityConfiguration")
ok.String(*v.CapabilityConfiguration)
}
if v.CapabilityNamespace != nil {
ok := object.Key("capabilityNamespace")
ok.String(*v.CapabilityNamespace)
}
return nil
}
type awsRestjson1_serializeOpUpdatePortal struct {
}
func (*awsRestjson1_serializeOpUpdatePortal) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdatePortal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdatePortalInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals/{portalId}")
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_serializeOpHttpBindingsUpdatePortalInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdatePortalInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdatePortalInput(v *UpdatePortalInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PortalId == nil || len(*v.PortalId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member portalId must not be empty")}
}
if v.PortalId != nil {
if err := encoder.SetURI("portalId").String(*v.PortalId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdatePortalInput(v *UpdatePortalInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Alarms != nil {
ok := object.Key("alarms")
if err := awsRestjson1_serializeDocumentAlarms(v.Alarms, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.NotificationSenderEmail != nil {
ok := object.Key("notificationSenderEmail")
ok.String(*v.NotificationSenderEmail)
}
if v.PortalContactEmail != nil {
ok := object.Key("portalContactEmail")
ok.String(*v.PortalContactEmail)
}
if v.PortalDescription != nil {
ok := object.Key("portalDescription")
ok.String(*v.PortalDescription)
}
if v.PortalLogoImage != nil {
ok := object.Key("portalLogoImage")
if err := awsRestjson1_serializeDocumentImage(v.PortalLogoImage, ok); err != nil {
return err
}
}
if v.PortalName != nil {
ok := object.Key("portalName")
ok.String(*v.PortalName)
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
return nil
}
type awsRestjson1_serializeOpUpdateProject struct {
}
func (*awsRestjson1_serializeOpUpdateProject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateProjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}")
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_serializeOpHttpBindingsUpdateProjectInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateProjectInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateProjectInput(v *UpdateProjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateProjectInput(v *UpdateProjectInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ProjectDescription != nil {
ok := object.Key("projectDescription")
ok.String(*v.ProjectDescription)
}
if v.ProjectName != nil {
ok := object.Key("projectName")
ok.String(*v.ProjectName)
}
return nil
}
func awsRestjson1_serializeDocumentAggregateTypes(v []types.AggregateType, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentAlarms(v *types.Alarms, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AlarmRoleArn != nil {
ok := object.Key("alarmRoleArn")
ok.String(*v.AlarmRoleArn)
}
if v.NotificationLambdaArn != nil {
ok := object.Key("notificationLambdaArn")
ok.String(*v.NotificationLambdaArn)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelCompositeModel(v *types.AssetModelCompositeModel, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Properties != nil {
ok := object.Key("properties")
if err := awsRestjson1_serializeDocumentAssetModelProperties(v.Properties, ok); err != nil {
return err
}
}
if v.Type != nil {
ok := object.Key("type")
ok.String(*v.Type)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelCompositeModelDefinition(v *types.AssetModelCompositeModelDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Properties != nil {
ok := object.Key("properties")
if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v.Properties, ok); err != nil {
return err
}
}
if v.Type != nil {
ok := object.Key("type")
ok.String(*v.Type)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelCompositeModelDefinitions(v []types.AssetModelCompositeModelDefinition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelCompositeModelDefinition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelCompositeModels(v []types.AssetModelCompositeModel, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelCompositeModel(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelHierarchies(v []types.AssetModelHierarchy, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelHierarchy(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelHierarchy(v *types.AssetModelHierarchy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChildAssetModelId != nil {
ok := object.Key("childAssetModelId")
ok.String(*v.ChildAssetModelId)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelHierarchyDefinition(v *types.AssetModelHierarchyDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChildAssetModelId != nil {
ok := object.Key("childAssetModelId")
ok.String(*v.ChildAssetModelId)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelHierarchyDefinitions(v []types.AssetModelHierarchyDefinition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelHierarchyDefinition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelProperties(v []types.AssetModelProperty, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelProperty(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelProperty(v *types.AssetModelProperty, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DataType) > 0 {
ok := object.Key("dataType")
ok.String(string(v.DataType))
}
if v.DataTypeSpec != nil {
ok := object.Key("dataTypeSpec")
ok.String(*v.DataTypeSpec)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Type != nil {
ok := object.Key("type")
if err := awsRestjson1_serializeDocumentPropertyType(v.Type, ok); err != nil {
return err
}
}
if v.Unit != nil {
ok := object.Key("unit")
ok.String(*v.Unit)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelPropertyDefinition(v *types.AssetModelPropertyDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DataType) > 0 {
ok := object.Key("dataType")
ok.String(string(v.DataType))
}
if v.DataTypeSpec != nil {
ok := object.Key("dataTypeSpec")
ok.String(*v.DataTypeSpec)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Type != nil {
ok := object.Key("type")
if err := awsRestjson1_serializeDocumentPropertyType(v.Type, ok); err != nil {
return err
}
}
if v.Unit != nil {
ok := object.Key("unit")
ok.String(*v.Unit)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v []types.AssetModelPropertyDefinition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetPropertyValue(v *types.AssetPropertyValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Quality) > 0 {
ok := object.Key("quality")
ok.String(string(v.Quality))
}
if v.Timestamp != nil {
ok := object.Key("timestamp")
if err := awsRestjson1_serializeDocumentTimeInNanos(v.Timestamp, ok); err != nil {
return err
}
}
if v.Value != nil {
ok := object.Key("value")
if err := awsRestjson1_serializeDocumentVariant(v.Value, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetPropertyValues(v []types.AssetPropertyValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetPropertyValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAttribute(v *types.Attribute, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValue != nil {
ok := object.Key("defaultValue")
ok.String(*v.DefaultValue)
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyAggregatesEntries(v []types.BatchGetAssetPropertyAggregatesEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyAggregatesEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyAggregatesEntry(v *types.BatchGetAssetPropertyAggregatesEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AggregateTypes != nil {
ok := object.Key("aggregateTypes")
if err := awsRestjson1_serializeDocumentAggregateTypes(v.AggregateTypes, ok); err != nil {
return err
}
}
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
if v.EndDate != nil {
ok := object.Key("endDate")
ok.Double(smithytime.FormatEpochSeconds(*v.EndDate))
}
if v.EntryId != nil {
ok := object.Key("entryId")
ok.String(*v.EntryId)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
if v.Qualities != nil {
ok := object.Key("qualities")
if err := awsRestjson1_serializeDocumentQualities(v.Qualities, ok); err != nil {
return err
}
}
if v.Resolution != nil {
ok := object.Key("resolution")
ok.String(*v.Resolution)
}
if v.StartDate != nil {
ok := object.Key("startDate")
ok.Double(smithytime.FormatEpochSeconds(*v.StartDate))
}
if len(v.TimeOrdering) > 0 {
ok := object.Key("timeOrdering")
ok.String(string(v.TimeOrdering))
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyValueEntries(v []types.BatchGetAssetPropertyValueEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyValueEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyValueEntry(v *types.BatchGetAssetPropertyValueEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
if v.EntryId != nil {
ok := object.Key("entryId")
ok.String(*v.EntryId)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyValueHistoryEntries(v []types.BatchGetAssetPropertyValueHistoryEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyValueHistoryEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyValueHistoryEntry(v *types.BatchGetAssetPropertyValueHistoryEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
if v.EndDate != nil {
ok := object.Key("endDate")
ok.Double(smithytime.FormatEpochSeconds(*v.EndDate))
}
if v.EntryId != nil {
ok := object.Key("entryId")
ok.String(*v.EntryId)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
if v.Qualities != nil {
ok := object.Key("qualities")
if err := awsRestjson1_serializeDocumentQualities(v.Qualities, ok); err != nil {
return err
}
}
if v.StartDate != nil {
ok := object.Key("startDate")
ok.Double(smithytime.FormatEpochSeconds(*v.StartDate))
}
if len(v.TimeOrdering) > 0 {
ok := object.Key("timeOrdering")
ok.String(string(v.TimeOrdering))
}
return nil
}
func awsRestjson1_serializeDocumentColumnNames(v []types.ColumnName, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentCsv(v *types.Csv, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ColumnNames != nil {
ok := object.Key("columnNames")
if err := awsRestjson1_serializeDocumentColumnNames(v.ColumnNames, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCustomerManagedS3Storage(v *types.CustomerManagedS3Storage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.S3ResourceArn != nil {
ok := object.Key("s3ResourceArn")
ok.String(*v.S3ResourceArn)
}
return nil
}
func awsRestjson1_serializeDocumentErrorReportLocation(v *types.ErrorReportLocation, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bucket != nil {
ok := object.Key("bucket")
ok.String(*v.Bucket)
}
if v.Prefix != nil {
ok := object.Key("prefix")
ok.String(*v.Prefix)
}
return nil
}
func awsRestjson1_serializeDocumentExpressionVariable(v *types.ExpressionVariable, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Value != nil {
ok := object.Key("value")
if err := awsRestjson1_serializeDocumentVariableValue(v.Value, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentExpressionVariables(v []types.ExpressionVariable, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentExpressionVariable(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFile(v *types.File, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bucket != nil {
ok := object.Key("bucket")
ok.String(*v.Bucket)
}
if v.Key != nil {
ok := object.Key("key")
ok.String(*v.Key)
}
if v.VersionId != nil {
ok := object.Key("versionId")
ok.String(*v.VersionId)
}
return nil
}
func awsRestjson1_serializeDocumentFileFormat(v *types.FileFormat, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Csv != nil {
ok := object.Key("csv")
if err := awsRestjson1_serializeDocumentCsv(v.Csv, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFiles(v []types.File, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentFile(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentForwardingConfig(v *types.ForwardingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.State) > 0 {
ok := object.Key("state")
ok.String(string(v.State))
}
return nil
}
func awsRestjson1_serializeDocumentGatewayPlatform(v *types.GatewayPlatform, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Greengrass != nil {
ok := object.Key("greengrass")
if err := awsRestjson1_serializeDocumentGreengrass(v.Greengrass, ok); err != nil {
return err
}
}
if v.GreengrassV2 != nil {
ok := object.Key("greengrassV2")
if err := awsRestjson1_serializeDocumentGreengrassV2(v.GreengrassV2, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentGreengrass(v *types.Greengrass, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GroupArn != nil {
ok := object.Key("groupArn")
ok.String(*v.GroupArn)
}
return nil
}
func awsRestjson1_serializeDocumentGreengrassV2(v *types.GreengrassV2, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CoreDeviceThingName != nil {
ok := object.Key("coreDeviceThingName")
ok.String(*v.CoreDeviceThingName)
}
return nil
}
func awsRestjson1_serializeDocumentGroupIdentity(v *types.GroupIdentity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentIAMRoleIdentity(v *types.IAMRoleIdentity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("arn")
ok.String(*v.Arn)
}
return nil
}
func awsRestjson1_serializeDocumentIAMUserIdentity(v *types.IAMUserIdentity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("arn")
ok.String(*v.Arn)
}
return nil
}
func awsRestjson1_serializeDocumentIdentity(v *types.Identity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Group != nil {
ok := object.Key("group")
if err := awsRestjson1_serializeDocumentGroupIdentity(v.Group, ok); err != nil {
return err
}
}
if v.IamRole != nil {
ok := object.Key("iamRole")
if err := awsRestjson1_serializeDocumentIAMRoleIdentity(v.IamRole, ok); err != nil {
return err
}
}
if v.IamUser != nil {
ok := object.Key("iamUser")
if err := awsRestjson1_serializeDocumentIAMUserIdentity(v.IamUser, ok); err != nil {
return err
}
}
if v.User != nil {
ok := object.Key("user")
if err := awsRestjson1_serializeDocumentUserIdentity(v.User, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIDs(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_serializeDocumentImage(v *types.Image, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.File != nil {
ok := object.Key("file")
if err := awsRestjson1_serializeDocumentImageFile(v.File, ok); err != nil {
return err
}
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentImageFile(v *types.ImageFile, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("data")
ok.Base64EncodeBytes(v.Data)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentJobConfiguration(v *types.JobConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileFormat != nil {
ok := object.Key("fileFormat")
if err := awsRestjson1_serializeDocumentFileFormat(v.FileFormat, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentLoggingOptions(v *types.LoggingOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Level) > 0 {
ok := object.Key("level")
ok.String(string(v.Level))
}
return nil
}
func awsRestjson1_serializeDocumentMeasurement(v *types.Measurement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProcessingConfig != nil {
ok := object.Key("processingConfig")
if err := awsRestjson1_serializeDocumentMeasurementProcessingConfig(v.ProcessingConfig, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMeasurementProcessingConfig(v *types.MeasurementProcessingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ForwardingConfig != nil {
ok := object.Key("forwardingConfig")
if err := awsRestjson1_serializeDocumentForwardingConfig(v.ForwardingConfig, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMetric(v *types.Metric, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Expression != nil {
ok := object.Key("expression")
ok.String(*v.Expression)
}
if v.ProcessingConfig != nil {
ok := object.Key("processingConfig")
if err := awsRestjson1_serializeDocumentMetricProcessingConfig(v.ProcessingConfig, ok); err != nil {
return err
}
}
if v.Variables != nil {
ok := object.Key("variables")
if err := awsRestjson1_serializeDocumentExpressionVariables(v.Variables, ok); err != nil {
return err
}
}
if v.Window != nil {
ok := object.Key("window")
if err := awsRestjson1_serializeDocumentMetricWindow(v.Window, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMetricProcessingConfig(v *types.MetricProcessingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ComputeLocation) > 0 {
ok := object.Key("computeLocation")
ok.String(string(v.ComputeLocation))
}
return nil
}
func awsRestjson1_serializeDocumentMetricWindow(v *types.MetricWindow, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tumbling != nil {
ok := object.Key("tumbling")
if err := awsRestjson1_serializeDocumentTumblingWindow(v.Tumbling, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMultiLayerStorage(v *types.MultiLayerStorage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomerManagedS3Storage != nil {
ok := object.Key("customerManagedS3Storage")
if err := awsRestjson1_serializeDocumentCustomerManagedS3Storage(v.CustomerManagedS3Storage, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPortalResource(v *types.PortalResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentProjectResource(v *types.ProjectResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentPropertyType(v *types.PropertyType, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Attribute != nil {
ok := object.Key("attribute")
if err := awsRestjson1_serializeDocumentAttribute(v.Attribute, ok); err != nil {
return err
}
}
if v.Measurement != nil {
ok := object.Key("measurement")
if err := awsRestjson1_serializeDocumentMeasurement(v.Measurement, ok); err != nil {
return err
}
}
if v.Metric != nil {
ok := object.Key("metric")
if err := awsRestjson1_serializeDocumentMetric(v.Metric, ok); err != nil {
return err
}
}
if v.Transform != nil {
ok := object.Key("transform")
if err := awsRestjson1_serializeDocumentTransform(v.Transform, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPutAssetPropertyValueEntries(v []types.PutAssetPropertyValueEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentPutAssetPropertyValueEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPutAssetPropertyValueEntry(v *types.PutAssetPropertyValueEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
if v.EntryId != nil {
ok := object.Key("entryId")
ok.String(*v.EntryId)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
if v.PropertyValues != nil {
ok := object.Key("propertyValues")
if err := awsRestjson1_serializeDocumentAssetPropertyValues(v.PropertyValues, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentQualities(v []types.Quality, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentResource(v *types.Resource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Portal != nil {
ok := object.Key("portal")
if err := awsRestjson1_serializeDocumentPortalResource(v.Portal, ok); err != nil {
return err
}
}
if v.Project != nil {
ok := object.Key("project")
if err := awsRestjson1_serializeDocumentProjectResource(v.Project, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentRetentionPeriod(v *types.RetentionPeriod, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NumberOfDays != nil {
ok := object.Key("numberOfDays")
ok.Integer(*v.NumberOfDays)
}
if v.Unlimited != nil {
ok := object.Key("unlimited")
ok.Boolean(*v.Unlimited)
}
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_serializeDocumentTimeInNanos(v *types.TimeInNanos, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.OffsetInNanos != nil {
ok := object.Key("offsetInNanos")
ok.Integer(*v.OffsetInNanos)
}
if v.TimeInSeconds != nil {
ok := object.Key("timeInSeconds")
ok.Long(*v.TimeInSeconds)
}
return nil
}
func awsRestjson1_serializeDocumentTransform(v *types.Transform, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Expression != nil {
ok := object.Key("expression")
ok.String(*v.Expression)
}
if v.ProcessingConfig != nil {
ok := object.Key("processingConfig")
if err := awsRestjson1_serializeDocumentTransformProcessingConfig(v.ProcessingConfig, ok); err != nil {
return err
}
}
if v.Variables != nil {
ok := object.Key("variables")
if err := awsRestjson1_serializeDocumentExpressionVariables(v.Variables, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTransformProcessingConfig(v *types.TransformProcessingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ComputeLocation) > 0 {
ok := object.Key("computeLocation")
ok.String(string(v.ComputeLocation))
}
if v.ForwardingConfig != nil {
ok := object.Key("forwardingConfig")
if err := awsRestjson1_serializeDocumentForwardingConfig(v.ForwardingConfig, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTumblingWindow(v *types.TumblingWindow, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Interval != nil {
ok := object.Key("interval")
ok.String(*v.Interval)
}
if v.Offset != nil {
ok := object.Key("offset")
ok.String(*v.Offset)
}
return nil
}
func awsRestjson1_serializeDocumentUserIdentity(v *types.UserIdentity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentVariableValue(v *types.VariableValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.HierarchyId != nil {
ok := object.Key("hierarchyId")
ok.String(*v.HierarchyId)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
return nil
}
func awsRestjson1_serializeDocumentVariant(v *types.Variant, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BooleanValue != nil {
ok := object.Key("booleanValue")
ok.Boolean(*v.BooleanValue)
}
if v.DoubleValue != nil {
ok := object.Key("doubleValue")
switch {
case math.IsNaN(*v.DoubleValue):
ok.String("NaN")
case math.IsInf(*v.DoubleValue, 1):
ok.String("Infinity")
case math.IsInf(*v.DoubleValue, -1):
ok.String("-Infinity")
default:
ok.Double(*v.DoubleValue)
}
}
if v.IntegerValue != nil {
ok := object.Key("integerValue")
ok.Integer(*v.IntegerValue)
}
if v.StringValue != nil {
ok := object.Key("stringValue")
ok.String(*v.StringValue)
}
return nil
}
| 6,762 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/iotsitewise/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAssociateAssets struct {
}
func (*validateOpAssociateAssets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateAssets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateAssetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateAssetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAssociateTimeSeriesToAssetProperty struct {
}
func (*validateOpAssociateTimeSeriesToAssetProperty) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateTimeSeriesToAssetProperty) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateTimeSeriesToAssetPropertyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateTimeSeriesToAssetPropertyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchAssociateProjectAssets struct {
}
func (*validateOpBatchAssociateProjectAssets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchAssociateProjectAssets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchAssociateProjectAssetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchAssociateProjectAssetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchDisassociateProjectAssets struct {
}
func (*validateOpBatchDisassociateProjectAssets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchDisassociateProjectAssets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchDisassociateProjectAssetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchDisassociateProjectAssetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchGetAssetPropertyAggregates struct {
}
func (*validateOpBatchGetAssetPropertyAggregates) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchGetAssetPropertyAggregates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchGetAssetPropertyAggregatesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchGetAssetPropertyAggregatesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchGetAssetPropertyValueHistory struct {
}
func (*validateOpBatchGetAssetPropertyValueHistory) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchGetAssetPropertyValueHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchGetAssetPropertyValueHistoryInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchGetAssetPropertyValueHistoryInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchGetAssetPropertyValue struct {
}
func (*validateOpBatchGetAssetPropertyValue) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchGetAssetPropertyValue) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchGetAssetPropertyValueInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchGetAssetPropertyValueInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpBatchPutAssetPropertyValue struct {
}
func (*validateOpBatchPutAssetPropertyValue) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchPutAssetPropertyValue) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchPutAssetPropertyValueInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchPutAssetPropertyValueInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAccessPolicy struct {
}
func (*validateOpCreateAccessPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAccessPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAccessPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAsset struct {
}
func (*validateOpCreateAsset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAsset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAssetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAssetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAssetModel struct {
}
func (*validateOpCreateAssetModel) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAssetModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAssetModelInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAssetModelInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateBulkImportJob struct {
}
func (*validateOpCreateBulkImportJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateBulkImportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateBulkImportJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateBulkImportJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDashboard struct {
}
func (*validateOpCreateDashboard) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDashboard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDashboardInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDashboardInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateGateway struct {
}
func (*validateOpCreateGateway) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateGatewayInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateGatewayInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreatePortal struct {
}
func (*validateOpCreatePortal) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreatePortal) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreatePortalInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreatePortalInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateProject struct {
}
func (*validateOpCreateProject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateProjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateProjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAccessPolicy struct {
}
func (*validateOpDeleteAccessPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAccessPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAccessPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAsset struct {
}
func (*validateOpDeleteAsset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAsset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAssetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAssetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAssetModel struct {
}
func (*validateOpDeleteAssetModel) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAssetModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAssetModelInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAssetModelInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDashboard struct {
}
func (*validateOpDeleteDashboard) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDashboard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDashboardInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDashboardInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteGateway struct {
}
func (*validateOpDeleteGateway) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteGatewayInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteGatewayInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeletePortal struct {
}
func (*validateOpDeletePortal) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeletePortal) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeletePortalInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeletePortalInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteProject struct {
}
func (*validateOpDeleteProject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteProjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteProjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAccessPolicy struct {
}
func (*validateOpDescribeAccessPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAccessPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAccessPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAsset struct {
}
func (*validateOpDescribeAsset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAsset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAssetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAssetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAssetModel struct {
}
func (*validateOpDescribeAssetModel) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAssetModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAssetModelInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAssetModelInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAssetProperty struct {
}
func (*validateOpDescribeAssetProperty) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAssetProperty) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAssetPropertyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAssetPropertyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeBulkImportJob struct {
}
func (*validateOpDescribeBulkImportJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeBulkImportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeBulkImportJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeBulkImportJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeDashboard struct {
}
func (*validateOpDescribeDashboard) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeDashboard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeDashboardInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeDashboardInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeGatewayCapabilityConfiguration struct {
}
func (*validateOpDescribeGatewayCapabilityConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeGatewayCapabilityConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeGatewayCapabilityConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeGatewayCapabilityConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeGateway struct {
}
func (*validateOpDescribeGateway) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeGatewayInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeGatewayInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribePortal struct {
}
func (*validateOpDescribePortal) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribePortal) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribePortalInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribePortalInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeProject struct {
}
func (*validateOpDescribeProject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeProjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeProjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateAssets struct {
}
func (*validateOpDisassociateAssets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateAssets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateAssetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateAssetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateTimeSeriesFromAssetProperty struct {
}
func (*validateOpDisassociateTimeSeriesFromAssetProperty) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateTimeSeriesFromAssetProperty) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateTimeSeriesFromAssetPropertyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateTimeSeriesFromAssetPropertyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAssetPropertyAggregates struct {
}
func (*validateOpGetAssetPropertyAggregates) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAssetPropertyAggregates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAssetPropertyAggregatesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAssetPropertyAggregatesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetInterpolatedAssetPropertyValues struct {
}
func (*validateOpGetInterpolatedAssetPropertyValues) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetInterpolatedAssetPropertyValues) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetInterpolatedAssetPropertyValuesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetInterpolatedAssetPropertyValuesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAssetModelProperties struct {
}
func (*validateOpListAssetModelProperties) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAssetModelProperties) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAssetModelPropertiesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAssetModelPropertiesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAssetProperties struct {
}
func (*validateOpListAssetProperties) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAssetProperties) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAssetPropertiesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAssetPropertiesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAssetRelationships struct {
}
func (*validateOpListAssetRelationships) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAssetRelationships) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAssetRelationshipsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAssetRelationshipsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAssociatedAssets struct {
}
func (*validateOpListAssociatedAssets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAssociatedAssets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAssociatedAssetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAssociatedAssetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListDashboards struct {
}
func (*validateOpListDashboards) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListDashboards) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListDashboardsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListDashboardsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListProjectAssets struct {
}
func (*validateOpListProjectAssets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListProjectAssets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListProjectAssetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListProjectAssetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListProjects struct {
}
func (*validateOpListProjects) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListProjects) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListProjectsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListProjectsInput(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 validateOpPutDefaultEncryptionConfiguration struct {
}
func (*validateOpPutDefaultEncryptionConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutDefaultEncryptionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutDefaultEncryptionConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutDefaultEncryptionConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutLoggingOptions struct {
}
func (*validateOpPutLoggingOptions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutLoggingOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutLoggingOptionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutLoggingOptionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutStorageConfiguration struct {
}
func (*validateOpPutStorageConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutStorageConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutStorageConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutStorageConfigurationInput(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 validateOpUpdateAccessPolicy struct {
}
func (*validateOpUpdateAccessPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAccessPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAccessPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAccessPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateAsset struct {
}
func (*validateOpUpdateAsset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAsset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAssetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAssetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateAssetModel struct {
}
func (*validateOpUpdateAssetModel) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAssetModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAssetModelInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAssetModelInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateAssetProperty struct {
}
func (*validateOpUpdateAssetProperty) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAssetProperty) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAssetPropertyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAssetPropertyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateDashboard struct {
}
func (*validateOpUpdateDashboard) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateDashboard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateDashboardInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateDashboardInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateGatewayCapabilityConfiguration struct {
}
func (*validateOpUpdateGatewayCapabilityConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateGatewayCapabilityConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateGatewayCapabilityConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateGatewayCapabilityConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateGateway struct {
}
func (*validateOpUpdateGateway) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateGatewayInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateGatewayInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdatePortal struct {
}
func (*validateOpUpdatePortal) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdatePortal) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdatePortalInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdatePortalInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateProject struct {
}
func (*validateOpUpdateProject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateProjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateProjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAssociateAssetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateAssets{}, middleware.After)
}
func addOpAssociateTimeSeriesToAssetPropertyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateTimeSeriesToAssetProperty{}, middleware.After)
}
func addOpBatchAssociateProjectAssetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchAssociateProjectAssets{}, middleware.After)
}
func addOpBatchDisassociateProjectAssetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchDisassociateProjectAssets{}, middleware.After)
}
func addOpBatchGetAssetPropertyAggregatesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchGetAssetPropertyAggregates{}, middleware.After)
}
func addOpBatchGetAssetPropertyValueHistoryValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchGetAssetPropertyValueHistory{}, middleware.After)
}
func addOpBatchGetAssetPropertyValueValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchGetAssetPropertyValue{}, middleware.After)
}
func addOpBatchPutAssetPropertyValueValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchPutAssetPropertyValue{}, middleware.After)
}
func addOpCreateAccessPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAccessPolicy{}, middleware.After)
}
func addOpCreateAssetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAsset{}, middleware.After)
}
func addOpCreateAssetModelValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAssetModel{}, middleware.After)
}
func addOpCreateBulkImportJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateBulkImportJob{}, middleware.After)
}
func addOpCreateDashboardValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDashboard{}, middleware.After)
}
func addOpCreateGatewayValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateGateway{}, middleware.After)
}
func addOpCreatePortalValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreatePortal{}, middleware.After)
}
func addOpCreateProjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateProject{}, middleware.After)
}
func addOpDeleteAccessPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAccessPolicy{}, middleware.After)
}
func addOpDeleteAssetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAsset{}, middleware.After)
}
func addOpDeleteAssetModelValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAssetModel{}, middleware.After)
}
func addOpDeleteDashboardValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDashboard{}, middleware.After)
}
func addOpDeleteGatewayValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteGateway{}, middleware.After)
}
func addOpDeletePortalValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeletePortal{}, middleware.After)
}
func addOpDeleteProjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteProject{}, middleware.After)
}
func addOpDescribeAccessPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAccessPolicy{}, middleware.After)
}
func addOpDescribeAssetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAsset{}, middleware.After)
}
func addOpDescribeAssetModelValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAssetModel{}, middleware.After)
}
func addOpDescribeAssetPropertyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAssetProperty{}, middleware.After)
}
func addOpDescribeBulkImportJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeBulkImportJob{}, middleware.After)
}
func addOpDescribeDashboardValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeDashboard{}, middleware.After)
}
func addOpDescribeGatewayCapabilityConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeGatewayCapabilityConfiguration{}, middleware.After)
}
func addOpDescribeGatewayValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeGateway{}, middleware.After)
}
func addOpDescribePortalValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribePortal{}, middleware.After)
}
func addOpDescribeProjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeProject{}, middleware.After)
}
func addOpDisassociateAssetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateAssets{}, middleware.After)
}
func addOpDisassociateTimeSeriesFromAssetPropertyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateTimeSeriesFromAssetProperty{}, middleware.After)
}
func addOpGetAssetPropertyAggregatesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAssetPropertyAggregates{}, middleware.After)
}
func addOpGetInterpolatedAssetPropertyValuesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetInterpolatedAssetPropertyValues{}, middleware.After)
}
func addOpListAssetModelPropertiesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAssetModelProperties{}, middleware.After)
}
func addOpListAssetPropertiesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAssetProperties{}, middleware.After)
}
func addOpListAssetRelationshipsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAssetRelationships{}, middleware.After)
}
func addOpListAssociatedAssetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAssociatedAssets{}, middleware.After)
}
func addOpListDashboardsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListDashboards{}, middleware.After)
}
func addOpListProjectAssetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListProjectAssets{}, middleware.After)
}
func addOpListProjectsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListProjects{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpPutDefaultEncryptionConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutDefaultEncryptionConfiguration{}, middleware.After)
}
func addOpPutLoggingOptionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutLoggingOptions{}, middleware.After)
}
func addOpPutStorageConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutStorageConfiguration{}, 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 addOpUpdateAccessPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAccessPolicy{}, middleware.After)
}
func addOpUpdateAssetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAsset{}, middleware.After)
}
func addOpUpdateAssetModelValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAssetModel{}, middleware.After)
}
func addOpUpdateAssetPropertyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAssetProperty{}, middleware.After)
}
func addOpUpdateDashboardValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateDashboard{}, middleware.After)
}
func addOpUpdateGatewayCapabilityConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateGatewayCapabilityConfiguration{}, middleware.After)
}
func addOpUpdateGatewayValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateGateway{}, middleware.After)
}
func addOpUpdatePortalValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdatePortal{}, middleware.After)
}
func addOpUpdateProjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateProject{}, middleware.After)
}
func validateAlarms(v *types.Alarms) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Alarms"}
if v.AlarmRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("AlarmRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelCompositeModel(v *types.AssetModelCompositeModel) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelCompositeModel"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.Properties != nil {
if err := validateAssetModelProperties(v.Properties); err != nil {
invalidParams.AddNested("Properties", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelCompositeModelDefinition(v *types.AssetModelCompositeModelDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelCompositeModelDefinition"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.Properties != nil {
if err := validateAssetModelPropertyDefinitions(v.Properties); err != nil {
invalidParams.AddNested("Properties", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelCompositeModelDefinitions(v []types.AssetModelCompositeModelDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelCompositeModelDefinitions"}
for i := range v {
if err := validateAssetModelCompositeModelDefinition(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelCompositeModels(v []types.AssetModelCompositeModel) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelCompositeModels"}
for i := range v {
if err := validateAssetModelCompositeModel(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelHierarchies(v []types.AssetModelHierarchy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelHierarchies"}
for i := range v {
if err := validateAssetModelHierarchy(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelHierarchy(v *types.AssetModelHierarchy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelHierarchy"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChildAssetModelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChildAssetModelId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelHierarchyDefinition(v *types.AssetModelHierarchyDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelHierarchyDefinition"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ChildAssetModelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChildAssetModelId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelHierarchyDefinitions(v []types.AssetModelHierarchyDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelHierarchyDefinitions"}
for i := range v {
if err := validateAssetModelHierarchyDefinition(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelProperties(v []types.AssetModelProperty) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelProperties"}
for i := range v {
if err := validateAssetModelProperty(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelProperty(v *types.AssetModelProperty) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelProperty"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.DataType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DataType"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
} else if v.Type != nil {
if err := validatePropertyType(v.Type); err != nil {
invalidParams.AddNested("Type", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelPropertyDefinition(v *types.AssetModelPropertyDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelPropertyDefinition"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.DataType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DataType"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
} else if v.Type != nil {
if err := validatePropertyType(v.Type); err != nil {
invalidParams.AddNested("Type", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetModelPropertyDefinitions(v []types.AssetModelPropertyDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetModelPropertyDefinitions"}
for i := range v {
if err := validateAssetModelPropertyDefinition(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetPropertyValue(v *types.AssetPropertyValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetPropertyValue"}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if v.Timestamp == nil {
invalidParams.Add(smithy.NewErrParamRequired("Timestamp"))
} else if v.Timestamp != nil {
if err := validateTimeInNanos(v.Timestamp); err != nil {
invalidParams.AddNested("Timestamp", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAssetPropertyValues(v []types.AssetPropertyValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssetPropertyValues"}
for i := range v {
if err := validateAssetPropertyValue(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBatchGetAssetPropertyAggregatesEntries(v []types.BatchGetAssetPropertyAggregatesEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetAssetPropertyAggregatesEntries"}
for i := range v {
if err := validateBatchGetAssetPropertyAggregatesEntry(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBatchGetAssetPropertyAggregatesEntry(v *types.BatchGetAssetPropertyAggregatesEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetAssetPropertyAggregatesEntry"}
if v.EntryId == nil {
invalidParams.Add(smithy.NewErrParamRequired("EntryId"))
}
if v.AggregateTypes == nil {
invalidParams.Add(smithy.NewErrParamRequired("AggregateTypes"))
}
if v.Resolution == nil {
invalidParams.Add(smithy.NewErrParamRequired("Resolution"))
}
if v.StartDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartDate"))
}
if v.EndDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndDate"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBatchGetAssetPropertyValueEntries(v []types.BatchGetAssetPropertyValueEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetAssetPropertyValueEntries"}
for i := range v {
if err := validateBatchGetAssetPropertyValueEntry(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBatchGetAssetPropertyValueEntry(v *types.BatchGetAssetPropertyValueEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetAssetPropertyValueEntry"}
if v.EntryId == nil {
invalidParams.Add(smithy.NewErrParamRequired("EntryId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBatchGetAssetPropertyValueHistoryEntries(v []types.BatchGetAssetPropertyValueHistoryEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetAssetPropertyValueHistoryEntries"}
for i := range v {
if err := validateBatchGetAssetPropertyValueHistoryEntry(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBatchGetAssetPropertyValueHistoryEntry(v *types.BatchGetAssetPropertyValueHistoryEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetAssetPropertyValueHistoryEntry"}
if v.EntryId == nil {
invalidParams.Add(smithy.NewErrParamRequired("EntryId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomerManagedS3Storage(v *types.CustomerManagedS3Storage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomerManagedS3Storage"}
if v.S3ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3ResourceArn"))
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateErrorReportLocation(v *types.ErrorReportLocation) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ErrorReportLocation"}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.Prefix == nil {
invalidParams.Add(smithy.NewErrParamRequired("Prefix"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExpressionVariable(v *types.ExpressionVariable) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExpressionVariable"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
} else if v.Value != nil {
if err := validateVariableValue(v.Value); err != nil {
invalidParams.AddNested("Value", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExpressionVariables(v []types.ExpressionVariable) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExpressionVariables"}
for i := range v {
if err := validateExpressionVariable(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFile(v *types.File) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "File"}
if v.Bucket == nil {
invalidParams.Add(smithy.NewErrParamRequired("Bucket"))
}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFiles(v []types.File) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Files"}
for i := range v {
if err := validateFile(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateForwardingConfig(v *types.ForwardingConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ForwardingConfig"}
if len(v.State) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("State"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGatewayPlatform(v *types.GatewayPlatform) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GatewayPlatform"}
if v.Greengrass != nil {
if err := validateGreengrass(v.Greengrass); err != nil {
invalidParams.AddNested("Greengrass", err.(smithy.InvalidParamsError))
}
}
if v.GreengrassV2 != nil {
if err := validateGreengrassV2(v.GreengrassV2); err != nil {
invalidParams.AddNested("GreengrassV2", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGreengrass(v *types.Greengrass) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Greengrass"}
if v.GroupArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("GroupArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGreengrassV2(v *types.GreengrassV2) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GreengrassV2"}
if v.CoreDeviceThingName == nil {
invalidParams.Add(smithy.NewErrParamRequired("CoreDeviceThingName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateGroupIdentity(v *types.GroupIdentity) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GroupIdentity"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIAMRoleIdentity(v *types.IAMRoleIdentity) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IAMRoleIdentity"}
if v.Arn == nil {
invalidParams.Add(smithy.NewErrParamRequired("Arn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIAMUserIdentity(v *types.IAMUserIdentity) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IAMUserIdentity"}
if v.Arn == nil {
invalidParams.Add(smithy.NewErrParamRequired("Arn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIdentity(v *types.Identity) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Identity"}
if v.User != nil {
if err := validateUserIdentity(v.User); err != nil {
invalidParams.AddNested("User", err.(smithy.InvalidParamsError))
}
}
if v.Group != nil {
if err := validateGroupIdentity(v.Group); err != nil {
invalidParams.AddNested("Group", err.(smithy.InvalidParamsError))
}
}
if v.IamUser != nil {
if err := validateIAMUserIdentity(v.IamUser); err != nil {
invalidParams.AddNested("IamUser", err.(smithy.InvalidParamsError))
}
}
if v.IamRole != nil {
if err := validateIAMRoleIdentity(v.IamRole); err != nil {
invalidParams.AddNested("IamRole", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImage(v *types.Image) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Image"}
if v.File != nil {
if err := validateImageFile(v.File); err != nil {
invalidParams.AddNested("File", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImageFile(v *types.ImageFile) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImageFile"}
if v.Data == nil {
invalidParams.Add(smithy.NewErrParamRequired("Data"))
}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobConfiguration(v *types.JobConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobConfiguration"}
if v.FileFormat == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileFormat"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLoggingOptions(v *types.LoggingOptions) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LoggingOptions"}
if len(v.Level) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Level"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMeasurement(v *types.Measurement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Measurement"}
if v.ProcessingConfig != nil {
if err := validateMeasurementProcessingConfig(v.ProcessingConfig); err != nil {
invalidParams.AddNested("ProcessingConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMeasurementProcessingConfig(v *types.MeasurementProcessingConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MeasurementProcessingConfig"}
if v.ForwardingConfig == nil {
invalidParams.Add(smithy.NewErrParamRequired("ForwardingConfig"))
} else if v.ForwardingConfig != nil {
if err := validateForwardingConfig(v.ForwardingConfig); err != nil {
invalidParams.AddNested("ForwardingConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMetric(v *types.Metric) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Metric"}
if v.Expression == nil {
invalidParams.Add(smithy.NewErrParamRequired("Expression"))
}
if v.Variables == nil {
invalidParams.Add(smithy.NewErrParamRequired("Variables"))
} else if v.Variables != nil {
if err := validateExpressionVariables(v.Variables); err != nil {
invalidParams.AddNested("Variables", err.(smithy.InvalidParamsError))
}
}
if v.Window == nil {
invalidParams.Add(smithy.NewErrParamRequired("Window"))
} else if v.Window != nil {
if err := validateMetricWindow(v.Window); err != nil {
invalidParams.AddNested("Window", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfig != nil {
if err := validateMetricProcessingConfig(v.ProcessingConfig); err != nil {
invalidParams.AddNested("ProcessingConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMetricProcessingConfig(v *types.MetricProcessingConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MetricProcessingConfig"}
if len(v.ComputeLocation) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ComputeLocation"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMetricWindow(v *types.MetricWindow) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MetricWindow"}
if v.Tumbling != nil {
if err := validateTumblingWindow(v.Tumbling); err != nil {
invalidParams.AddNested("Tumbling", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMultiLayerStorage(v *types.MultiLayerStorage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MultiLayerStorage"}
if v.CustomerManagedS3Storage == nil {
invalidParams.Add(smithy.NewErrParamRequired("CustomerManagedS3Storage"))
} else if v.CustomerManagedS3Storage != nil {
if err := validateCustomerManagedS3Storage(v.CustomerManagedS3Storage); err != nil {
invalidParams.AddNested("CustomerManagedS3Storage", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePortalResource(v *types.PortalResource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PortalResource"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProjectResource(v *types.ProjectResource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProjectResource"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePropertyType(v *types.PropertyType) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PropertyType"}
if v.Measurement != nil {
if err := validateMeasurement(v.Measurement); err != nil {
invalidParams.AddNested("Measurement", err.(smithy.InvalidParamsError))
}
}
if v.Transform != nil {
if err := validateTransform(v.Transform); err != nil {
invalidParams.AddNested("Transform", err.(smithy.InvalidParamsError))
}
}
if v.Metric != nil {
if err := validateMetric(v.Metric); err != nil {
invalidParams.AddNested("Metric", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePutAssetPropertyValueEntries(v []types.PutAssetPropertyValueEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAssetPropertyValueEntries"}
for i := range v {
if err := validatePutAssetPropertyValueEntry(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePutAssetPropertyValueEntry(v *types.PutAssetPropertyValueEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAssetPropertyValueEntry"}
if v.EntryId == nil {
invalidParams.Add(smithy.NewErrParamRequired("EntryId"))
}
if v.PropertyValues == nil {
invalidParams.Add(smithy.NewErrParamRequired("PropertyValues"))
} else if v.PropertyValues != nil {
if err := validateAssetPropertyValues(v.PropertyValues); err != nil {
invalidParams.AddNested("PropertyValues", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateResource(v *types.Resource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Resource"}
if v.Portal != nil {
if err := validatePortalResource(v.Portal); err != nil {
invalidParams.AddNested("Portal", err.(smithy.InvalidParamsError))
}
}
if v.Project != nil {
if err := validateProjectResource(v.Project); err != nil {
invalidParams.AddNested("Project", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTimeInNanos(v *types.TimeInNanos) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TimeInNanos"}
if v.TimeInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeInSeconds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTransform(v *types.Transform) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Transform"}
if v.Expression == nil {
invalidParams.Add(smithy.NewErrParamRequired("Expression"))
}
if v.Variables == nil {
invalidParams.Add(smithy.NewErrParamRequired("Variables"))
} else if v.Variables != nil {
if err := validateExpressionVariables(v.Variables); err != nil {
invalidParams.AddNested("Variables", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfig != nil {
if err := validateTransformProcessingConfig(v.ProcessingConfig); err != nil {
invalidParams.AddNested("ProcessingConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTransformProcessingConfig(v *types.TransformProcessingConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TransformProcessingConfig"}
if len(v.ComputeLocation) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ComputeLocation"))
}
if v.ForwardingConfig != nil {
if err := validateForwardingConfig(v.ForwardingConfig); err != nil {
invalidParams.AddNested("ForwardingConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTumblingWindow(v *types.TumblingWindow) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TumblingWindow"}
if v.Interval == nil {
invalidParams.Add(smithy.NewErrParamRequired("Interval"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUserIdentity(v *types.UserIdentity) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UserIdentity"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateVariableValue(v *types.VariableValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "VariableValue"}
if v.PropertyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PropertyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateAssetsInput(v *AssociateAssetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateAssetsInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if v.HierarchyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("HierarchyId"))
}
if v.ChildAssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChildAssetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateTimeSeriesToAssetPropertyInput(v *AssociateTimeSeriesToAssetPropertyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateTimeSeriesToAssetPropertyInput"}
if v.Alias == nil {
invalidParams.Add(smithy.NewErrParamRequired("Alias"))
}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if v.PropertyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PropertyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchAssociateProjectAssetsInput(v *BatchAssociateProjectAssetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchAssociateProjectAssetsInput"}
if v.ProjectId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectId"))
}
if v.AssetIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchDisassociateProjectAssetsInput(v *BatchDisassociateProjectAssetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchDisassociateProjectAssetsInput"}
if v.ProjectId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectId"))
}
if v.AssetIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchGetAssetPropertyAggregatesInput(v *BatchGetAssetPropertyAggregatesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetAssetPropertyAggregatesInput"}
if v.Entries == nil {
invalidParams.Add(smithy.NewErrParamRequired("Entries"))
} else if v.Entries != nil {
if err := validateBatchGetAssetPropertyAggregatesEntries(v.Entries); err != nil {
invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchGetAssetPropertyValueHistoryInput(v *BatchGetAssetPropertyValueHistoryInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetAssetPropertyValueHistoryInput"}
if v.Entries == nil {
invalidParams.Add(smithy.NewErrParamRequired("Entries"))
} else if v.Entries != nil {
if err := validateBatchGetAssetPropertyValueHistoryEntries(v.Entries); err != nil {
invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchGetAssetPropertyValueInput(v *BatchGetAssetPropertyValueInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetAssetPropertyValueInput"}
if v.Entries == nil {
invalidParams.Add(smithy.NewErrParamRequired("Entries"))
} else if v.Entries != nil {
if err := validateBatchGetAssetPropertyValueEntries(v.Entries); err != nil {
invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchPutAssetPropertyValueInput(v *BatchPutAssetPropertyValueInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchPutAssetPropertyValueInput"}
if v.Entries == nil {
invalidParams.Add(smithy.NewErrParamRequired("Entries"))
} else if v.Entries != nil {
if err := validatePutAssetPropertyValueEntries(v.Entries); err != nil {
invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAccessPolicyInput(v *CreateAccessPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAccessPolicyInput"}
if v.AccessPolicyIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccessPolicyIdentity"))
} else if v.AccessPolicyIdentity != nil {
if err := validateIdentity(v.AccessPolicyIdentity); err != nil {
invalidParams.AddNested("AccessPolicyIdentity", err.(smithy.InvalidParamsError))
}
}
if v.AccessPolicyResource == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccessPolicyResource"))
} else if v.AccessPolicyResource != nil {
if err := validateResource(v.AccessPolicyResource); err != nil {
invalidParams.AddNested("AccessPolicyResource", err.(smithy.InvalidParamsError))
}
}
if len(v.AccessPolicyPermission) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("AccessPolicyPermission"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAssetInput(v *CreateAssetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAssetInput"}
if v.AssetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetName"))
}
if v.AssetModelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetModelId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAssetModelInput(v *CreateAssetModelInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAssetModelInput"}
if v.AssetModelName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetModelName"))
}
if v.AssetModelProperties != nil {
if err := validateAssetModelPropertyDefinitions(v.AssetModelProperties); err != nil {
invalidParams.AddNested("AssetModelProperties", err.(smithy.InvalidParamsError))
}
}
if v.AssetModelHierarchies != nil {
if err := validateAssetModelHierarchyDefinitions(v.AssetModelHierarchies); err != nil {
invalidParams.AddNested("AssetModelHierarchies", err.(smithy.InvalidParamsError))
}
}
if v.AssetModelCompositeModels != nil {
if err := validateAssetModelCompositeModelDefinitions(v.AssetModelCompositeModels); err != nil {
invalidParams.AddNested("AssetModelCompositeModels", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateBulkImportJobInput(v *CreateBulkImportJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateBulkImportJobInput"}
if v.JobName == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobName"))
}
if v.JobRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobRoleArn"))
}
if v.Files == nil {
invalidParams.Add(smithy.NewErrParamRequired("Files"))
} else if v.Files != nil {
if err := validateFiles(v.Files); err != nil {
invalidParams.AddNested("Files", err.(smithy.InvalidParamsError))
}
}
if v.ErrorReportLocation == nil {
invalidParams.Add(smithy.NewErrParamRequired("ErrorReportLocation"))
} else if v.ErrorReportLocation != nil {
if err := validateErrorReportLocation(v.ErrorReportLocation); err != nil {
invalidParams.AddNested("ErrorReportLocation", err.(smithy.InvalidParamsError))
}
}
if v.JobConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobConfiguration"))
} else if v.JobConfiguration != nil {
if err := validateJobConfiguration(v.JobConfiguration); err != nil {
invalidParams.AddNested("JobConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDashboardInput(v *CreateDashboardInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDashboardInput"}
if v.ProjectId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectId"))
}
if v.DashboardName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DashboardName"))
}
if v.DashboardDefinition == nil {
invalidParams.Add(smithy.NewErrParamRequired("DashboardDefinition"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateGatewayInput(v *CreateGatewayInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateGatewayInput"}
if v.GatewayName == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayName"))
}
if v.GatewayPlatform == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayPlatform"))
} else if v.GatewayPlatform != nil {
if err := validateGatewayPlatform(v.GatewayPlatform); err != nil {
invalidParams.AddNested("GatewayPlatform", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreatePortalInput(v *CreatePortalInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreatePortalInput"}
if v.PortalName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortalName"))
}
if v.PortalContactEmail == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortalContactEmail"))
}
if v.PortalLogoImageFile != nil {
if err := validateImageFile(v.PortalLogoImageFile); err != nil {
invalidParams.AddNested("PortalLogoImageFile", err.(smithy.InvalidParamsError))
}
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.Alarms != nil {
if err := validateAlarms(v.Alarms); err != nil {
invalidParams.AddNested("Alarms", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateProjectInput(v *CreateProjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateProjectInput"}
if v.PortalId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortalId"))
}
if v.ProjectName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAccessPolicyInput(v *DeleteAccessPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessPolicyInput"}
if v.AccessPolicyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccessPolicyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAssetInput(v *DeleteAssetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAssetInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAssetModelInput(v *DeleteAssetModelInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAssetModelInput"}
if v.AssetModelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetModelId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDashboardInput(v *DeleteDashboardInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDashboardInput"}
if v.DashboardId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DashboardId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteGatewayInput(v *DeleteGatewayInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteGatewayInput"}
if v.GatewayId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeletePortalInput(v *DeletePortalInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeletePortalInput"}
if v.PortalId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortalId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteProjectInput(v *DeleteProjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteProjectInput"}
if v.ProjectId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAccessPolicyInput(v *DescribeAccessPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAccessPolicyInput"}
if v.AccessPolicyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccessPolicyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAssetInput(v *DescribeAssetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAssetInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAssetModelInput(v *DescribeAssetModelInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAssetModelInput"}
if v.AssetModelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetModelId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAssetPropertyInput(v *DescribeAssetPropertyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAssetPropertyInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if v.PropertyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PropertyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeBulkImportJobInput(v *DescribeBulkImportJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeBulkImportJobInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeDashboardInput(v *DescribeDashboardInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeDashboardInput"}
if v.DashboardId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DashboardId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeGatewayCapabilityConfigurationInput(v *DescribeGatewayCapabilityConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeGatewayCapabilityConfigurationInput"}
if v.GatewayId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayId"))
}
if v.CapabilityNamespace == nil {
invalidParams.Add(smithy.NewErrParamRequired("CapabilityNamespace"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeGatewayInput(v *DescribeGatewayInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeGatewayInput"}
if v.GatewayId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribePortalInput(v *DescribePortalInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribePortalInput"}
if v.PortalId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortalId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeProjectInput(v *DescribeProjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeProjectInput"}
if v.ProjectId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateAssetsInput(v *DisassociateAssetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateAssetsInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if v.HierarchyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("HierarchyId"))
}
if v.ChildAssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChildAssetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeSeriesFromAssetPropertyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateTimeSeriesFromAssetPropertyInput"}
if v.Alias == nil {
invalidParams.Add(smithy.NewErrParamRequired("Alias"))
}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if v.PropertyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PropertyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAssetPropertyAggregatesInput(v *GetAssetPropertyAggregatesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAssetPropertyAggregatesInput"}
if v.AggregateTypes == nil {
invalidParams.Add(smithy.NewErrParamRequired("AggregateTypes"))
}
if v.Resolution == nil {
invalidParams.Add(smithy.NewErrParamRequired("Resolution"))
}
if v.StartDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartDate"))
}
if v.EndDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndDate"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetInterpolatedAssetPropertyValuesInput(v *GetInterpolatedAssetPropertyValuesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetInterpolatedAssetPropertyValuesInput"}
if v.StartTimeInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartTimeInSeconds"))
}
if v.EndTimeInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndTimeInSeconds"))
}
if len(v.Quality) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Quality"))
}
if v.IntervalInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntervalInSeconds"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAssetModelPropertiesInput(v *ListAssetModelPropertiesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAssetModelPropertiesInput"}
if v.AssetModelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetModelId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAssetPropertiesInput(v *ListAssetPropertiesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAssetPropertiesInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAssetRelationshipsInput(v *ListAssetRelationshipsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAssetRelationshipsInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if len(v.TraversalType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TraversalType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAssociatedAssetsInput(v *ListAssociatedAssetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAssociatedAssetsInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListDashboardsInput(v *ListDashboardsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListDashboardsInput"}
if v.ProjectId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListProjectAssetsInput(v *ListProjectAssetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListProjectAssetsInput"}
if v.ProjectId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListProjectsInput(v *ListProjectsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListProjectsInput"}
if v.PortalId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortalId"))
}
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 validateOpPutDefaultEncryptionConfigurationInput(v *PutDefaultEncryptionConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutDefaultEncryptionConfigurationInput"}
if len(v.EncryptionType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("EncryptionType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutLoggingOptionsInput(v *PutLoggingOptionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutLoggingOptionsInput"}
if v.LoggingOptions == nil {
invalidParams.Add(smithy.NewErrParamRequired("LoggingOptions"))
} else if v.LoggingOptions != nil {
if err := validateLoggingOptions(v.LoggingOptions); err != nil {
invalidParams.AddNested("LoggingOptions", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutStorageConfigurationInput(v *PutStorageConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutStorageConfigurationInput"}
if len(v.StorageType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("StorageType"))
}
if v.MultiLayerStorage != nil {
if err := validateMultiLayerStorage(v.MultiLayerStorage); err != nil {
invalidParams.AddNested("MultiLayerStorage", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
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 validateOpUpdateAccessPolicyInput(v *UpdateAccessPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAccessPolicyInput"}
if v.AccessPolicyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccessPolicyId"))
}
if v.AccessPolicyIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccessPolicyIdentity"))
} else if v.AccessPolicyIdentity != nil {
if err := validateIdentity(v.AccessPolicyIdentity); err != nil {
invalidParams.AddNested("AccessPolicyIdentity", err.(smithy.InvalidParamsError))
}
}
if v.AccessPolicyResource == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccessPolicyResource"))
} else if v.AccessPolicyResource != nil {
if err := validateResource(v.AccessPolicyResource); err != nil {
invalidParams.AddNested("AccessPolicyResource", err.(smithy.InvalidParamsError))
}
}
if len(v.AccessPolicyPermission) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("AccessPolicyPermission"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateAssetInput(v *UpdateAssetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAssetInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if v.AssetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateAssetModelInput(v *UpdateAssetModelInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAssetModelInput"}
if v.AssetModelId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetModelId"))
}
if v.AssetModelName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetModelName"))
}
if v.AssetModelProperties != nil {
if err := validateAssetModelProperties(v.AssetModelProperties); err != nil {
invalidParams.AddNested("AssetModelProperties", err.(smithy.InvalidParamsError))
}
}
if v.AssetModelHierarchies != nil {
if err := validateAssetModelHierarchies(v.AssetModelHierarchies); err != nil {
invalidParams.AddNested("AssetModelHierarchies", err.(smithy.InvalidParamsError))
}
}
if v.AssetModelCompositeModels != nil {
if err := validateAssetModelCompositeModels(v.AssetModelCompositeModels); err != nil {
invalidParams.AddNested("AssetModelCompositeModels", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateAssetPropertyInput(v *UpdateAssetPropertyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAssetPropertyInput"}
if v.AssetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AssetId"))
}
if v.PropertyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PropertyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateDashboardInput(v *UpdateDashboardInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateDashboardInput"}
if v.DashboardId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DashboardId"))
}
if v.DashboardName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DashboardName"))
}
if v.DashboardDefinition == nil {
invalidParams.Add(smithy.NewErrParamRequired("DashboardDefinition"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateGatewayCapabilityConfigurationInput(v *UpdateGatewayCapabilityConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateGatewayCapabilityConfigurationInput"}
if v.GatewayId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayId"))
}
if v.CapabilityNamespace == nil {
invalidParams.Add(smithy.NewErrParamRequired("CapabilityNamespace"))
}
if v.CapabilityConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("CapabilityConfiguration"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateGatewayInput(v *UpdateGatewayInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateGatewayInput"}
if v.GatewayId == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayId"))
}
if v.GatewayName == nil {
invalidParams.Add(smithy.NewErrParamRequired("GatewayName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdatePortalInput(v *UpdatePortalInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdatePortalInput"}
if v.PortalId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortalId"))
}
if v.PortalName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortalName"))
}
if v.PortalContactEmail == nil {
invalidParams.Add(smithy.NewErrParamRequired("PortalContactEmail"))
}
if v.PortalLogoImage != nil {
if err := validateImage(v.PortalLogoImage); err != nil {
invalidParams.AddNested("PortalLogoImage", err.(smithy.InvalidParamsError))
}
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.Alarms != nil {
if err := validateAlarms(v.Alarms); err != nil {
invalidParams.AddNested("Alarms", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateProjectInput(v *UpdateProjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateProjectInput"}
if v.ProjectId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectId"))
}
if v.ProjectName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProjectName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 3,631 |
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 IoTSiteWise 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: "iotsitewise.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotsitewise-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "iotsitewise-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotsitewise.{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: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotsitewise-fips.ca-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "fips-ca-central-1",
}: endpoints.Endpoint{
Hostname: "iotsitewise-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "iotsitewise-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-2",
}: endpoints.Endpoint{
Hostname: "iotsitewise-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "iotsitewise-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotsitewise-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotsitewise-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotsitewise-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "iotsitewise.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotsitewise-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "iotsitewise-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotsitewise.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotsitewise-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotsitewise.{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: "iotsitewise-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotsitewise.{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: "iotsitewise-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotsitewise.{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: "iotsitewise-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotsitewise.{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: "iotsitewise.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotsitewise-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "iotsitewise-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotsitewise.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "iotsitewise-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotsitewise-fips.us-gov-west-1.amazonaws.com",
},
},
},
}
| 417 |
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 AggregateType string
// Enum values for AggregateType
const (
AggregateTypeAverage AggregateType = "AVERAGE"
AggregateTypeCount AggregateType = "COUNT"
AggregateTypeMaximum AggregateType = "MAXIMUM"
AggregateTypeMinimum AggregateType = "MINIMUM"
AggregateTypeSum AggregateType = "SUM"
AggregateTypeStandardDeviation AggregateType = "STANDARD_DEVIATION"
)
// Values returns all known values for AggregateType. 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 (AggregateType) Values() []AggregateType {
return []AggregateType{
"AVERAGE",
"COUNT",
"MAXIMUM",
"MINIMUM",
"SUM",
"STANDARD_DEVIATION",
}
}
type AssetErrorCode string
// Enum values for AssetErrorCode
const (
AssetErrorCodeInternalFailure AssetErrorCode = "INTERNAL_FAILURE"
)
// Values returns all known values for AssetErrorCode. 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 (AssetErrorCode) Values() []AssetErrorCode {
return []AssetErrorCode{
"INTERNAL_FAILURE",
}
}
type AssetModelState string
// Enum values for AssetModelState
const (
AssetModelStateCreating AssetModelState = "CREATING"
AssetModelStateActive AssetModelState = "ACTIVE"
AssetModelStateUpdating AssetModelState = "UPDATING"
AssetModelStatePropagating AssetModelState = "PROPAGATING"
AssetModelStateDeleting AssetModelState = "DELETING"
AssetModelStateFailed AssetModelState = "FAILED"
)
// Values returns all known values for AssetModelState. 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 (AssetModelState) Values() []AssetModelState {
return []AssetModelState{
"CREATING",
"ACTIVE",
"UPDATING",
"PROPAGATING",
"DELETING",
"FAILED",
}
}
type AssetRelationshipType string
// Enum values for AssetRelationshipType
const (
AssetRelationshipTypeHierarchy AssetRelationshipType = "HIERARCHY"
)
// Values returns all known values for AssetRelationshipType. 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 (AssetRelationshipType) Values() []AssetRelationshipType {
return []AssetRelationshipType{
"HIERARCHY",
}
}
type AssetState string
// Enum values for AssetState
const (
AssetStateCreating AssetState = "CREATING"
AssetStateActive AssetState = "ACTIVE"
AssetStateUpdating AssetState = "UPDATING"
AssetStateDeleting AssetState = "DELETING"
AssetStateFailed AssetState = "FAILED"
)
// Values returns all known values for AssetState. 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 (AssetState) Values() []AssetState {
return []AssetState{
"CREATING",
"ACTIVE",
"UPDATING",
"DELETING",
"FAILED",
}
}
type AuthMode string
// Enum values for AuthMode
const (
AuthModeIam AuthMode = "IAM"
AuthModeSso AuthMode = "SSO"
)
// Values returns all known values for AuthMode. 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 (AuthMode) Values() []AuthMode {
return []AuthMode{
"IAM",
"SSO",
}
}
type BatchEntryCompletionStatus string
// Enum values for BatchEntryCompletionStatus
const (
BatchEntryCompletionStatusSuccess BatchEntryCompletionStatus = "SUCCESS"
BatchEntryCompletionStatusError BatchEntryCompletionStatus = "ERROR"
)
// Values returns all known values for BatchEntryCompletionStatus. 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 (BatchEntryCompletionStatus) Values() []BatchEntryCompletionStatus {
return []BatchEntryCompletionStatus{
"SUCCESS",
"ERROR",
}
}
type BatchGetAssetPropertyAggregatesErrorCode string
// Enum values for BatchGetAssetPropertyAggregatesErrorCode
const (
BatchGetAssetPropertyAggregatesErrorCodeResourceNotFoundException BatchGetAssetPropertyAggregatesErrorCode = "ResourceNotFoundException"
BatchGetAssetPropertyAggregatesErrorCodeInvalidRequestException BatchGetAssetPropertyAggregatesErrorCode = "InvalidRequestException"
BatchGetAssetPropertyAggregatesErrorCodeAccessDeniedException BatchGetAssetPropertyAggregatesErrorCode = "AccessDeniedException"
)
// Values returns all known values for BatchGetAssetPropertyAggregatesErrorCode.
// 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 (BatchGetAssetPropertyAggregatesErrorCode) Values() []BatchGetAssetPropertyAggregatesErrorCode {
return []BatchGetAssetPropertyAggregatesErrorCode{
"ResourceNotFoundException",
"InvalidRequestException",
"AccessDeniedException",
}
}
type BatchGetAssetPropertyValueErrorCode string
// Enum values for BatchGetAssetPropertyValueErrorCode
const (
BatchGetAssetPropertyValueErrorCodeResourceNotFoundException BatchGetAssetPropertyValueErrorCode = "ResourceNotFoundException"
BatchGetAssetPropertyValueErrorCodeInvalidRequestException BatchGetAssetPropertyValueErrorCode = "InvalidRequestException"
BatchGetAssetPropertyValueErrorCodeAccessDeniedException BatchGetAssetPropertyValueErrorCode = "AccessDeniedException"
)
// Values returns all known values for BatchGetAssetPropertyValueErrorCode. 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 (BatchGetAssetPropertyValueErrorCode) Values() []BatchGetAssetPropertyValueErrorCode {
return []BatchGetAssetPropertyValueErrorCode{
"ResourceNotFoundException",
"InvalidRequestException",
"AccessDeniedException",
}
}
type BatchGetAssetPropertyValueHistoryErrorCode string
// Enum values for BatchGetAssetPropertyValueHistoryErrorCode
const (
BatchGetAssetPropertyValueHistoryErrorCodeResourceNotFoundException BatchGetAssetPropertyValueHistoryErrorCode = "ResourceNotFoundException"
BatchGetAssetPropertyValueHistoryErrorCodeInvalidRequestException BatchGetAssetPropertyValueHistoryErrorCode = "InvalidRequestException"
BatchGetAssetPropertyValueHistoryErrorCodeAccessDeniedException BatchGetAssetPropertyValueHistoryErrorCode = "AccessDeniedException"
)
// Values returns all known values for BatchGetAssetPropertyValueHistoryErrorCode.
// 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 (BatchGetAssetPropertyValueHistoryErrorCode) Values() []BatchGetAssetPropertyValueHistoryErrorCode {
return []BatchGetAssetPropertyValueHistoryErrorCode{
"ResourceNotFoundException",
"InvalidRequestException",
"AccessDeniedException",
}
}
type BatchPutAssetPropertyValueErrorCode string
// Enum values for BatchPutAssetPropertyValueErrorCode
const (
BatchPutAssetPropertyValueErrorCodeResourceNotFoundException BatchPutAssetPropertyValueErrorCode = "ResourceNotFoundException"
BatchPutAssetPropertyValueErrorCodeInvalidRequestException BatchPutAssetPropertyValueErrorCode = "InvalidRequestException"
BatchPutAssetPropertyValueErrorCodeInternalFailureException BatchPutAssetPropertyValueErrorCode = "InternalFailureException"
BatchPutAssetPropertyValueErrorCodeServiceUnavailableException BatchPutAssetPropertyValueErrorCode = "ServiceUnavailableException"
BatchPutAssetPropertyValueErrorCodeThrottlingException BatchPutAssetPropertyValueErrorCode = "ThrottlingException"
BatchPutAssetPropertyValueErrorCodeLimitExceededException BatchPutAssetPropertyValueErrorCode = "LimitExceededException"
BatchPutAssetPropertyValueErrorCodeConflictingOperationException BatchPutAssetPropertyValueErrorCode = "ConflictingOperationException"
BatchPutAssetPropertyValueErrorCodeTimestampOutOfRangeException BatchPutAssetPropertyValueErrorCode = "TimestampOutOfRangeException"
BatchPutAssetPropertyValueErrorCodeAccessDeniedException BatchPutAssetPropertyValueErrorCode = "AccessDeniedException"
)
// Values returns all known values for BatchPutAssetPropertyValueErrorCode. 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 (BatchPutAssetPropertyValueErrorCode) Values() []BatchPutAssetPropertyValueErrorCode {
return []BatchPutAssetPropertyValueErrorCode{
"ResourceNotFoundException",
"InvalidRequestException",
"InternalFailureException",
"ServiceUnavailableException",
"ThrottlingException",
"LimitExceededException",
"ConflictingOperationException",
"TimestampOutOfRangeException",
"AccessDeniedException",
}
}
type CapabilitySyncStatus string
// Enum values for CapabilitySyncStatus
const (
CapabilitySyncStatusInSync CapabilitySyncStatus = "IN_SYNC"
CapabilitySyncStatusOutOfSync CapabilitySyncStatus = "OUT_OF_SYNC"
CapabilitySyncStatusSyncFailed CapabilitySyncStatus = "SYNC_FAILED"
CapabilitySyncStatusUnknown CapabilitySyncStatus = "UNKNOWN"
)
// Values returns all known values for CapabilitySyncStatus. 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 (CapabilitySyncStatus) Values() []CapabilitySyncStatus {
return []CapabilitySyncStatus{
"IN_SYNC",
"OUT_OF_SYNC",
"SYNC_FAILED",
"UNKNOWN",
}
}
type ColumnName string
// Enum values for ColumnName
const (
ColumnNameAlias ColumnName = "ALIAS"
ColumnNameAssetId ColumnName = "ASSET_ID"
ColumnNamePropertyId ColumnName = "PROPERTY_ID"
ColumnNameDataType ColumnName = "DATA_TYPE"
ColumnNameTimestampSeconds ColumnName = "TIMESTAMP_SECONDS"
ColumnNameTimestampNanoOffset ColumnName = "TIMESTAMP_NANO_OFFSET"
ColumnNameQuality ColumnName = "QUALITY"
ColumnNameValue ColumnName = "VALUE"
)
// Values returns all known values for ColumnName. 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 (ColumnName) Values() []ColumnName {
return []ColumnName{
"ALIAS",
"ASSET_ID",
"PROPERTY_ID",
"DATA_TYPE",
"TIMESTAMP_SECONDS",
"TIMESTAMP_NANO_OFFSET",
"QUALITY",
"VALUE",
}
}
type ComputeLocation string
// Enum values for ComputeLocation
const (
ComputeLocationEdge ComputeLocation = "EDGE"
ComputeLocationCloud ComputeLocation = "CLOUD"
)
// Values returns all known values for ComputeLocation. 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 (ComputeLocation) Values() []ComputeLocation {
return []ComputeLocation{
"EDGE",
"CLOUD",
}
}
type ConfigurationState string
// Enum values for ConfigurationState
const (
ConfigurationStateActive ConfigurationState = "ACTIVE"
ConfigurationStateUpdateInProgress ConfigurationState = "UPDATE_IN_PROGRESS"
ConfigurationStateUpdateFailed ConfigurationState = "UPDATE_FAILED"
)
// Values returns all known values for ConfigurationState. 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 (ConfigurationState) Values() []ConfigurationState {
return []ConfigurationState{
"ACTIVE",
"UPDATE_IN_PROGRESS",
"UPDATE_FAILED",
}
}
type DetailedErrorCode string
// Enum values for DetailedErrorCode
const (
DetailedErrorCodeIncompatibleComputeLocation DetailedErrorCode = "INCOMPATIBLE_COMPUTE_LOCATION"
DetailedErrorCodeIncompatibleForwardingConfiguration DetailedErrorCode = "INCOMPATIBLE_FORWARDING_CONFIGURATION"
)
// Values returns all known values for DetailedErrorCode. 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 (DetailedErrorCode) Values() []DetailedErrorCode {
return []DetailedErrorCode{
"INCOMPATIBLE_COMPUTE_LOCATION",
"INCOMPATIBLE_FORWARDING_CONFIGURATION",
}
}
type DisassociatedDataStorageState string
// Enum values for DisassociatedDataStorageState
const (
DisassociatedDataStorageStateEnabled DisassociatedDataStorageState = "ENABLED"
DisassociatedDataStorageStateDisabled DisassociatedDataStorageState = "DISABLED"
)
// Values returns all known values for DisassociatedDataStorageState. 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 (DisassociatedDataStorageState) Values() []DisassociatedDataStorageState {
return []DisassociatedDataStorageState{
"ENABLED",
"DISABLED",
}
}
type EncryptionType string
// Enum values for EncryptionType
const (
EncryptionTypeSitewiseDefaultEncryption EncryptionType = "SITEWISE_DEFAULT_ENCRYPTION"
EncryptionTypeKmsBasedEncryption EncryptionType = "KMS_BASED_ENCRYPTION"
)
// Values returns all known values for EncryptionType. 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 (EncryptionType) Values() []EncryptionType {
return []EncryptionType{
"SITEWISE_DEFAULT_ENCRYPTION",
"KMS_BASED_ENCRYPTION",
}
}
type ErrorCode string
// Enum values for ErrorCode
const (
ErrorCodeValidationError ErrorCode = "VALIDATION_ERROR"
ErrorCodeInternalFailure ErrorCode = "INTERNAL_FAILURE"
)
// Values returns all known values for ErrorCode. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (ErrorCode) Values() []ErrorCode {
return []ErrorCode{
"VALIDATION_ERROR",
"INTERNAL_FAILURE",
}
}
type ForwardingConfigState string
// Enum values for ForwardingConfigState
const (
ForwardingConfigStateDisabled ForwardingConfigState = "DISABLED"
ForwardingConfigStateEnabled ForwardingConfigState = "ENABLED"
)
// Values returns all known values for ForwardingConfigState. 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 (ForwardingConfigState) Values() []ForwardingConfigState {
return []ForwardingConfigState{
"DISABLED",
"ENABLED",
}
}
type IdentityType string
// Enum values for IdentityType
const (
IdentityTypeUser IdentityType = "USER"
IdentityTypeGroup IdentityType = "GROUP"
IdentityTypeIam IdentityType = "IAM"
)
// Values returns all known values for IdentityType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (IdentityType) Values() []IdentityType {
return []IdentityType{
"USER",
"GROUP",
"IAM",
}
}
type ImageFileType string
// Enum values for ImageFileType
const (
ImageFileTypePng ImageFileType = "PNG"
)
// Values returns all known values for ImageFileType. 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 (ImageFileType) Values() []ImageFileType {
return []ImageFileType{
"PNG",
}
}
type JobStatus string
// Enum values for JobStatus
const (
JobStatusPending JobStatus = "PENDING"
JobStatusCancelled JobStatus = "CANCELLED"
JobStatusRunning JobStatus = "RUNNING"
JobStatusCompleted JobStatus = "COMPLETED"
JobStatusFailed JobStatus = "FAILED"
JobStatusCompletedWithFailures JobStatus = "COMPLETED_WITH_FAILURES"
)
// Values returns all known values for JobStatus. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (JobStatus) Values() []JobStatus {
return []JobStatus{
"PENDING",
"CANCELLED",
"RUNNING",
"COMPLETED",
"FAILED",
"COMPLETED_WITH_FAILURES",
}
}
type ListAssetModelPropertiesFilter string
// Enum values for ListAssetModelPropertiesFilter
const (
ListAssetModelPropertiesFilterAll ListAssetModelPropertiesFilter = "ALL"
ListAssetModelPropertiesFilterBase ListAssetModelPropertiesFilter = "BASE"
)
// Values returns all known values for ListAssetModelPropertiesFilter. 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 (ListAssetModelPropertiesFilter) Values() []ListAssetModelPropertiesFilter {
return []ListAssetModelPropertiesFilter{
"ALL",
"BASE",
}
}
type ListAssetPropertiesFilter string
// Enum values for ListAssetPropertiesFilter
const (
ListAssetPropertiesFilterAll ListAssetPropertiesFilter = "ALL"
ListAssetPropertiesFilterBase ListAssetPropertiesFilter = "BASE"
)
// Values returns all known values for ListAssetPropertiesFilter. 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 (ListAssetPropertiesFilter) Values() []ListAssetPropertiesFilter {
return []ListAssetPropertiesFilter{
"ALL",
"BASE",
}
}
type ListAssetsFilter string
// Enum values for ListAssetsFilter
const (
ListAssetsFilterAll ListAssetsFilter = "ALL"
ListAssetsFilterTopLevel ListAssetsFilter = "TOP_LEVEL"
)
// Values returns all known values for ListAssetsFilter. 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 (ListAssetsFilter) Values() []ListAssetsFilter {
return []ListAssetsFilter{
"ALL",
"TOP_LEVEL",
}
}
type ListBulkImportJobsFilter string
// Enum values for ListBulkImportJobsFilter
const (
ListBulkImportJobsFilterAll ListBulkImportJobsFilter = "ALL"
ListBulkImportJobsFilterPending ListBulkImportJobsFilter = "PENDING"
ListBulkImportJobsFilterRunning ListBulkImportJobsFilter = "RUNNING"
ListBulkImportJobsFilterCancelled ListBulkImportJobsFilter = "CANCELLED"
ListBulkImportJobsFilterFailed ListBulkImportJobsFilter = "FAILED"
ListBulkImportJobsFilterCompletedWithFailures ListBulkImportJobsFilter = "COMPLETED_WITH_FAILURES"
ListBulkImportJobsFilterCompleted ListBulkImportJobsFilter = "COMPLETED"
)
// Values returns all known values for ListBulkImportJobsFilter. 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 (ListBulkImportJobsFilter) Values() []ListBulkImportJobsFilter {
return []ListBulkImportJobsFilter{
"ALL",
"PENDING",
"RUNNING",
"CANCELLED",
"FAILED",
"COMPLETED_WITH_FAILURES",
"COMPLETED",
}
}
type ListTimeSeriesType string
// Enum values for ListTimeSeriesType
const (
ListTimeSeriesTypeAssociated ListTimeSeriesType = "ASSOCIATED"
ListTimeSeriesTypeDisassociated ListTimeSeriesType = "DISASSOCIATED"
)
// Values returns all known values for ListTimeSeriesType. 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 (ListTimeSeriesType) Values() []ListTimeSeriesType {
return []ListTimeSeriesType{
"ASSOCIATED",
"DISASSOCIATED",
}
}
type LoggingLevel string
// Enum values for LoggingLevel
const (
LoggingLevelError LoggingLevel = "ERROR"
LoggingLevelInfo LoggingLevel = "INFO"
LoggingLevelOff LoggingLevel = "OFF"
)
// Values returns all known values for LoggingLevel. 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 (LoggingLevel) Values() []LoggingLevel {
return []LoggingLevel{
"ERROR",
"INFO",
"OFF",
}
}
type MonitorErrorCode string
// Enum values for MonitorErrorCode
const (
MonitorErrorCodeInternalFailure MonitorErrorCode = "INTERNAL_FAILURE"
MonitorErrorCodeValidationError MonitorErrorCode = "VALIDATION_ERROR"
MonitorErrorCodeLimitExceeded MonitorErrorCode = "LIMIT_EXCEEDED"
)
// Values returns all known values for MonitorErrorCode. 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 (MonitorErrorCode) Values() []MonitorErrorCode {
return []MonitorErrorCode{
"INTERNAL_FAILURE",
"VALIDATION_ERROR",
"LIMIT_EXCEEDED",
}
}
type Permission string
// Enum values for Permission
const (
PermissionAdministrator Permission = "ADMINISTRATOR"
PermissionViewer Permission = "VIEWER"
)
// Values returns all known values for Permission. 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 (Permission) Values() []Permission {
return []Permission{
"ADMINISTRATOR",
"VIEWER",
}
}
type PortalState string
// Enum values for PortalState
const (
PortalStateCreating PortalState = "CREATING"
PortalStateUpdating PortalState = "UPDATING"
PortalStateDeleting PortalState = "DELETING"
PortalStateActive PortalState = "ACTIVE"
PortalStateFailed PortalState = "FAILED"
)
// Values returns all known values for PortalState. 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 (PortalState) Values() []PortalState {
return []PortalState{
"CREATING",
"UPDATING",
"DELETING",
"ACTIVE",
"FAILED",
}
}
type PropertyDataType string
// Enum values for PropertyDataType
const (
PropertyDataTypeString PropertyDataType = "STRING"
PropertyDataTypeInteger PropertyDataType = "INTEGER"
PropertyDataTypeDouble PropertyDataType = "DOUBLE"
PropertyDataTypeBoolean PropertyDataType = "BOOLEAN"
PropertyDataTypeStruct PropertyDataType = "STRUCT"
)
// Values returns all known values for PropertyDataType. 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 (PropertyDataType) Values() []PropertyDataType {
return []PropertyDataType{
"STRING",
"INTEGER",
"DOUBLE",
"BOOLEAN",
"STRUCT",
}
}
type PropertyNotificationState string
// Enum values for PropertyNotificationState
const (
PropertyNotificationStateEnabled PropertyNotificationState = "ENABLED"
PropertyNotificationStateDisabled PropertyNotificationState = "DISABLED"
)
// Values returns all known values for PropertyNotificationState. 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 (PropertyNotificationState) Values() []PropertyNotificationState {
return []PropertyNotificationState{
"ENABLED",
"DISABLED",
}
}
type Quality string
// Enum values for Quality
const (
QualityGood Quality = "GOOD"
QualityBad Quality = "BAD"
QualityUncertain Quality = "UNCERTAIN"
)
// Values returns all known values for Quality. 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 (Quality) Values() []Quality {
return []Quality{
"GOOD",
"BAD",
"UNCERTAIN",
}
}
type ResourceType string
// Enum values for ResourceType
const (
ResourceTypePortal ResourceType = "PORTAL"
ResourceTypeProject ResourceType = "PROJECT"
)
// 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{
"PORTAL",
"PROJECT",
}
}
type StorageType string
// Enum values for StorageType
const (
StorageTypeSitewiseDefaultStorage StorageType = "SITEWISE_DEFAULT_STORAGE"
StorageTypeMultiLayerStorage StorageType = "MULTI_LAYER_STORAGE"
)
// Values returns all known values for StorageType. 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 (StorageType) Values() []StorageType {
return []StorageType{
"SITEWISE_DEFAULT_STORAGE",
"MULTI_LAYER_STORAGE",
}
}
type TimeOrdering string
// Enum values for TimeOrdering
const (
TimeOrderingAscending TimeOrdering = "ASCENDING"
TimeOrderingDescending TimeOrdering = "DESCENDING"
)
// Values returns all known values for TimeOrdering. 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 (TimeOrdering) Values() []TimeOrdering {
return []TimeOrdering{
"ASCENDING",
"DESCENDING",
}
}
type TraversalDirection string
// Enum values for TraversalDirection
const (
TraversalDirectionParent TraversalDirection = "PARENT"
TraversalDirectionChild TraversalDirection = "CHILD"
)
// Values returns all known values for TraversalDirection. 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 (TraversalDirection) Values() []TraversalDirection {
return []TraversalDirection{
"PARENT",
"CHILD",
}
}
type TraversalType string
// Enum values for TraversalType
const (
TraversalTypePathToRoot TraversalType = "PATH_TO_ROOT"
)
// Values returns all known values for TraversalType. 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 (TraversalType) Values() []TraversalType {
return []TraversalType{
"PATH_TO_ROOT",
}
}
| 820 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// Your request has conflicting operations. This can occur if you're trying to
// perform more than one operation on the same resource at the same time.
type ConflictingOperationException struct {
Message *string
ErrorCodeOverride *string
ResourceId *string
ResourceArn *string
noSmithyDocumentSerde
}
func (e *ConflictingOperationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictingOperationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictingOperationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictingOperationException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictingOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// IoT SiteWise can't process your request right now. Try again later.
type InternalFailureException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalFailureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalFailureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalFailureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalFailureException"
}
return *e.ErrorCodeOverride
}
func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The request isn't valid. This can occur if your request contains malformed JSON
// or unsupported characters. Check your request and try again.
type InvalidRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidRequestException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You've reached the limit for a resource. For example, this can occur if you're
// trying to associate more than the allowed number of child assets or attempting
// to create more than the allowed number of properties for an asset model. For
// more information, see Quotas (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html)
// in the IoT SiteWise User Guide.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *LimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource already exists.
type ResourceAlreadyExistsException struct {
Message *string
ErrorCodeOverride *string
ResourceId *string
ResourceArn *string
noSmithyDocumentSerde
}
func (e *ResourceAlreadyExistsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceAlreadyExistsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceAlreadyExistsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceAlreadyExistsException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The requested resource can't be found.
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 requested service is unavailable.
type ServiceUnavailableException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServiceUnavailableException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceUnavailableException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceUnavailableException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceUnavailableException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Your request exceeded a rate limit. For example, you might have exceeded the
// number of IoT SiteWise assets that can be created per second, the allowed number
// of messages per second, and so on. For more information, see Quotas (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html)
// in the IoT SiteWise User Guide.
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 }
// You've reached the limit for the number of tags allowed for a resource. For
// more information, see Tag naming limits and requirements (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html#tag-conventions)
// in the Amazon Web Services General Reference.
type TooManyTagsException struct {
Message *string
ErrorCodeOverride *string
ResourceName *string
noSmithyDocumentSerde
}
func (e *TooManyTagsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TooManyTagsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TooManyTagsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TooManyTagsException"
}
return *e.ErrorCodeOverride
}
func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You are not authorized.
type UnauthorizedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *UnauthorizedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnauthorizedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnauthorizedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnauthorizedException"
}
return *e.ErrorCodeOverride
}
func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 288 |
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"
)
// Contains an access policy that defines an identity's access to an IoT SiteWise
// Monitor resource.
type AccessPolicySummary struct {
// The ID of the access policy.
//
// This member is required.
Id *string
// The identity (an IAM Identity Center user, an IAM Identity Center group, or an
// IAM user).
//
// This member is required.
Identity *Identity
// The permissions for the access policy. Note that a project ADMINISTRATOR is
// also known as a project owner.
//
// This member is required.
Permission Permission
// The IoT SiteWise Monitor resource (a portal or project).
//
// This member is required.
Resource *Resource
// The date the access policy was created, in Unix epoch time.
CreationDate *time.Time
// The date the access policy was last updated, in Unix epoch time.
LastUpdateDate *time.Time
noSmithyDocumentSerde
}
// Contains aggregated asset property values (for example, average, minimum, and
// maximum).
type AggregatedValue struct {
// The date the aggregating computations occurred, in Unix epoch time.
//
// This member is required.
Timestamp *time.Time
// The value of the aggregates.
//
// This member is required.
Value *Aggregates
// The quality of the aggregated data.
Quality Quality
noSmithyDocumentSerde
}
// Contains the (pre-calculated) aggregate values for an asset property.
type Aggregates struct {
// The average (mean) value of the time series over a time interval window.
Average *float64
// The count of data points in the time series over a time interval window.
Count *float64
// The maximum value of the time series over a time interval window.
Maximum *float64
// The minimum value of the time series over a time interval window.
Minimum *float64
// The standard deviation of the time series over a time interval window.
StandardDeviation *float64
// The sum of the time series over a time interval window.
Sum *float64
noSmithyDocumentSerde
}
// Contains the configuration information of an alarm created in an IoT SiteWise
// Monitor portal. You can use the alarm to monitor an asset property and get
// notified when the asset property value is outside a specified range. For more
// information, see Monitoring with alarms (https://docs.aws.amazon.com/iot-sitewise/latest/appguide/monitor-alarms.html)
// in the IoT SiteWise Application Guide.
type Alarms struct {
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the IAM role that allows the alarm to perform actions and access Amazon Web
// Services resources and services, such as IoT Events.
//
// This member is required.
AlarmRoleArn *string
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the Lambda function that manages alarm notifications. For more information,
// see Managing alarm notifications (https://docs.aws.amazon.com/iotevents/latest/developerguide/lambda-support.html)
// in the IoT Events Developer Guide.
NotificationLambdaArn *string
noSmithyDocumentSerde
}
// Contains information about a composite model in an asset. This object contains
// the asset's properties that you define in the composite model.
type AssetCompositeModel struct {
// The name of the composite model.
//
// This member is required.
Name *string
// The asset properties that this composite model defines.
//
// This member is required.
Properties []AssetProperty
// The type of the composite model. For alarm composite models, this type is
// AWS/ALARM .
//
// This member is required.
Type *string
// The description of the composite model.
Description *string
// The ID of the asset composite model.
Id *string
noSmithyDocumentSerde
}
// Contains error details for the requested associate project asset action.
type AssetErrorDetails struct {
// The ID of the asset.
//
// This member is required.
AssetId *string
// The error code.
//
// This member is required.
Code AssetErrorCode
// The error message.
//
// This member is required.
Message *string
noSmithyDocumentSerde
}
// Describes an asset hierarchy that contains a hierarchy's name and ID.
type AssetHierarchy struct {
// The hierarchy name provided in the CreateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModel.html)
// or UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html)
// API operation.
//
// This member is required.
Name *string
// The ID of the hierarchy. This ID is a hierarchyId .
Id *string
noSmithyDocumentSerde
}
// Contains information about a parent asset and a child asset that are related
// through an asset hierarchy.
type AssetHierarchyInfo struct {
// The ID of the child asset in this asset relationship.
ChildAssetId *string
// The ID of the parent asset in this asset relationship.
ParentAssetId *string
noSmithyDocumentSerde
}
// Contains information about a composite model in an asset model. This object
// contains the asset property definitions that you define in the composite model.
type AssetModelCompositeModel struct {
// The name of the composite model.
//
// This member is required.
Name *string
// The type of the composite model. For alarm composite models, this type is
// AWS/ALARM .
//
// This member is required.
Type *string
// The description of the composite model.
Description *string
// The ID of the asset model composite model.
Id *string
// The asset property definitions for this composite model.
Properties []AssetModelProperty
noSmithyDocumentSerde
}
// Contains a composite model definition in an asset model. This composite model
// definition is applied to all assets created from the asset model.
type AssetModelCompositeModelDefinition struct {
// The name of the composite model.
//
// This member is required.
Name *string
// The type of the composite model. For alarm composite models, this type is
// AWS/ALARM .
//
// This member is required.
Type *string
// The description of the composite model.
Description *string
// The asset property definitions for this composite model.
Properties []AssetModelPropertyDefinition
noSmithyDocumentSerde
}
// Describes an asset hierarchy that contains a hierarchy's name, ID, and child
// asset model ID that specifies the type of asset that can be in this hierarchy.
type AssetModelHierarchy struct {
// The ID of the asset model. All assets in this hierarchy must be instances of
// the childAssetModelId asset model.
//
// This member is required.
ChildAssetModelId *string
// The name of the asset model hierarchy that you specify by using the
// CreateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModel.html)
// or UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html)
// API operation.
//
// This member is required.
Name *string
// The ID of the asset model hierarchy. This ID is a hierarchyId .
Id *string
noSmithyDocumentSerde
}
// Contains an asset model hierarchy used in asset model creation. An asset model
// hierarchy determines the kind (or type) of asset that can belong to a hierarchy.
type AssetModelHierarchyDefinition struct {
// The ID of an asset model for this hierarchy.
//
// This member is required.
ChildAssetModelId *string
// The name of the asset model hierarchy definition (as specified in the
// CreateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModel.html)
// or UpdateAssetModel (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetModel.html)
// API operation).
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// Contains information about an asset model property.
type AssetModelProperty struct {
// The data type of the asset model property.
//
// This member is required.
DataType PropertyDataType
// The name of the asset model property.
//
// This member is required.
Name *string
// The property type (see PropertyType ).
//
// This member is required.
Type *PropertyType
// The data type of the structure for this property. This parameter exists on
// properties that have the STRUCT data type.
DataTypeSpec *string
// The ID of the asset model property.
Id *string
// The unit of the asset model property, such as Newtons or RPM .
Unit *string
noSmithyDocumentSerde
}
// Contains an asset model property definition. This property definition is
// applied to all assets created from the asset model.
type AssetModelPropertyDefinition struct {
// The data type of the property definition. If you specify STRUCT , you must also
// specify dataTypeSpec to identify the type of the structure for this property.
//
// This member is required.
DataType PropertyDataType
// The name of the property definition.
//
// This member is required.
Name *string
// The property definition type (see PropertyType ). You can only specify one type
// in a property definition.
//
// This member is required.
Type *PropertyType
// The data type of the structure for this property. This parameter is required on
// properties that have the STRUCT data type. The options for this parameter
// depend on the type of the composite model in which you define this property. Use
// AWS/ALARM_STATE for alarm state in alarm composite models.
DataTypeSpec *string
// The unit of the property definition, such as Newtons or RPM .
Unit *string
noSmithyDocumentSerde
}
// Contains a summary of a property associated with a model.
type AssetModelPropertySummary struct {
// The data type of the property.
//
// This member is required.
DataType PropertyDataType
// The name of the property.
//
// This member is required.
Name *string
// Contains a property type, which can be one of attribute , measurement , metric ,
// or transform .
//
// This member is required.
Type *PropertyType
// The ID of the composite model that contains the asset model property.
AssetModelCompositeModelId *string
// The data type of the structure for this property. This parameter exists on
// properties that have the STRUCT data type.
DataTypeSpec *string
// The ID of the property.
Id *string
// The unit (such as Newtons or RPM ) of the property.
Unit *string
noSmithyDocumentSerde
}
// Contains current status information for an asset model. For more information,
// see Asset and model states (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html)
// in the IoT SiteWise User Guide.
type AssetModelStatus struct {
// The current state of the asset model.
//
// This member is required.
State AssetModelState
// Contains associated error information, if any.
Error *ErrorDetails
noSmithyDocumentSerde
}
// Contains a summary of an asset model.
type AssetModelSummary struct {
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the asset model, which has the following format.
// arn:${Partition}:iotsitewise:${Region}:${Account}:asset-model/${AssetModelId}
//
// This member is required.
Arn *string
// The date the asset model was created, in Unix epoch time.
//
// This member is required.
CreationDate *time.Time
// The asset model description.
//
// This member is required.
Description *string
// The ID of the asset model (used with IoT SiteWise APIs).
//
// This member is required.
Id *string
// The date the asset model was last updated, in Unix epoch time.
//
// This member is required.
LastUpdateDate *time.Time
// The name of the asset model.
//
// This member is required.
Name *string
// The current status of the asset model.
//
// This member is required.
Status *AssetModelStatus
noSmithyDocumentSerde
}
// Contains asset property information.
type AssetProperty struct {
// The data type of the asset property.
//
// This member is required.
DataType PropertyDataType
// The ID of the asset property.
//
// This member is required.
Id *string
// The name of the property.
//
// This member is required.
Name *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
Alias *string
// The data type of the structure for this property. This parameter exists on
// properties that have the STRUCT data type.
DataTypeSpec *string
// The asset property's notification topic and state. For more information, see
// UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html)
// .
Notification *PropertyNotification
// The unit (such as Newtons or RPM ) of the asset property.
Unit *string
noSmithyDocumentSerde
}
// Contains a summary of a property associated with an asset.
type AssetPropertySummary struct {
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
Alias *string
// The ID of the composite model that contains the asset property.
AssetCompositeModelId *string
// The ID of the property.
Id *string
// Contains asset property value notification information. When the notification
// state is enabled, IoT SiteWise publishes property value updates to a unique MQTT
// topic. For more information, see Interacting with other services (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/interact-with-other-services.html)
// in the IoT SiteWise User Guide.
Notification *PropertyNotification
// The unit of measure (such as Newtons or RPM) of the asset property.
Unit *string
noSmithyDocumentSerde
}
// Contains asset property value information.
type AssetPropertyValue struct {
// The timestamp of the asset property value.
//
// This member is required.
Timestamp *TimeInNanos
// The value of the asset property (see Variant ).
//
// This member is required.
Value *Variant
// The quality of the asset property value.
Quality Quality
noSmithyDocumentSerde
}
// Contains information about assets that are related to one another.
type AssetRelationshipSummary struct {
// The relationship type of the assets in this relationship. This value is one of
// the following:
// - HIERARCHY – The assets are related through an asset hierarchy. If you
// specify this relationship type, this asset relationship includes the
// hierarchyInfo object.
//
// This member is required.
RelationshipType AssetRelationshipType
// The assets that are related through an asset hierarchy. This object is present
// if the relationshipType is HIERARCHY .
HierarchyInfo *AssetHierarchyInfo
noSmithyDocumentSerde
}
// Contains information about the current status of an asset. For more
// information, see Asset and model states (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html)
// in the IoT SiteWise User Guide.
type AssetStatus struct {
// The current status of the asset.
//
// This member is required.
State AssetState
// Contains associated error information, if any.
Error *ErrorDetails
noSmithyDocumentSerde
}
// Contains a summary of an asset.
type AssetSummary struct {
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the asset, which has the following format.
// arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}
//
// This member is required.
Arn *string
// The ID of the asset model used to create this asset.
//
// This member is required.
AssetModelId *string
// The date the asset was created, in Unix epoch time.
//
// This member is required.
CreationDate *time.Time
// A list of asset hierarchies that each contain a hierarchyId . A hierarchy
// specifies allowed parent/child asset relationships.
//
// This member is required.
Hierarchies []AssetHierarchy
// The ID of the asset.
//
// This member is required.
Id *string
// The date the asset was last updated, in Unix epoch time.
//
// This member is required.
LastUpdateDate *time.Time
// The name of the asset.
//
// This member is required.
Name *string
// The current status of the asset.
//
// This member is required.
Status *AssetStatus
// A description for the asset.
Description *string
noSmithyDocumentSerde
}
// Contains a summary of an associated asset.
type AssociatedAssetsSummary struct {
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the asset, which has the following format.
// arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}
//
// This member is required.
Arn *string
// The ID of the asset model used to create the asset.
//
// This member is required.
AssetModelId *string
// The date the asset was created, in Unix epoch time.
//
// This member is required.
CreationDate *time.Time
// A list of asset hierarchies that each contain a hierarchyId . A hierarchy
// specifies allowed parent/child asset relationships.
//
// This member is required.
Hierarchies []AssetHierarchy
// The ID of the asset.
//
// This member is required.
Id *string
// The date the asset was last updated, in Unix epoch time.
//
// This member is required.
LastUpdateDate *time.Time
// The name of the asset.
//
// This member is required.
Name *string
// The current status of the asset.
//
// This member is required.
Status *AssetStatus
// A description for the asset.
Description *string
noSmithyDocumentSerde
}
// Contains an asset attribute property. For more information, see Attributes (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-properties.html#attributes)
// in the IoT SiteWise User Guide.
type Attribute struct {
// The default value of the asset model property attribute. All assets that you
// create from the asset model contain this attribute value. You can update an
// attribute's value after you create an asset. For more information, see Updating
// attribute values (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/update-attribute-values.html)
// in the IoT SiteWise User Guide.
DefaultValue *string
noSmithyDocumentSerde
}
// Contains information for an asset property aggregate entry that is associated
// with the BatchGetAssetPropertyAggregates (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyAggregates.html)
// API. To identify an asset property, you must specify one of the following:
// - The assetId and propertyId of an asset property.
// - A propertyAlias , which is a data stream alias (for example,
// /company/windfarm/3/turbine/7/temperature ). To define an asset property's
// alias, see UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html)
// .
type BatchGetAssetPropertyAggregatesEntry struct {
// The data aggregating function.
//
// This member is required.
AggregateTypes []AggregateType
// The inclusive end of the range from which to query historical data, expressed
// in seconds in Unix epoch time.
//
// This member is required.
EndDate *time.Time
// The ID of the entry.
//
// This member is required.
EntryId *string
// The time interval over which to aggregate data.
//
// This member is required.
Resolution *string
// The exclusive start of the range from which to query historical data, expressed
// in seconds in Unix epoch time.
//
// This member is required.
StartDate *time.Time
// The ID of the asset in which the asset property was created.
AssetId *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
PropertyAlias *string
// The ID of the asset property.
PropertyId *string
// The quality by which to filter asset data.
Qualities []Quality
// The chronological sorting order of the requested information. Default: ASCENDING
TimeOrdering TimeOrdering
noSmithyDocumentSerde
}
// Contains error information for an asset property aggregate entry that is
// associated with the BatchGetAssetPropertyAggregates (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyAggregates.html)
// API.
type BatchGetAssetPropertyAggregatesErrorEntry struct {
// The ID of the entry.
//
// This member is required.
EntryId *string
// The error code.
//
// This member is required.
ErrorCode BatchGetAssetPropertyAggregatesErrorCode
// The associated error message.
//
// This member is required.
ErrorMessage *string
noSmithyDocumentSerde
}
// Contains the error code and the timestamp for an asset property aggregate entry
// that is associated with the BatchGetAssetPropertyAggregates (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyAggregates.html)
// API.
type BatchGetAssetPropertyAggregatesErrorInfo struct {
// The error code.
//
// This member is required.
ErrorCode BatchGetAssetPropertyAggregatesErrorCode
// The date the error occurred, in Unix epoch time.
//
// This member is required.
ErrorTimestamp *time.Time
noSmithyDocumentSerde
}
// Contains information for an entry that has been processed by the previous
// BatchGetAssetPropertyAggregates (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyAggregates.html)
// request.
type BatchGetAssetPropertyAggregatesSkippedEntry struct {
// The completion status of each entry that is associated with the
// BatchGetAssetPropertyAggregates (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyAggregates.html)
// API.
//
// This member is required.
CompletionStatus BatchEntryCompletionStatus
// The ID of the entry.
//
// This member is required.
EntryId *string
// The error information, such as the error code and the timestamp.
ErrorInfo *BatchGetAssetPropertyAggregatesErrorInfo
noSmithyDocumentSerde
}
// Contains success information for an entry that is associated with the
// BatchGetAssetPropertyAggregates (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyAggregates.html)
// API.
type BatchGetAssetPropertyAggregatesSuccessEntry struct {
// The requested aggregated asset property values (for example, average, minimum,
// and maximum).
//
// This member is required.
AggregatedValues []AggregatedValue
// The ID of the entry.
//
// This member is required.
EntryId *string
noSmithyDocumentSerde
}
// Contains information for an asset property value entry that is associated with
// the BatchGetAssetPropertyValue (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValue.html)
// API. To identify an asset property, you must specify one of the following:
// - The assetId and propertyId of an asset property.
// - A propertyAlias , which is a data stream alias (for example,
// /company/windfarm/3/turbine/7/temperature ). To define an asset property's
// alias, see UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html)
// .
type BatchGetAssetPropertyValueEntry struct {
// The ID of the entry.
//
// This member is required.
EntryId *string
// The ID of the asset in which the asset property was created.
AssetId *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
PropertyAlias *string
// The ID of the asset property.
PropertyId *string
noSmithyDocumentSerde
}
// Contains error information for an asset property value entry that is associated
// with the BatchGetAssetPropertyValue (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValue.html)
// API.
type BatchGetAssetPropertyValueErrorEntry struct {
// The ID of the entry.
//
// This member is required.
EntryId *string
// The error code.
//
// This member is required.
ErrorCode BatchGetAssetPropertyValueErrorCode
// The associated error message.
//
// This member is required.
ErrorMessage *string
noSmithyDocumentSerde
}
// The error information, such as the error code and the timestamp.
type BatchGetAssetPropertyValueErrorInfo struct {
// The error code.
//
// This member is required.
ErrorCode BatchGetAssetPropertyValueErrorCode
// The date the error occurred, in Unix epoch time.
//
// This member is required.
ErrorTimestamp *time.Time
noSmithyDocumentSerde
}
// Contains information for an asset property historical value entry that is
// associated with the BatchGetAssetPropertyValueHistory (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValue.html)
// API. To identify an asset property, you must specify one of the following:
// - The assetId and propertyId of an asset property.
// - A propertyAlias , which is a data stream alias (for example,
// /company/windfarm/3/turbine/7/temperature ). To define an asset property's
// alias, see UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html)
// .
type BatchGetAssetPropertyValueHistoryEntry struct {
// The ID of the entry.
//
// This member is required.
EntryId *string
// The ID of the asset in which the asset property was created.
AssetId *string
// The inclusive end of the range from which to query historical data, expressed
// in seconds in Unix epoch time.
EndDate *time.Time
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
PropertyAlias *string
// The ID of the asset property.
PropertyId *string
// The quality by which to filter asset data.
Qualities []Quality
// The exclusive start of the range from which to query historical data, expressed
// in seconds in Unix epoch time.
StartDate *time.Time
// The chronological sorting order of the requested information. Default: ASCENDING
TimeOrdering TimeOrdering
noSmithyDocumentSerde
}
// A list of the errors (if any) associated with the batch request. Each error
// entry contains the entryId of the entry that failed.
type BatchGetAssetPropertyValueHistoryErrorEntry struct {
// The ID of the entry.
//
// This member is required.
EntryId *string
// The error code.
//
// This member is required.
ErrorCode BatchGetAssetPropertyValueHistoryErrorCode
// The associated error message.
//
// This member is required.
ErrorMessage *string
noSmithyDocumentSerde
}
// The error information, such as the error code and the timestamp.
type BatchGetAssetPropertyValueHistoryErrorInfo struct {
// The error code.
//
// This member is required.
ErrorCode BatchGetAssetPropertyValueHistoryErrorCode
// The date the error occurred, in Unix epoch time.
//
// This member is required.
ErrorTimestamp *time.Time
noSmithyDocumentSerde
}
// Contains information for an entry that has been processed by the previous
// BatchGetAssetPropertyValueHistory (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValue.html)
// request.
type BatchGetAssetPropertyValueHistorySkippedEntry struct {
// The completion status of each entry that is associated with the
// BatchGetAssetPropertyValueHistory (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValueHistory.html)
// API.
//
// This member is required.
CompletionStatus BatchEntryCompletionStatus
// The ID of the entry.
//
// This member is required.
EntryId *string
// The error information, such as the error code and the timestamp.
ErrorInfo *BatchGetAssetPropertyValueHistoryErrorInfo
noSmithyDocumentSerde
}
// Contains success information for an entry that is associated with the
// BatchGetAssetPropertyValueHistory (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValue.html)
// API.
type BatchGetAssetPropertyValueHistorySuccessEntry struct {
// The requested historical values for the specified asset property.
//
// This member is required.
AssetPropertyValueHistory []AssetPropertyValue
// The ID of the entry.
//
// This member is required.
EntryId *string
noSmithyDocumentSerde
}
// Contains information for an entry that has been processed by the previous
// BatchGetAssetPropertyValue (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValue.html)
// request.
type BatchGetAssetPropertyValueSkippedEntry struct {
// The completion status of each entry that is associated with the
// BatchGetAssetPropertyValue (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValue.html)
// request.
//
// This member is required.
CompletionStatus BatchEntryCompletionStatus
// The ID of the entry.
//
// This member is required.
EntryId *string
// The error information, such as the error code and the timestamp.
ErrorInfo *BatchGetAssetPropertyValueErrorInfo
noSmithyDocumentSerde
}
// Contains success information for an entry that is associated with the
// BatchGetAssetPropertyValue (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchGetAssetPropertyValue.html)
// API.
type BatchGetAssetPropertyValueSuccessEntry struct {
// The ID of the entry.
//
// This member is required.
EntryId *string
// Contains asset property value information.
AssetPropertyValue *AssetPropertyValue
noSmithyDocumentSerde
}
// Contains error information from updating a batch of asset property values.
type BatchPutAssetPropertyError struct {
// The error code.
//
// This member is required.
ErrorCode BatchPutAssetPropertyValueErrorCode
// The associated error message.
//
// This member is required.
ErrorMessage *string
// A list of timestamps for each error, if any.
//
// This member is required.
Timestamps []TimeInNanos
noSmithyDocumentSerde
}
// Contains error information for asset property value entries that are associated
// with the BatchPutAssetPropertyValue (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchPutAssetPropertyValue.html)
// API.
type BatchPutAssetPropertyErrorEntry struct {
// The ID of the failed entry.
//
// This member is required.
EntryId *string
// The list of update property value errors.
//
// This member is required.
Errors []BatchPutAssetPropertyError
noSmithyDocumentSerde
}
// Contains information about a composite model property on an asset.
type CompositeModelProperty struct {
// Contains asset property information.
//
// This member is required.
AssetProperty *Property
// The name of the property.
//
// This member is required.
Name *string
// The type of the composite model that defines this property.
//
// This member is required.
Type *string
// The ID of the composite model that contains the property.
Id *string
noSmithyDocumentSerde
}
// Contains the details of an IoT SiteWise configuration error.
type ConfigurationErrorDetails struct {
// The error code.
//
// This member is required.
Code ErrorCode
// The error message.
//
// This member is required.
Message *string
noSmithyDocumentSerde
}
// Contains current status information for the configuration.
type ConfigurationStatus struct {
// The current state of the configuration.
//
// This member is required.
State ConfigurationState
// Contains associated error information, if any.
Error *ConfigurationErrorDetails
noSmithyDocumentSerde
}
// A .csv file.
type Csv struct {
// The column names specified in the .csv file.
ColumnNames []ColumnName
noSmithyDocumentSerde
}
// Contains information about a customer managed Amazon S3 bucket.
type CustomerManagedS3Storage struct {
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the Identity and Access Management role that allows IoT SiteWise to send data
// to Amazon S3.
//
// This member is required.
RoleArn *string
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the Amazon S3 object. For more information about how to find the ARN for an
// Amazon S3 object, see Amazon S3 resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-arn-format.html)
// in the Amazon Simple Storage Service User Guide.
//
// This member is required.
S3ResourceArn *string
noSmithyDocumentSerde
}
// Contains a dashboard summary.
type DashboardSummary struct {
// The ID of the dashboard.
//
// This member is required.
Id *string
// The name of the dashboard
//
// This member is required.
Name *string
// The date the dashboard was created, in Unix epoch time.
CreationDate *time.Time
// The dashboard's description.
Description *string
// The date the dashboard was last updated, in Unix epoch time.
LastUpdateDate *time.Time
noSmithyDocumentSerde
}
// Contains detailed error information.
type DetailedError struct {
// The error code.
//
// This member is required.
Code DetailedErrorCode
// The error message.
//
// This member is required.
Message *string
noSmithyDocumentSerde
}
// Contains the details of an IoT SiteWise error.
type ErrorDetails struct {
// The error code.
//
// This member is required.
Code ErrorCode
// The error message.
//
// This member is required.
Message *string
// A list of detailed errors.
Details []DetailedError
noSmithyDocumentSerde
}
// The Amazon S3 destination where errors associated with the job creation request
// are saved.
type ErrorReportLocation struct {
// The name of the Amazon S3 bucket to which errors associated with the bulk
// import job are sent.
//
// This member is required.
Bucket *string
// Amazon S3 uses the prefix as a folder name to organize data in the bucket. Each
// Amazon S3 object has a key that is its unique identifier in the bucket. Each
// object in a bucket has exactly one key. The prefix must end with a forward slash
// (/). For more information, see Organizing objects using prefixes (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html)
// in the Amazon Simple Storage Service User Guide.
//
// This member is required.
Prefix *string
noSmithyDocumentSerde
}
// Contains expression variable information.
type ExpressionVariable struct {
// The friendly name of the variable to be used in the expression.
//
// This member is required.
Name *string
// The variable that identifies an asset property from which to use values.
//
// This member is required.
Value *VariableValue
noSmithyDocumentSerde
}
// The file in Amazon S3 where your data is saved.
type File struct {
// The name of the Amazon S3 bucket from which data is imported.
//
// This member is required.
Bucket *string
// The key of the Amazon S3 object that contains your data. Each object has a key
// that is a unique identifier. Each object has exactly one key.
//
// This member is required.
Key *string
// The version ID to identify a specific version of the Amazon S3 object that
// contains your data.
VersionId *string
noSmithyDocumentSerde
}
// The file format of the data.
type FileFormat struct {
// The .csv file format.
Csv *Csv
noSmithyDocumentSerde
}
// The forwarding configuration for a given property.
type ForwardingConfig struct {
// The forwarding state for the given property.
//
// This member is required.
State ForwardingConfigState
noSmithyDocumentSerde
}
// Contains a summary of a gateway capability configuration.
type GatewayCapabilitySummary struct {
// The namespace of the capability configuration. For example, if you configure
// OPC-UA sources from the IoT SiteWise console, your OPC-UA capability
// configuration has the namespace iotsitewise:opcuacollector:version , where
// version is a number such as 1 .
//
// This member is required.
CapabilityNamespace *string
// The synchronization status of the capability configuration. The sync status can
// be one of the following:
// - IN_SYNC – The gateway is running the capability configuration.
// - OUT_OF_SYNC – The gateway hasn't received the capability configuration.
// - SYNC_FAILED – The gateway rejected the capability configuration.
//
// This member is required.
CapabilitySyncStatus CapabilitySyncStatus
noSmithyDocumentSerde
}
// Contains a gateway's platform information.
type GatewayPlatform struct {
// A gateway that runs on IoT Greengrass.
Greengrass *Greengrass
// A gateway that runs on IoT Greengrass V2.
GreengrassV2 *GreengrassV2
noSmithyDocumentSerde
}
// Contains a summary of a gateway.
type GatewaySummary struct {
// The date the gateway was created, in Unix epoch time.
//
// This member is required.
CreationDate *time.Time
// The ID of the gateway device.
//
// This member is required.
GatewayId *string
// The name of the asset.
//
// This member is required.
GatewayName *string
// The date the gateway was last updated, in Unix epoch time.
//
// This member is required.
LastUpdateDate *time.Time
// A list of gateway capability summaries that each contain a namespace and
// status. Each gateway capability defines data sources for the gateway. To
// retrieve a capability configuration's definition, use
// DescribeGatewayCapabilityConfiguration (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_DescribeGatewayCapabilityConfiguration.html)
// .
GatewayCapabilitySummaries []GatewayCapabilitySummary
// Contains a gateway's platform information.
GatewayPlatform *GatewayPlatform
noSmithyDocumentSerde
}
// Contains details for a gateway that runs on IoT Greengrass. To create a gateway
// that runs on IoT Greengrass, you must add the IoT SiteWise connector to a
// Greengrass group and deploy it. Your Greengrass group must also have permissions
// to upload data to IoT SiteWise. For more information, see Ingesting data using
// a gateway (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/gateway-connector.html)
// in the IoT SiteWise User Guide.
type Greengrass struct {
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the Greengrass group. For more information about how to find a group's ARN,
// see ListGroups (https://docs.aws.amazon.com/greengrass/latest/apireference/listgroups-get.html)
// and GetGroup (https://docs.aws.amazon.com/greengrass/latest/apireference/getgroup-get.html)
// in the IoT Greengrass API Reference.
//
// This member is required.
GroupArn *string
noSmithyDocumentSerde
}
// Contains details for a gateway that runs on IoT Greengrass V2. To create a
// gateway that runs on IoT Greengrass V2, you must deploy the IoT SiteWise Edge
// component to your gateway device. Your Greengrass device role (https://docs.aws.amazon.com/greengrass/v2/developerguide/device-service-role.html)
// must use the AWSIoTSiteWiseEdgeAccess policy. For more information, see Using
// IoT SiteWise at the edge (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/sw-gateways.html)
// in the IoT SiteWise User Guide.
type GreengrassV2 struct {
// The name of the IoT thing for your IoT Greengrass V2 core device.
//
// This member is required.
CoreDeviceThingName *string
noSmithyDocumentSerde
}
// Contains information for a group identity in an access policy.
type GroupIdentity struct {
// The IAM Identity Center ID of the group.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
// Contains information about an Identity and Access Management role. For more
// information, see IAM roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)
// in the IAM User Guide.
type IAMRoleIdentity struct {
// The ARN of the IAM role. For more information, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
// in the IAM User Guide.
//
// This member is required.
Arn *string
noSmithyDocumentSerde
}
// Contains information about an Identity and Access Management user.
type IAMUserIdentity struct {
// The ARN of the IAM user. For more information, see IAM ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
// in the IAM User Guide. If you delete the IAM user, access policies that contain
// this identity include an empty arn . You can delete the access policy for the
// IAM user that no longer exists.
//
// This member is required.
Arn *string
noSmithyDocumentSerde
}
// Contains an identity that can access an IoT SiteWise Monitor resource.
// Currently, you can't use Amazon Web Services APIs to retrieve IAM Identity
// Center identity IDs. You can find the IAM Identity Center identity IDs in the
// URL of user and group pages in the IAM Identity Center console (https://console.aws.amazon.com/singlesignon)
// .
type Identity struct {
// An IAM Identity Center group identity.
Group *GroupIdentity
// An IAM role identity.
IamRole *IAMRoleIdentity
// An IAM user identity.
IamUser *IAMUserIdentity
// An IAM Identity Center user identity.
User *UserIdentity
noSmithyDocumentSerde
}
// Contains an image that is one of the following:
// - An image file. Choose this option to upload a new image.
// - The ID of an existing image. Choose this option to keep an existing image.
type Image struct {
// Contains an image file.
File *ImageFile
// The ID of an existing image. Specify this parameter to keep an existing image.
Id *string
noSmithyDocumentSerde
}
// Contains an image file.
type ImageFile struct {
// The image file contents, represented as a base64-encoded string. The file size
// must be less than 1 MB.
//
// This member is required.
Data []byte
// The file type of the image.
//
// This member is required.
Type ImageFileType
noSmithyDocumentSerde
}
// Contains an image that is uploaded to IoT SiteWise and available at a URL.
type ImageLocation struct {
// The ID of the image.
//
// This member is required.
Id *string
// The URL where the image is available. The URL is valid for 15 minutes so that
// you can view and download the image
//
// This member is required.
Url *string
noSmithyDocumentSerde
}
// Contains information about an interpolated asset property value.
type InterpolatedAssetPropertyValue struct {
// Contains a timestamp with optional nanosecond granularity.
//
// This member is required.
Timestamp *TimeInNanos
// Contains an asset property value (of a single type only).
//
// This member is required.
Value *Variant
noSmithyDocumentSerde
}
// Contains the configuration information of a job, such as the file format used
// to save data in Amazon S3.
type JobConfiguration struct {
// The file format of the data in Amazon S3.
//
// This member is required.
FileFormat *FileFormat
noSmithyDocumentSerde
}
// Contains a job summary information.
type JobSummary struct {
// The ID of the job.
//
// This member is required.
Id *string
// The unique name that helps identify the job request.
//
// This member is required.
Name *string
// The status of the bulk import job can be one of following values.
// - PENDING – IoT SiteWise is waiting for the current bulk import job to finish.
// - CANCELLED – The bulk import job has been canceled.
// - RUNNING – IoT SiteWise is processing your request to import your data from
// Amazon S3.
// - COMPLETED – IoT SiteWise successfully completed your request to import data
// from Amazon S3.
// - FAILED – IoT SiteWise couldn't process your request to import data from
// Amazon S3. You can use logs saved in the specified error report location in
// Amazon S3 to troubleshoot issues.
// - COMPLETED_WITH_FAILURES – IoT SiteWise completed your request to import data
// from Amazon S3 with errors. You can use logs saved in the specified error report
// location in Amazon S3 to troubleshoot issues.
//
// This member is required.
Status JobStatus
noSmithyDocumentSerde
}
// Contains logging options.
type LoggingOptions struct {
// The IoT SiteWise logging verbosity level.
//
// This member is required.
Level LoggingLevel
noSmithyDocumentSerde
}
// Contains an asset measurement property. For more information, see Measurements (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-properties.html#measurements)
// in the IoT SiteWise User Guide.
type Measurement struct {
// The processing configuration for the given measurement property. You can
// configure measurements to be kept at the edge or forwarded to the Amazon Web
// Services Cloud. By default, measurements are forwarded to the cloud.
ProcessingConfig *MeasurementProcessingConfig
noSmithyDocumentSerde
}
// The processing configuration for the given measurement property. You can
// configure measurements to be kept at the edge or forwarded to the Amazon Web
// Services Cloud. By default, measurements are forwarded to the cloud.
type MeasurementProcessingConfig struct {
// The forwarding configuration for the given measurement property.
//
// This member is required.
ForwardingConfig *ForwardingConfig
noSmithyDocumentSerde
}
// Contains an asset metric property. With metrics, you can calculate aggregate
// functions, such as an average, maximum, or minimum, as specified through an
// expression. A metric maps several values to a single value (such as a sum). The
// maximum number of dependent/cascading variables used in any one metric
// calculation is 10. Therefore, a root metric can have up to 10 cascading metrics
// in its computational dependency tree. Additionally, a metric can only have a
// data type of DOUBLE and consume properties with data types of INTEGER or DOUBLE
// . For more information, see Metrics (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-properties.html#metrics)
// in the IoT SiteWise User Guide.
type Metric struct {
// The mathematical expression that defines the metric aggregation function. You
// can specify up to 10 variables per expression. You can specify up to 10
// functions per expression. For more information, see Quotas (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html)
// in the IoT SiteWise User Guide.
//
// This member is required.
Expression *string
// The list of variables used in the expression.
//
// This member is required.
Variables []ExpressionVariable
// The window (time interval) over which IoT SiteWise computes the metric's
// aggregation expression. IoT SiteWise computes one data point per window .
//
// This member is required.
Window *MetricWindow
// The processing configuration for the given metric property. You can configure
// metrics to be computed at the edge or in the Amazon Web Services Cloud. By
// default, metrics are forwarded to the cloud.
ProcessingConfig *MetricProcessingConfig
noSmithyDocumentSerde
}
// The processing configuration for the given metric property. You can configure
// metrics to be computed at the edge or in the Amazon Web Services Cloud. By
// default, metrics are forwarded to the cloud.
type MetricProcessingConfig struct {
// The compute location for the given metric property.
//
// This member is required.
ComputeLocation ComputeLocation
noSmithyDocumentSerde
}
// Contains a time interval window used for data aggregate computations (for
// example, average, sum, count, and so on).
type MetricWindow struct {
// The tumbling time interval window.
Tumbling *TumblingWindow
noSmithyDocumentSerde
}
// Contains IoT SiteWise Monitor error details.
type MonitorErrorDetails struct {
// The error code.
Code MonitorErrorCode
// The error message.
Message *string
noSmithyDocumentSerde
}
// Contains information about the storage destination.
type MultiLayerStorage struct {
// Contains information about a customer managed Amazon S3 bucket.
//
// This member is required.
CustomerManagedS3Storage *CustomerManagedS3Storage
noSmithyDocumentSerde
}
// Identifies an IoT SiteWise Monitor portal.
type PortalResource struct {
// The ID of the portal.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
// Contains information about the current status of a portal.
type PortalStatus struct {
// The current state of the portal.
//
// This member is required.
State PortalState
// Contains associated error information, if any.
Error *MonitorErrorDetails
noSmithyDocumentSerde
}
// Contains a portal summary.
type PortalSummary struct {
// The ID of the portal.
//
// This member is required.
Id *string
// The name of the portal.
//
// This member is required.
Name *string
// The URL for the IoT SiteWise Monitor portal. You can use this URL to access
// portals that use IAM Identity Center for authentication. For portals that use
// IAM for authentication, you must use the IoT SiteWise console to get a URL that
// you can use to access the portal.
//
// This member is required.
StartUrl *string
// Contains information about the current status of a portal.
//
// This member is required.
Status *PortalStatus
// The date the portal was created, in Unix epoch time.
CreationDate *time.Time
// The portal's description.
Description *string
// The date the portal was last updated, in Unix epoch time.
LastUpdateDate *time.Time
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the service role that allows the portal's users to access your IoT SiteWise
// resources on your behalf. For more information, see Using service roles for IoT
// SiteWise Monitor (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/monitor-service-role.html)
// in the IoT SiteWise User Guide.
RoleArn *string
noSmithyDocumentSerde
}
// Identifies a specific IoT SiteWise Monitor project.
type ProjectResource struct {
// The ID of the project.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
// Contains project summary information.
type ProjectSummary struct {
// The ID of the project.
//
// This member is required.
Id *string
// The name of the project.
//
// This member is required.
Name *string
// The date the project was created, in Unix epoch time.
CreationDate *time.Time
// The project's description.
Description *string
// The date the project was last updated, in Unix epoch time.
LastUpdateDate *time.Time
noSmithyDocumentSerde
}
// Contains asset property information.
type Property struct {
// The property data type.
//
// This member is required.
DataType PropertyDataType
// The ID of the asset property.
//
// This member is required.
Id *string
// The name of the property.
//
// This member is required.
Name *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
Alias *string
// The asset property's notification topic and state. For more information, see
// UpdateAssetProperty (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_UpdateAssetProperty.html)
// .
Notification *PropertyNotification
// The property type (see PropertyType ). A property contains one type.
Type *PropertyType
// The unit (such as Newtons or RPM ) of the asset property.
Unit *string
noSmithyDocumentSerde
}
// Contains asset property value notification information. When the notification
// state is enabled, IoT SiteWise publishes property value updates to a unique MQTT
// topic. For more information, see Interacting with other services (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/interact-with-other-services.html)
// in the IoT SiteWise User Guide.
type PropertyNotification struct {
// The current notification state.
//
// This member is required.
State PropertyNotificationState
// The MQTT topic to which IoT SiteWise publishes property value update
// notifications.
//
// This member is required.
Topic *string
noSmithyDocumentSerde
}
// Contains a property type, which can be one of attribute , measurement , metric ,
// or transform .
type PropertyType struct {
// Specifies an asset attribute property. An attribute generally contains static
// information, such as the serial number of an IIoT (https://en.wikipedia.org/wiki/Internet_of_things#Industrial_applications)
// wind turbine.
Attribute *Attribute
// Specifies an asset measurement property. A measurement represents a device's
// raw sensor data stream, such as timestamped temperature values or timestamped
// power values.
Measurement *Measurement
// Specifies an asset metric property. A metric contains a mathematical expression
// that uses aggregate functions to process all input data points over a time
// interval and output a single data point, such as to calculate the average hourly
// temperature.
Metric *Metric
// Specifies an asset transform property. A transform contains a mathematical
// expression that maps a property's data points from one form to another, such as
// a unit conversion from Celsius to Fahrenheit.
Transform *Transform
noSmithyDocumentSerde
}
// Contains a list of value updates for an asset property in the list of asset
// entries consumed by the BatchPutAssetPropertyValue (https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_BatchPutAssetPropertyValue.html)
// API operation.
type PutAssetPropertyValueEntry struct {
// The user specified ID for the entry. You can use this ID to identify which
// entries failed.
//
// This member is required.
EntryId *string
// The list of property values to upload. You can specify up to 10 propertyValues
// array elements.
//
// This member is required.
PropertyValues []AssetPropertyValue
// The ID of the asset to update.
AssetId *string
// The alias that identifies the property, such as an OPC-UA server data stream
// path (for example, /company/windfarm/3/turbine/7/temperature ). For more
// information, see Mapping industrial data streams to asset properties (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/connect-data-streams.html)
// in the IoT SiteWise User Guide.
PropertyAlias *string
// The ID of the asset property for this entry.
PropertyId *string
noSmithyDocumentSerde
}
// Contains an IoT SiteWise Monitor resource ID for a portal or project.
type Resource struct {
// A portal resource.
Portal *PortalResource
// A project resource.
Project *ProjectResource
noSmithyDocumentSerde
}
// How many days your data is kept in the hot tier. By default, your data is kept
// indefinitely in the hot tier.
type RetentionPeriod struct {
// The number of days that your data is kept. If you specified a value for this
// parameter, the unlimited parameter must be false .
NumberOfDays *int32
// If true, your data is kept indefinitely. If configured to true , you must not
// specify a value for the numberOfDays parameter.
Unlimited *bool
noSmithyDocumentSerde
}
// Contains a timestamp with optional nanosecond granularity.
type TimeInNanos struct {
// The timestamp date, in seconds, in the Unix epoch format. Fractional nanosecond
// data is provided by offsetInNanos .
//
// This member is required.
TimeInSeconds *int64
// The nanosecond offset from timeInSeconds .
OffsetInNanos *int32
noSmithyDocumentSerde
}
// Contains a summary of a time series (data stream).
type TimeSeriesSummary struct {
// The data type of the time series. If you specify STRUCT , you must also specify
// dataTypeSpec to identify the type of the structure for this time series.
//
// This member is required.
DataType PropertyDataType
// The ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// of the time series, which has the following format.
// arn:${Partition}:iotsitewise:${Region}:${Account}:time-series/${TimeSeriesId}
//
// This member is required.
TimeSeriesArn *string
// The date that the time series was created, in Unix epoch time.
//
// This member is required.
TimeSeriesCreationDate *time.Time
// The ID of the time series.
//
// This member is required.
TimeSeriesId *string
// The date that the time series was last updated, in Unix epoch time.
//
// This member is required.
TimeSeriesLastUpdateDate *time.Time
// The alias that identifies the time series.
Alias *string
// The ID of the asset in which the asset property was created.
AssetId *string
// The data type of the structure for this time series. This parameter is required
// for time series that have the STRUCT data type. The options for this parameter
// depend on the type of the composite model in which you created the asset
// property that is associated with your time series. Use AWS/ALARM_STATE for
// alarm state in alarm composite models.
DataTypeSpec *string
// The ID of the asset property.
PropertyId *string
noSmithyDocumentSerde
}
// Contains an asset transform property. A transform is a one-to-one mapping of a
// property's data points from one form to another. For example, you can use a
// transform to convert a Celsius data stream to Fahrenheit by applying the
// transformation expression to each data point of the Celsius stream. A transform
// can only have a data type of DOUBLE and consume properties with data types of
// INTEGER or DOUBLE . For more information, see Transforms (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-properties.html#transforms)
// in the IoT SiteWise User Guide.
type Transform struct {
// The mathematical expression that defines the transformation function. You can
// specify up to 10 variables per expression. You can specify up to 10 functions
// per expression. For more information, see Quotas (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html)
// in the IoT SiteWise User Guide.
//
// This member is required.
Expression *string
// The list of variables used in the expression.
//
// This member is required.
Variables []ExpressionVariable
// The processing configuration for the given transform property. You can
// configure transforms to be kept at the edge or forwarded to the Amazon Web
// Services Cloud. You can also configure transforms to be computed at the edge or
// in the cloud.
ProcessingConfig *TransformProcessingConfig
noSmithyDocumentSerde
}
// The processing configuration for the given transform property. You can
// configure transforms to be kept at the edge or forwarded to the Amazon Web
// Services Cloud. You can also configure transforms to be computed at the edge or
// in the cloud.
type TransformProcessingConfig struct {
// The compute location for the given transform property.
//
// This member is required.
ComputeLocation ComputeLocation
// The forwarding configuration for a given property.
ForwardingConfig *ForwardingConfig
noSmithyDocumentSerde
}
// Contains a tumbling window, which is a repeating fixed-sized, non-overlapping,
// and contiguous time window. You can use this window in metrics to aggregate data
// from properties and other assets. You can use m , h , d , and w when you
// specify an interval or offset. Note that m represents minutes, h represents
// hours, d represents days, and w represents weeks. You can also use s to
// represent seconds in offset . The interval and offset parameters support the
// ISO 8601 format (https://en.wikipedia.org/wiki/ISO_8601) . For example, PT5S
// represents 5 seconds, PT5M represents 5 minutes, and PT5H represents 5 hours.
type TumblingWindow struct {
// The time interval for the tumbling window. The interval time must be between 1
// minute and 1 week. IoT SiteWise computes the 1w interval the end of Sunday at
// midnight each week (UTC), the 1d interval at the end of each day at midnight
// (UTC), the 1h interval at the end of each hour, and so on. When IoT SiteWise
// aggregates data points for metric computations, the start of each interval is
// exclusive and the end of each interval is inclusive. IoT SiteWise places the
// computed data point at the end of the interval.
//
// This member is required.
Interval *string
// The offset for the tumbling window. The offset parameter accepts the following:
// - The offset time. For example, if you specify 18h for offset and 1d for
// interval , IoT SiteWise aggregates data in one of the following ways:
// - If you create the metric before or at 6 PM (UTC), you get the first
// aggregation result at 6 PM (UTC) on the day when you create the metric.
// - If you create the metric after 6 PM (UTC), you get the first aggregation
// result at 6 PM (UTC) the next day.
// - The ISO 8601 format. For example, if you specify PT18H for offset and 1d for
// interval , IoT SiteWise aggregates data in one of the following ways:
// - If you create the metric before or at 6 PM (UTC), you get the first
// aggregation result at 6 PM (UTC) on the day when you create the metric.
// - If you create the metric after 6 PM (UTC), you get the first aggregation
// result at 6 PM (UTC) the next day.
// - The 24-hour clock. For example, if you specify 00:03:00 for offset , 5m for
// interval , and you create the metric at 2 PM (UTC), you get the first
// aggregation result at 2:03 PM (UTC). You get the second aggregation result at
// 2:08 PM (UTC).
// - The offset time zone. For example, if you specify 2021-07-23T18:00-08 for
// offset and 1d for interval , IoT SiteWise aggregates data in one of the
// following ways:
// - If you create the metric before or at 6 PM (PST), you get the first
// aggregation result at 6 PM (PST) on the day when you create the metric.
// - If you create the metric after 6 PM (PST), you get the first aggregation
// result at 6 PM (PST) the next day.
Offset *string
noSmithyDocumentSerde
}
// Contains information for a user identity in an access policy.
type UserIdentity struct {
// The IAM Identity Center ID of the user.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
// Identifies a property value used in an expression.
type VariableValue struct {
// The ID of the property to use as the variable. You can use the property name if
// it's from the same asset model.
//
// This member is required.
PropertyId *string
// The ID of the hierarchy to query for the property ID. You can use the
// hierarchy's name instead of the hierarchy's ID. You use a hierarchy ID instead
// of a model ID because you can have several hierarchies using the same model and
// therefore the same propertyId . For example, you might have separately grouped
// assets that come from the same asset model. For more information, see Asset
// hierarchies (https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html)
// in the IoT SiteWise User Guide.
HierarchyId *string
noSmithyDocumentSerde
}
// Contains an asset property value (of a single type only).
type Variant struct {
// Asset property data of type Boolean (true or false).
BooleanValue *bool
// Asset property data of type double (floating point number).
DoubleValue *float64
// Asset property data of type integer (whole number).
IntegerValue *int32
// Asset property data of type string (sequence of characters).
StringValue *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 2,178 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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 = "IoTThingsGraph"
const ServiceAPIVersion = "2018-09-06"
// Client provides the API client to make operations call for AWS IoT Things Graph.
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, "iotthingsgraph", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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 iotthingsgraph
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"
)
// Associates a device with a concrete thing that is in the user's registry. A
// thing can be associated with only one device at a time. If you associate a thing
// with a new device id, its previous association will be removed.
//
// Deprecated: since: 2022-08-30
func (c *Client) AssociateEntityToThing(ctx context.Context, params *AssociateEntityToThingInput, optFns ...func(*Options)) (*AssociateEntityToThingOutput, error) {
if params == nil {
params = &AssociateEntityToThingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateEntityToThing", params, optFns, c.addOperationAssociateEntityToThingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateEntityToThingOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateEntityToThingInput struct {
// The ID of the device to be associated with the thing. The ID should be in the
// following format. urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME
//
// This member is required.
EntityId *string
// The name of the thing to which the entity is to be associated.
//
// This member is required.
ThingName *string
// The version of the user's namespace. Defaults to the latest version of the
// user's namespace.
NamespaceVersion *int64
noSmithyDocumentSerde
}
type AssociateEntityToThingOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateEntityToThingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateEntityToThing{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateEntityToThing{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateEntityToThingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateEntityToThing(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAssociateEntityToThing(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "AssociateEntityToThing",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a workflow template. Workflows can be created only in the user's
// namespace. (The public namespace contains only entities.) The workflow can
// contain only entities in the specified namespace. The workflow is validated
// against the entities in the latest version of the user's namespace unless
// another namespace version is specified in the request.
//
// Deprecated: since: 2022-08-30
func (c *Client) CreateFlowTemplate(ctx context.Context, params *CreateFlowTemplateInput, optFns ...func(*Options)) (*CreateFlowTemplateOutput, error) {
if params == nil {
params = &CreateFlowTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateFlowTemplate", params, optFns, c.addOperationCreateFlowTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateFlowTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateFlowTemplateInput struct {
// The workflow DefinitionDocument .
//
// This member is required.
Definition *types.DefinitionDocument
// The namespace version in which the workflow is to be created. If no value is
// specified, the latest version is used by default.
CompatibleNamespaceVersion *int64
noSmithyDocumentSerde
}
type CreateFlowTemplateOutput struct {
// The summary object that describes the created workflow.
Summary *types.FlowTemplateSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateFlowTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateFlowTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateFlowTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateFlowTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFlowTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateFlowTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "CreateFlowTemplate",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a system instance. This action validates the system instance, prepares
// the deployment-related resources. For Greengrass deployments, it updates the
// Greengrass group that is specified by the greengrassGroupName parameter. It
// also adds a file to the S3 bucket specified by the s3BucketName parameter. You
// need to call DeploySystemInstance after running this action. For Greengrass
// deployments, since this action modifies and adds resources to a Greengrass group
// and an S3 bucket on the caller's behalf, the calling identity must have write
// permissions to both the specified Greengrass group and S3 bucket. Otherwise, the
// call will fail with an authorization error. For cloud deployments, this action
// requires a flowActionsRoleArn value. This is an IAM role that has permissions
// to access AWS services, such as AWS Lambda and AWS IoT, that the flow uses when
// it executes. If the definition document doesn't specify a version of the user's
// namespace, the latest version will be used by default.
//
// Deprecated: since: 2022-08-30
func (c *Client) CreateSystemInstance(ctx context.Context, params *CreateSystemInstanceInput, optFns ...func(*Options)) (*CreateSystemInstanceOutput, error) {
if params == nil {
params = &CreateSystemInstanceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSystemInstance", params, optFns, c.addOperationCreateSystemInstanceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSystemInstanceOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSystemInstanceInput struct {
// A document that defines an entity.
//
// This member is required.
Definition *types.DefinitionDocument
// The target type of the deployment. Valid values are GREENGRASS and CLOUD .
//
// This member is required.
Target types.DeploymentTarget
// The ARN of the IAM role that AWS IoT Things Graph will assume when it executes
// the flow. This role must have read and write access to AWS Lambda and AWS IoT
// and any other AWS services that the flow uses when it executes. This value is
// required if the value of the target parameter is CLOUD .
FlowActionsRoleArn *string
// The name of the Greengrass group where the system instance will be deployed.
// This value is required if the value of the target parameter is GREENGRASS .
GreengrassGroupName *string
// An object that specifies whether cloud metrics are collected in a deployment
// and, if so, what role is used to collect metrics.
MetricsConfiguration *types.MetricsConfiguration
// The name of the Amazon Simple Storage Service bucket that will be used to store
// and deploy the system instance's resource file. This value is required if the
// value of the target parameter is GREENGRASS .
S3BucketName *string
// Metadata, consisting of key-value pairs, that can be used to categorize your
// system instances.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateSystemInstanceOutput struct {
// The summary object that describes the new system instance.
Summary *types.SystemInstanceSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSystemInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateSystemInstance{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateSystemInstance{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSystemInstanceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSystemInstance(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateSystemInstance(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "CreateSystemInstance",
}
}
| 167 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a system. The system is validated against the entities in the latest
// version of the user's namespace unless another namespace version is specified in
// the request.
//
// Deprecated: since: 2022-08-30
func (c *Client) CreateSystemTemplate(ctx context.Context, params *CreateSystemTemplateInput, optFns ...func(*Options)) (*CreateSystemTemplateOutput, error) {
if params == nil {
params = &CreateSystemTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSystemTemplate", params, optFns, c.addOperationCreateSystemTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSystemTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSystemTemplateInput struct {
// The DefinitionDocument used to create the system.
//
// This member is required.
Definition *types.DefinitionDocument
// The namespace version in which the system is to be created. If no value is
// specified, the latest version is used by default.
CompatibleNamespaceVersion *int64
noSmithyDocumentSerde
}
type CreateSystemTemplateOutput struct {
// The summary object that describes the created system.
Summary *types.SystemTemplateSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSystemTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateSystemTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateSystemTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSystemTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSystemTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateSystemTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "CreateSystemTemplate",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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 workflow. Any new system or deployment that contains this workflow
// will fail to update or deploy. Existing deployments that contain the workflow
// will continue to run (since they use a snapshot of the workflow taken at the
// time of deployment).
//
// Deprecated: since: 2022-08-30
func (c *Client) DeleteFlowTemplate(ctx context.Context, params *DeleteFlowTemplateInput, optFns ...func(*Options)) (*DeleteFlowTemplateOutput, error) {
if params == nil {
params = &DeleteFlowTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteFlowTemplate", params, optFns, c.addOperationDeleteFlowTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteFlowTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteFlowTemplateInput struct {
// The ID of the workflow to be deleted. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DeleteFlowTemplateOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteFlowTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteFlowTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteFlowTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteFlowTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFlowTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteFlowTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "DeleteFlowTemplate",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified namespace. This action deletes all of the entities in the
// namespace. Delete the systems and flows that use entities in the namespace
// before performing this action. This action takes no request parameters.
//
// Deprecated: since: 2022-08-30
func (c *Client) DeleteNamespace(ctx context.Context, params *DeleteNamespaceInput, optFns ...func(*Options)) (*DeleteNamespaceOutput, error) {
if params == nil {
params = &DeleteNamespaceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteNamespace", params, optFns, c.addOperationDeleteNamespaceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteNamespaceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteNamespaceInput struct {
noSmithyDocumentSerde
}
type DeleteNamespaceOutput struct {
// The ARN of the namespace to be deleted.
NamespaceArn *string
// The name of the namespace to be deleted.
NamespaceName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteNamespace{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteNamespace{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNamespace(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteNamespace(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "DeleteNamespace",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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 system instance. Only system instances that have never been deployed,
// or that have been undeployed can be deleted. Users can create a new system
// instance that has the same ID as a deleted system instance.
//
// Deprecated: since: 2022-08-30
func (c *Client) DeleteSystemInstance(ctx context.Context, params *DeleteSystemInstanceInput, optFns ...func(*Options)) (*DeleteSystemInstanceOutput, error) {
if params == nil {
params = &DeleteSystemInstanceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSystemInstance", params, optFns, c.addOperationDeleteSystemInstanceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSystemInstanceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSystemInstanceInput struct {
// The ID of the system instance to be deleted.
Id *string
noSmithyDocumentSerde
}
type DeleteSystemInstanceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSystemInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteSystemInstance{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteSystemInstance{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSystemInstance(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteSystemInstance(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "DeleteSystemInstance",
}
}
| 119 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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 system. New deployments can't contain the system after its deletion.
// Existing deployments that contain the system will continue to work because they
// use a snapshot of the system that is taken when it is deployed.
//
// Deprecated: since: 2022-08-30
func (c *Client) DeleteSystemTemplate(ctx context.Context, params *DeleteSystemTemplateInput, optFns ...func(*Options)) (*DeleteSystemTemplateOutput, error) {
if params == nil {
params = &DeleteSystemTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSystemTemplate", params, optFns, c.addOperationDeleteSystemTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSystemTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSystemTemplateInput struct {
// The ID of the system to be deleted. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DeleteSystemTemplateOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSystemTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteSystemTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteSystemTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSystemTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSystemTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteSystemTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "DeleteSystemTemplate",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Greengrass and Cloud Deployments Deploys the system instance to the target
// specified in CreateSystemInstance . Greengrass Deployments If the system or any
// workflows and entities have been updated before this action is called, then the
// deployment will create a new Amazon Simple Storage Service resource file and
// then deploy it. Since this action creates a Greengrass deployment on the
// caller's behalf, the calling identity must have write permissions to the
// specified Greengrass group. Otherwise, the call will fail with an authorization
// error. For information about the artifacts that get added to your Greengrass
// core device when you use this API, see AWS IoT Things Graph and AWS IoT
// Greengrass (https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-greengrass.html)
// .
//
// Deprecated: since: 2022-08-30
func (c *Client) DeploySystemInstance(ctx context.Context, params *DeploySystemInstanceInput, optFns ...func(*Options)) (*DeploySystemInstanceOutput, error) {
if params == nil {
params = &DeploySystemInstanceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeploySystemInstance", params, optFns, c.addOperationDeploySystemInstanceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeploySystemInstanceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeploySystemInstanceInput struct {
// The ID of the system instance. This value is returned by the
// CreateSystemInstance action. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME
Id *string
noSmithyDocumentSerde
}
type DeploySystemInstanceOutput struct {
// An object that contains summary information about a system instance that was
// deployed.
//
// This member is required.
Summary *types.SystemInstanceSummary
// The ID of the Greengrass deployment used to deploy the system instance.
GreengrassDeploymentId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeploySystemInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeploySystemInstance{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeploySystemInstance{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeploySystemInstance(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeploySystemInstance(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "DeploySystemInstance",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deprecates the specified workflow. This action marks the workflow for deletion.
// Deprecated flows can't be deployed, but existing deployments will continue to
// run.
//
// Deprecated: since: 2022-08-30
func (c *Client) DeprecateFlowTemplate(ctx context.Context, params *DeprecateFlowTemplateInput, optFns ...func(*Options)) (*DeprecateFlowTemplateOutput, error) {
if params == nil {
params = &DeprecateFlowTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeprecateFlowTemplate", params, optFns, c.addOperationDeprecateFlowTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeprecateFlowTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeprecateFlowTemplateInput struct {
// The ID of the workflow to be deleted. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DeprecateFlowTemplateOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeprecateFlowTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeprecateFlowTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeprecateFlowTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeprecateFlowTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprecateFlowTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeprecateFlowTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "DeprecateFlowTemplate",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deprecates the specified system.
//
// Deprecated: since: 2022-08-30
func (c *Client) DeprecateSystemTemplate(ctx context.Context, params *DeprecateSystemTemplateInput, optFns ...func(*Options)) (*DeprecateSystemTemplateOutput, error) {
if params == nil {
params = &DeprecateSystemTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeprecateSystemTemplate", params, optFns, c.addOperationDeprecateSystemTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeprecateSystemTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeprecateSystemTemplateInput struct {
// The ID of the system to delete. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DeprecateSystemTemplateOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeprecateSystemTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeprecateSystemTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeprecateSystemTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeprecateSystemTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeprecateSystemTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeprecateSystemTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "DeprecateSystemTemplate",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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"
)
// Gets the latest version of the user's namespace and the public version that it
// is tracking.
//
// Deprecated: since: 2022-08-30
func (c *Client) DescribeNamespace(ctx context.Context, params *DescribeNamespaceInput, optFns ...func(*Options)) (*DescribeNamespaceOutput, error) {
if params == nil {
params = &DescribeNamespaceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeNamespace", params, optFns, c.addOperationDescribeNamespaceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeNamespaceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeNamespaceInput struct {
// The name of the user's namespace. Set this to aws to get the public namespace.
NamespaceName *string
noSmithyDocumentSerde
}
type DescribeNamespaceOutput struct {
// The ARN of the namespace.
NamespaceArn *string
// The name of the namespace.
NamespaceName *string
// The version of the user's namespace to describe.
NamespaceVersion *int64
// The name of the public namespace that the latest namespace version is tracking.
TrackingNamespaceName *string
// The version of the public namespace that the latest version is tracking.
TrackingNamespaceVersion *int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeNamespace{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeNamespace{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeNamespace(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeNamespace(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "DescribeNamespace",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Dissociates a device entity from a concrete thing. The action takes only the
// type of the entity that you need to dissociate because only one entity of a
// particular type can be associated with a thing.
//
// Deprecated: since: 2022-08-30
func (c *Client) DissociateEntityFromThing(ctx context.Context, params *DissociateEntityFromThingInput, optFns ...func(*Options)) (*DissociateEntityFromThingOutput, error) {
if params == nil {
params = &DissociateEntityFromThingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DissociateEntityFromThing", params, optFns, c.addOperationDissociateEntityFromThingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DissociateEntityFromThingOutput)
out.ResultMetadata = metadata
return out, nil
}
type DissociateEntityFromThingInput struct {
// The entity type from which to disassociate the thing.
//
// This member is required.
EntityType types.EntityType
// The name of the thing to disassociate.
//
// This member is required.
ThingName *string
noSmithyDocumentSerde
}
type DissociateEntityFromThingOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDissociateEntityFromThingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDissociateEntityFromThing{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDissociateEntityFromThing{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDissociateEntityFromThingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDissociateEntityFromThing(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDissociateEntityFromThing(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "DissociateEntityFromThing",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets definitions of the specified entities. Uses the latest version of the
// user's namespace by default. This API returns the following TDM entities.
// - Properties
// - States
// - Events
// - Actions
// - Capabilities
// - Mappings
// - Devices
// - Device Models
// - Services
//
// This action doesn't return definitions for systems, flows, and deployments.
//
// Deprecated: since: 2022-08-30
func (c *Client) GetEntities(ctx context.Context, params *GetEntitiesInput, optFns ...func(*Options)) (*GetEntitiesOutput, error) {
if params == nil {
params = &GetEntitiesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetEntities", params, optFns, c.addOperationGetEntitiesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetEntitiesOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetEntitiesInput struct {
// An array of entity IDs. The IDs should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME
//
// This member is required.
Ids []string
// The version of the user's namespace. Defaults to the latest version of the
// user's namespace.
NamespaceVersion *int64
noSmithyDocumentSerde
}
type GetEntitiesOutput struct {
// An array of descriptions for the specified entities.
Descriptions []types.EntityDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetEntitiesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetEntities{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetEntities{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetEntitiesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEntities(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetEntities(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "GetEntities",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets the latest version of the DefinitionDocument and FlowTemplateSummary for
// the specified workflow.
//
// Deprecated: since: 2022-08-30
func (c *Client) GetFlowTemplate(ctx context.Context, params *GetFlowTemplateInput, optFns ...func(*Options)) (*GetFlowTemplateOutput, error) {
if params == nil {
params = &GetFlowTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetFlowTemplate", params, optFns, c.addOperationGetFlowTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetFlowTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetFlowTemplateInput struct {
// The ID of the workflow. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME
//
// This member is required.
Id *string
// The number of the workflow revision to retrieve.
RevisionNumber *int64
noSmithyDocumentSerde
}
type GetFlowTemplateOutput struct {
// The object that describes the specified workflow.
Description *types.FlowTemplateDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetFlowTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetFlowTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetFlowTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetFlowTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFlowTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetFlowTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "GetFlowTemplate",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets revisions of the specified workflow. Only the last 100 revisions are
// stored. If the workflow has been deprecated, this action will return revisions
// that occurred before the deprecation. This action won't work for workflows that
// have been deleted.
//
// Deprecated: since: 2022-08-30
func (c *Client) GetFlowTemplateRevisions(ctx context.Context, params *GetFlowTemplateRevisionsInput, optFns ...func(*Options)) (*GetFlowTemplateRevisionsOutput, error) {
if params == nil {
params = &GetFlowTemplateRevisionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetFlowTemplateRevisions", params, optFns, c.addOperationGetFlowTemplateRevisionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetFlowTemplateRevisionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetFlowTemplateRevisionsInput struct {
// The ID of the workflow. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME
//
// This member is required.
Id *string
// The maximum number of results to return in the response.
MaxResults *int32
// The string that specifies the next page of results. Use this when you're
// paginating results.
NextToken *string
noSmithyDocumentSerde
}
type GetFlowTemplateRevisionsOutput struct {
// The string to specify as nextToken when you request the next page of results.
NextToken *string
// An array of objects that provide summary data about each revision.
Summaries []types.FlowTemplateSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetFlowTemplateRevisionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetFlowTemplateRevisions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetFlowTemplateRevisions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetFlowTemplateRevisionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFlowTemplateRevisions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// GetFlowTemplateRevisionsAPIClient is a client that implements the
// GetFlowTemplateRevisions operation.
type GetFlowTemplateRevisionsAPIClient interface {
GetFlowTemplateRevisions(context.Context, *GetFlowTemplateRevisionsInput, ...func(*Options)) (*GetFlowTemplateRevisionsOutput, error)
}
var _ GetFlowTemplateRevisionsAPIClient = (*Client)(nil)
// GetFlowTemplateRevisionsPaginatorOptions is the paginator options for
// GetFlowTemplateRevisions
type GetFlowTemplateRevisionsPaginatorOptions struct {
// The maximum number of results to return in the response.
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
}
// GetFlowTemplateRevisionsPaginator is a paginator for GetFlowTemplateRevisions
type GetFlowTemplateRevisionsPaginator struct {
options GetFlowTemplateRevisionsPaginatorOptions
client GetFlowTemplateRevisionsAPIClient
params *GetFlowTemplateRevisionsInput
nextToken *string
firstPage bool
}
// NewGetFlowTemplateRevisionsPaginator returns a new
// GetFlowTemplateRevisionsPaginator
func NewGetFlowTemplateRevisionsPaginator(client GetFlowTemplateRevisionsAPIClient, params *GetFlowTemplateRevisionsInput, optFns ...func(*GetFlowTemplateRevisionsPaginatorOptions)) *GetFlowTemplateRevisionsPaginator {
if params == nil {
params = &GetFlowTemplateRevisionsInput{}
}
options := GetFlowTemplateRevisionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetFlowTemplateRevisionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetFlowTemplateRevisionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetFlowTemplateRevisions page.
func (p *GetFlowTemplateRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFlowTemplateRevisionsOutput, 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.GetFlowTemplateRevisions(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_opGetFlowTemplateRevisions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "GetFlowTemplateRevisions",
}
}
| 234 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets the status of a namespace deletion task.
//
// Deprecated: since: 2022-08-30
func (c *Client) GetNamespaceDeletionStatus(ctx context.Context, params *GetNamespaceDeletionStatusInput, optFns ...func(*Options)) (*GetNamespaceDeletionStatusOutput, error) {
if params == nil {
params = &GetNamespaceDeletionStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetNamespaceDeletionStatus", params, optFns, c.addOperationGetNamespaceDeletionStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetNamespaceDeletionStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetNamespaceDeletionStatusInput struct {
noSmithyDocumentSerde
}
type GetNamespaceDeletionStatusOutput struct {
// An error code returned by the namespace deletion task.
ErrorCode types.NamespaceDeletionStatusErrorCodes
// An error code returned by the namespace deletion task.
ErrorMessage *string
// The ARN of the namespace that is being deleted.
NamespaceArn *string
// The name of the namespace that is being deleted.
NamespaceName *string
// The status of the deletion request.
Status types.NamespaceDeletionStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetNamespaceDeletionStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetNamespaceDeletionStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetNamespaceDeletionStatus{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetNamespaceDeletionStatus(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetNamespaceDeletionStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "GetNamespaceDeletionStatus",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a system instance.
//
// Deprecated: since: 2022-08-30
func (c *Client) GetSystemInstance(ctx context.Context, params *GetSystemInstanceInput, optFns ...func(*Options)) (*GetSystemInstanceOutput, error) {
if params == nil {
params = &GetSystemInstanceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSystemInstance", params, optFns, c.addOperationGetSystemInstanceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSystemInstanceOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSystemInstanceInput struct {
// The ID of the system deployment instance. This value is returned by
// CreateSystemInstance . The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type GetSystemInstanceOutput struct {
// An object that describes the system instance.
Description *types.SystemInstanceDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSystemInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSystemInstance{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSystemInstance{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetSystemInstanceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSystemInstance(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetSystemInstance(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "GetSystemInstance",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a system.
//
// Deprecated: since: 2022-08-30
func (c *Client) GetSystemTemplate(ctx context.Context, params *GetSystemTemplateInput, optFns ...func(*Options)) (*GetSystemTemplateOutput, error) {
if params == nil {
params = &GetSystemTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSystemTemplate", params, optFns, c.addOperationGetSystemTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSystemTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSystemTemplateInput struct {
// The ID of the system to get. This ID must be in the user's namespace. The ID
// should be in the following format. urn:tdm:REGION/ACCOUNT
// ID/default:system:SYSTEMNAME
//
// This member is required.
Id *string
// The number that specifies the revision of the system to get.
RevisionNumber *int64
noSmithyDocumentSerde
}
type GetSystemTemplateOutput struct {
// An object that contains summary data about the system.
Description *types.SystemTemplateDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSystemTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSystemTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSystemTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetSystemTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSystemTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetSystemTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "GetSystemTemplate",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets revisions made to the specified system template. Only the previous 100
// revisions are stored. If the system has been deprecated, this action will return
// the revisions that occurred before its deprecation. This action won't work with
// systems that have been deleted.
//
// Deprecated: since: 2022-08-30
func (c *Client) GetSystemTemplateRevisions(ctx context.Context, params *GetSystemTemplateRevisionsInput, optFns ...func(*Options)) (*GetSystemTemplateRevisionsOutput, error) {
if params == nil {
params = &GetSystemTemplateRevisionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSystemTemplateRevisions", params, optFns, c.addOperationGetSystemTemplateRevisionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSystemTemplateRevisionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSystemTemplateRevisionsInput struct {
// The ID of the system template. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME
//
// This member is required.
Id *string
// The maximum number of results to return in the response.
MaxResults *int32
// The string that specifies the next page of results. Use this when you're
// paginating results.
NextToken *string
noSmithyDocumentSerde
}
type GetSystemTemplateRevisionsOutput struct {
// The string to specify as nextToken when you request the next page of results.
NextToken *string
// An array of objects that contain summary data about the system template
// revisions.
Summaries []types.SystemTemplateSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSystemTemplateRevisionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSystemTemplateRevisions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSystemTemplateRevisions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetSystemTemplateRevisionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSystemTemplateRevisions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// GetSystemTemplateRevisionsAPIClient is a client that implements the
// GetSystemTemplateRevisions operation.
type GetSystemTemplateRevisionsAPIClient interface {
GetSystemTemplateRevisions(context.Context, *GetSystemTemplateRevisionsInput, ...func(*Options)) (*GetSystemTemplateRevisionsOutput, error)
}
var _ GetSystemTemplateRevisionsAPIClient = (*Client)(nil)
// GetSystemTemplateRevisionsPaginatorOptions is the paginator options for
// GetSystemTemplateRevisions
type GetSystemTemplateRevisionsPaginatorOptions struct {
// The maximum number of results to return in the response.
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
}
// GetSystemTemplateRevisionsPaginator is a paginator for
// GetSystemTemplateRevisions
type GetSystemTemplateRevisionsPaginator struct {
options GetSystemTemplateRevisionsPaginatorOptions
client GetSystemTemplateRevisionsAPIClient
params *GetSystemTemplateRevisionsInput
nextToken *string
firstPage bool
}
// NewGetSystemTemplateRevisionsPaginator returns a new
// GetSystemTemplateRevisionsPaginator
func NewGetSystemTemplateRevisionsPaginator(client GetSystemTemplateRevisionsAPIClient, params *GetSystemTemplateRevisionsInput, optFns ...func(*GetSystemTemplateRevisionsPaginatorOptions)) *GetSystemTemplateRevisionsPaginator {
if params == nil {
params = &GetSystemTemplateRevisionsInput{}
}
options := GetSystemTemplateRevisionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetSystemTemplateRevisionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetSystemTemplateRevisionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetSystemTemplateRevisions page.
func (p *GetSystemTemplateRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSystemTemplateRevisionsOutput, 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.GetSystemTemplateRevisions(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_opGetSystemTemplateRevisions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "GetSystemTemplateRevisions",
}
}
| 236 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets the status of the specified upload.
//
// Deprecated: since: 2022-08-30
func (c *Client) GetUploadStatus(ctx context.Context, params *GetUploadStatusInput, optFns ...func(*Options)) (*GetUploadStatusOutput, error) {
if params == nil {
params = &GetUploadStatusInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetUploadStatus", params, optFns, c.addOperationGetUploadStatusMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetUploadStatusOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetUploadStatusInput struct {
// The ID of the upload. This value is returned by the UploadEntityDefinitions
// action.
//
// This member is required.
UploadId *string
noSmithyDocumentSerde
}
type GetUploadStatusOutput struct {
// The date at which the upload was created.
//
// This member is required.
CreatedDate *time.Time
// The ID of the upload.
//
// This member is required.
UploadId *string
// The status of the upload. The initial status is IN_PROGRESS . The response show
// all validation failures if the upload fails.
//
// This member is required.
UploadStatus types.UploadStatus
// The reason for an upload failure.
FailureReason []string
// The ARN of the upload.
NamespaceArn *string
// The name of the upload's namespace.
NamespaceName *string
// The version of the user's namespace. Defaults to the latest version of the
// user's namespace.
NamespaceVersion *int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetUploadStatusMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetUploadStatus{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetUploadStatus{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetUploadStatusValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetUploadStatus(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetUploadStatus(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "GetUploadStatus",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of objects that contain information about events in a flow
// execution.
//
// Deprecated: since: 2022-08-30
func (c *Client) ListFlowExecutionMessages(ctx context.Context, params *ListFlowExecutionMessagesInput, optFns ...func(*Options)) (*ListFlowExecutionMessagesOutput, error) {
if params == nil {
params = &ListFlowExecutionMessagesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListFlowExecutionMessages", params, optFns, c.addOperationListFlowExecutionMessagesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListFlowExecutionMessagesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListFlowExecutionMessagesInput struct {
// The ID of the flow execution.
//
// This member is required.
FlowExecutionId *string
// The maximum number of results to return in the response.
MaxResults *int32
// The string that specifies the next page of results. Use this when you're
// paginating results.
NextToken *string
noSmithyDocumentSerde
}
type ListFlowExecutionMessagesOutput struct {
// A list of objects that contain information about events in the specified flow
// execution.
Messages []types.FlowExecutionMessage
// The string to specify as nextToken when you request the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListFlowExecutionMessagesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListFlowExecutionMessages{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListFlowExecutionMessages{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListFlowExecutionMessagesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFlowExecutionMessages(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListFlowExecutionMessagesAPIClient is a client that implements the
// ListFlowExecutionMessages operation.
type ListFlowExecutionMessagesAPIClient interface {
ListFlowExecutionMessages(context.Context, *ListFlowExecutionMessagesInput, ...func(*Options)) (*ListFlowExecutionMessagesOutput, error)
}
var _ ListFlowExecutionMessagesAPIClient = (*Client)(nil)
// ListFlowExecutionMessagesPaginatorOptions is the paginator options for
// ListFlowExecutionMessages
type ListFlowExecutionMessagesPaginatorOptions struct {
// The maximum number of results to return in the response.
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
}
// ListFlowExecutionMessagesPaginator is a paginator for ListFlowExecutionMessages
type ListFlowExecutionMessagesPaginator struct {
options ListFlowExecutionMessagesPaginatorOptions
client ListFlowExecutionMessagesAPIClient
params *ListFlowExecutionMessagesInput
nextToken *string
firstPage bool
}
// NewListFlowExecutionMessagesPaginator returns a new
// ListFlowExecutionMessagesPaginator
func NewListFlowExecutionMessagesPaginator(client ListFlowExecutionMessagesAPIClient, params *ListFlowExecutionMessagesInput, optFns ...func(*ListFlowExecutionMessagesPaginatorOptions)) *ListFlowExecutionMessagesPaginator {
if params == nil {
params = &ListFlowExecutionMessagesInput{}
}
options := ListFlowExecutionMessagesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListFlowExecutionMessagesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListFlowExecutionMessagesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListFlowExecutionMessages page.
func (p *ListFlowExecutionMessagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowExecutionMessagesOutput, 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.ListFlowExecutionMessages(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_opListFlowExecutionMessages(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "ListFlowExecutionMessages",
}
}
| 232 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all tags on an AWS IoT Things Graph resource.
//
// Deprecated: since: 2022-08-30
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 are to be returned.
//
// This member is required.
ResourceArn *string
// The maximum number of tags to return.
MaxResults *int32
// The token that specifies the next page of results to return.
NextToken *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The token that specifies the next page of results to return.
NextToken *string
// List of tags returned by the ListTagsForResource operation.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTagsForResourceAPIClient is a client that implements the
// ListTagsForResource operation.
type ListTagsForResourceAPIClient interface {
ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error)
}
var _ ListTagsForResourceAPIClient = (*Client)(nil)
// ListTagsForResourcePaginatorOptions is the paginator options for
// ListTagsForResource
type ListTagsForResourcePaginatorOptions struct {
// The maximum number of tags to return.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTagsForResourcePaginator is a paginator for ListTagsForResource
type ListTagsForResourcePaginator struct {
options ListTagsForResourcePaginatorOptions
client ListTagsForResourceAPIClient
params *ListTagsForResourceInput
nextToken *string
firstPage bool
}
// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator
func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator {
if params == nil {
params = &ListTagsForResourceInput{}
}
options := ListTagsForResourcePaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTagsForResourcePaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTagsForResourcePaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTagsForResource page.
func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, 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.ListTagsForResource(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_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "ListTagsForResource",
}
}
| 228 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Searches for entities of the specified type. You can search for entities in
// your namespace and the public namespace that you're tracking.
//
// Deprecated: since: 2022-08-30
func (c *Client) SearchEntities(ctx context.Context, params *SearchEntitiesInput, optFns ...func(*Options)) (*SearchEntitiesOutput, error) {
if params == nil {
params = &SearchEntitiesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchEntities", params, optFns, c.addOperationSearchEntitiesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchEntitiesOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchEntitiesInput struct {
// The entity types for which to search.
//
// This member is required.
EntityTypes []types.EntityType
// Optional filter to apply to the search. Valid filters are NAME NAMESPACE ,
// SEMANTIC_TYPE_PATH and REFERENCED_ENTITY_ID . REFERENCED_ENTITY_ID filters on
// entities that are used by the entity in the result set. For example, you can
// filter on the ID of a property that is used in a state. Multiple filters
// function as OR criteria in the query. Multiple values passed inside the filter
// function as AND criteria.
Filters []types.EntityFilter
// The maximum number of results to return in the response.
MaxResults *int32
// The version of the user's namespace. Defaults to the latest version of the
// user's namespace.
NamespaceVersion *int64
// The string that specifies the next page of results. Use this when you're
// paginating results.
NextToken *string
noSmithyDocumentSerde
}
type SearchEntitiesOutput struct {
// An array of descriptions for each entity returned in the search result.
Descriptions []types.EntityDescription
// The string to specify as nextToken when you request the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchEntitiesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSearchEntities{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSearchEntities{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSearchEntitiesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchEntities(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// SearchEntitiesAPIClient is a client that implements the SearchEntities
// operation.
type SearchEntitiesAPIClient interface {
SearchEntities(context.Context, *SearchEntitiesInput, ...func(*Options)) (*SearchEntitiesOutput, error)
}
var _ SearchEntitiesAPIClient = (*Client)(nil)
// SearchEntitiesPaginatorOptions is the paginator options for SearchEntities
type SearchEntitiesPaginatorOptions struct {
// The maximum number of results to return in the response.
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
}
// SearchEntitiesPaginator is a paginator for SearchEntities
type SearchEntitiesPaginator struct {
options SearchEntitiesPaginatorOptions
client SearchEntitiesAPIClient
params *SearchEntitiesInput
nextToken *string
firstPage bool
}
// NewSearchEntitiesPaginator returns a new SearchEntitiesPaginator
func NewSearchEntitiesPaginator(client SearchEntitiesAPIClient, params *SearchEntitiesInput, optFns ...func(*SearchEntitiesPaginatorOptions)) *SearchEntitiesPaginator {
if params == nil {
params = &SearchEntitiesInput{}
}
options := SearchEntitiesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &SearchEntitiesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *SearchEntitiesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next SearchEntities page.
func (p *SearchEntitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchEntitiesOutput, 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.SearchEntities(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_opSearchEntities(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "SearchEntities",
}
}
| 241 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Searches for AWS IoT Things Graph workflow execution instances.
//
// Deprecated: since: 2022-08-30
func (c *Client) SearchFlowExecutions(ctx context.Context, params *SearchFlowExecutionsInput, optFns ...func(*Options)) (*SearchFlowExecutionsOutput, error) {
if params == nil {
params = &SearchFlowExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchFlowExecutions", params, optFns, c.addOperationSearchFlowExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchFlowExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchFlowExecutionsInput struct {
// The ID of the system instance that contains the flow.
//
// This member is required.
SystemInstanceId *string
// The date and time of the latest flow execution to return.
EndTime *time.Time
// The ID of a flow execution.
FlowExecutionId *string
// The maximum number of results to return in the response.
MaxResults *int32
// The string that specifies the next page of results. Use this when you're
// paginating results.
NextToken *string
// The date and time of the earliest flow execution to return.
StartTime *time.Time
noSmithyDocumentSerde
}
type SearchFlowExecutionsOutput struct {
// The string to specify as nextToken when you request the next page of results.
NextToken *string
// An array of objects that contain summary information about each workflow
// execution in the result set.
Summaries []types.FlowExecutionSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchFlowExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSearchFlowExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSearchFlowExecutions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSearchFlowExecutionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchFlowExecutions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// SearchFlowExecutionsAPIClient is a client that implements the
// SearchFlowExecutions operation.
type SearchFlowExecutionsAPIClient interface {
SearchFlowExecutions(context.Context, *SearchFlowExecutionsInput, ...func(*Options)) (*SearchFlowExecutionsOutput, error)
}
var _ SearchFlowExecutionsAPIClient = (*Client)(nil)
// SearchFlowExecutionsPaginatorOptions is the paginator options for
// SearchFlowExecutions
type SearchFlowExecutionsPaginatorOptions struct {
// The maximum number of results to return in the response.
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
}
// SearchFlowExecutionsPaginator is a paginator for SearchFlowExecutions
type SearchFlowExecutionsPaginator struct {
options SearchFlowExecutionsPaginatorOptions
client SearchFlowExecutionsAPIClient
params *SearchFlowExecutionsInput
nextToken *string
firstPage bool
}
// NewSearchFlowExecutionsPaginator returns a new SearchFlowExecutionsPaginator
func NewSearchFlowExecutionsPaginator(client SearchFlowExecutionsAPIClient, params *SearchFlowExecutionsInput, optFns ...func(*SearchFlowExecutionsPaginatorOptions)) *SearchFlowExecutionsPaginator {
if params == nil {
params = &SearchFlowExecutionsInput{}
}
options := SearchFlowExecutionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &SearchFlowExecutionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *SearchFlowExecutionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next SearchFlowExecutions page.
func (p *SearchFlowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchFlowExecutionsOutput, 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.SearchFlowExecutions(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_opSearchFlowExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "SearchFlowExecutions",
}
}
| 240 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Searches for summary information about workflows.
//
// Deprecated: since: 2022-08-30
func (c *Client) SearchFlowTemplates(ctx context.Context, params *SearchFlowTemplatesInput, optFns ...func(*Options)) (*SearchFlowTemplatesOutput, error) {
if params == nil {
params = &SearchFlowTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchFlowTemplates", params, optFns, c.addOperationSearchFlowTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchFlowTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchFlowTemplatesInput struct {
// An array of objects that limit the result set. The only valid filter is
// DEVICE_MODEL_ID .
Filters []types.FlowTemplateFilter
// The maximum number of results to return in the response.
MaxResults *int32
// The string that specifies the next page of results. Use this when you're
// paginating results.
NextToken *string
noSmithyDocumentSerde
}
type SearchFlowTemplatesOutput struct {
// The string to specify as nextToken when you request the next page of results.
NextToken *string
// An array of objects that contain summary information about each workflow in the
// result set.
Summaries []types.FlowTemplateSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchFlowTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSearchFlowTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSearchFlowTemplates{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSearchFlowTemplatesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchFlowTemplates(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// SearchFlowTemplatesAPIClient is a client that implements the
// SearchFlowTemplates operation.
type SearchFlowTemplatesAPIClient interface {
SearchFlowTemplates(context.Context, *SearchFlowTemplatesInput, ...func(*Options)) (*SearchFlowTemplatesOutput, error)
}
var _ SearchFlowTemplatesAPIClient = (*Client)(nil)
// SearchFlowTemplatesPaginatorOptions is the paginator options for
// SearchFlowTemplates
type SearchFlowTemplatesPaginatorOptions struct {
// The maximum number of results to return in the response.
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
}
// SearchFlowTemplatesPaginator is a paginator for SearchFlowTemplates
type SearchFlowTemplatesPaginator struct {
options SearchFlowTemplatesPaginatorOptions
client SearchFlowTemplatesAPIClient
params *SearchFlowTemplatesInput
nextToken *string
firstPage bool
}
// NewSearchFlowTemplatesPaginator returns a new SearchFlowTemplatesPaginator
func NewSearchFlowTemplatesPaginator(client SearchFlowTemplatesAPIClient, params *SearchFlowTemplatesInput, optFns ...func(*SearchFlowTemplatesPaginatorOptions)) *SearchFlowTemplatesPaginator {
if params == nil {
params = &SearchFlowTemplatesInput{}
}
options := SearchFlowTemplatesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &SearchFlowTemplatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *SearchFlowTemplatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next SearchFlowTemplates page.
func (p *SearchFlowTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchFlowTemplatesOutput, 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.SearchFlowTemplates(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_opSearchFlowTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "SearchFlowTemplates",
}
}
| 229 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Searches for system instances in the user's account.
//
// Deprecated: since: 2022-08-30
func (c *Client) SearchSystemInstances(ctx context.Context, params *SearchSystemInstancesInput, optFns ...func(*Options)) (*SearchSystemInstancesOutput, error) {
if params == nil {
params = &SearchSystemInstancesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchSystemInstances", params, optFns, c.addOperationSearchSystemInstancesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchSystemInstancesOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchSystemInstancesInput struct {
// Optional filter to apply to the search. Valid filters are SYSTEM_TEMPLATE_ID ,
// STATUS , and GREENGRASS_GROUP_NAME . Multiple filters function as OR criteria in
// the query. Multiple values passed inside the filter function as AND criteria.
Filters []types.SystemInstanceFilter
// The maximum number of results to return in the response.
MaxResults *int32
// The string that specifies the next page of results. Use this when you're
// paginating results.
NextToken *string
noSmithyDocumentSerde
}
type SearchSystemInstancesOutput struct {
// The string to specify as nextToken when you request the next page of results.
NextToken *string
// An array of objects that contain summary data abour the system instances in the
// result set.
Summaries []types.SystemInstanceSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchSystemInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSearchSystemInstances{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSearchSystemInstances{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchSystemInstances(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// SearchSystemInstancesAPIClient is a client that implements the
// SearchSystemInstances operation.
type SearchSystemInstancesAPIClient interface {
SearchSystemInstances(context.Context, *SearchSystemInstancesInput, ...func(*Options)) (*SearchSystemInstancesOutput, error)
}
var _ SearchSystemInstancesAPIClient = (*Client)(nil)
// SearchSystemInstancesPaginatorOptions is the paginator options for
// SearchSystemInstances
type SearchSystemInstancesPaginatorOptions struct {
// The maximum number of results to return in the response.
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
}
// SearchSystemInstancesPaginator is a paginator for SearchSystemInstances
type SearchSystemInstancesPaginator struct {
options SearchSystemInstancesPaginatorOptions
client SearchSystemInstancesAPIClient
params *SearchSystemInstancesInput
nextToken *string
firstPage bool
}
// NewSearchSystemInstancesPaginator returns a new SearchSystemInstancesPaginator
func NewSearchSystemInstancesPaginator(client SearchSystemInstancesAPIClient, params *SearchSystemInstancesInput, optFns ...func(*SearchSystemInstancesPaginatorOptions)) *SearchSystemInstancesPaginator {
if params == nil {
params = &SearchSystemInstancesInput{}
}
options := SearchSystemInstancesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &SearchSystemInstancesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *SearchSystemInstancesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next SearchSystemInstances page.
func (p *SearchSystemInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSystemInstancesOutput, 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.SearchSystemInstances(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_opSearchSystemInstances(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "SearchSystemInstances",
}
}
| 227 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Searches for summary information about systems in the user's account. You can
// filter by the ID of a workflow to return only systems that use the specified
// workflow.
//
// Deprecated: since: 2022-08-30
func (c *Client) SearchSystemTemplates(ctx context.Context, params *SearchSystemTemplatesInput, optFns ...func(*Options)) (*SearchSystemTemplatesOutput, error) {
if params == nil {
params = &SearchSystemTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchSystemTemplates", params, optFns, c.addOperationSearchSystemTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchSystemTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchSystemTemplatesInput struct {
// An array of filters that limit the result set. The only valid filter is
// FLOW_TEMPLATE_ID .
Filters []types.SystemTemplateFilter
// The maximum number of results to return in the response.
MaxResults *int32
// The string that specifies the next page of results. Use this when you're
// paginating results.
NextToken *string
noSmithyDocumentSerde
}
type SearchSystemTemplatesOutput struct {
// The string to specify as nextToken when you request the next page of results.
NextToken *string
// An array of objects that contain summary information about each system
// deployment in the result set.
Summaries []types.SystemTemplateSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchSystemTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSearchSystemTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSearchSystemTemplates{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSearchSystemTemplatesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchSystemTemplates(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// SearchSystemTemplatesAPIClient is a client that implements the
// SearchSystemTemplates operation.
type SearchSystemTemplatesAPIClient interface {
SearchSystemTemplates(context.Context, *SearchSystemTemplatesInput, ...func(*Options)) (*SearchSystemTemplatesOutput, error)
}
var _ SearchSystemTemplatesAPIClient = (*Client)(nil)
// SearchSystemTemplatesPaginatorOptions is the paginator options for
// SearchSystemTemplates
type SearchSystemTemplatesPaginatorOptions struct {
// The maximum number of results to return in the response.
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
}
// SearchSystemTemplatesPaginator is a paginator for SearchSystemTemplates
type SearchSystemTemplatesPaginator struct {
options SearchSystemTemplatesPaginatorOptions
client SearchSystemTemplatesAPIClient
params *SearchSystemTemplatesInput
nextToken *string
firstPage bool
}
// NewSearchSystemTemplatesPaginator returns a new SearchSystemTemplatesPaginator
func NewSearchSystemTemplatesPaginator(client SearchSystemTemplatesAPIClient, params *SearchSystemTemplatesInput, optFns ...func(*SearchSystemTemplatesPaginatorOptions)) *SearchSystemTemplatesPaginator {
if params == nil {
params = &SearchSystemTemplatesInput{}
}
options := SearchSystemTemplatesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &SearchSystemTemplatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *SearchSystemTemplatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next SearchSystemTemplates page.
func (p *SearchSystemTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSystemTemplatesOutput, 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.SearchSystemTemplates(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_opSearchSystemTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "SearchSystemTemplates",
}
}
| 231 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Searches for things associated with the specified entity. You can search by
// both device and device model. For example, if two different devices, camera1 and
// camera2, implement the camera device model, the user can associate thing1 to
// camera1 and thing2 to camera2. SearchThings(camera2) will return only thing2,
// but SearchThings(camera) will return both thing1 and thing2. This action
// searches for exact matches and doesn't perform partial text matching.
//
// Deprecated: since: 2022-08-30
func (c *Client) SearchThings(ctx context.Context, params *SearchThingsInput, optFns ...func(*Options)) (*SearchThingsOutput, error) {
if params == nil {
params = &SearchThingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SearchThings", params, optFns, c.addOperationSearchThingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SearchThingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type SearchThingsInput struct {
// The ID of the entity to which the things are associated. The IDs should be in
// the following format. urn:tdm:REGION/ACCOUNT ID/default:device:DEVICENAME
//
// This member is required.
EntityId *string
// The maximum number of results to return in the response.
MaxResults *int32
// The version of the user's namespace. Defaults to the latest version of the
// user's namespace.
NamespaceVersion *int64
// The string that specifies the next page of results. Use this when you're
// paginating results.
NextToken *string
noSmithyDocumentSerde
}
type SearchThingsOutput struct {
// The string to specify as nextToken when you request the next page of results.
NextToken *string
// An array of things in the result set.
Things []types.Thing
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSearchThingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSearchThings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSearchThings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSearchThingsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchThings(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// SearchThingsAPIClient is a client that implements the SearchThings operation.
type SearchThingsAPIClient interface {
SearchThings(context.Context, *SearchThingsInput, ...func(*Options)) (*SearchThingsOutput, error)
}
var _ SearchThingsAPIClient = (*Client)(nil)
// SearchThingsPaginatorOptions is the paginator options for SearchThings
type SearchThingsPaginatorOptions struct {
// The maximum number of results to return in the response.
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
}
// SearchThingsPaginator is a paginator for SearchThings
type SearchThingsPaginator struct {
options SearchThingsPaginatorOptions
client SearchThingsAPIClient
params *SearchThingsInput
nextToken *string
firstPage bool
}
// NewSearchThingsPaginator returns a new SearchThingsPaginator
func NewSearchThingsPaginator(client SearchThingsAPIClient, params *SearchThingsInput, optFns ...func(*SearchThingsPaginatorOptions)) *SearchThingsPaginator {
if params == nil {
params = &SearchThingsInput{}
}
options := SearchThingsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &SearchThingsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *SearchThingsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next SearchThings page.
func (p *SearchThingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchThingsOutput, 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.SearchThings(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_opSearchThings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "SearchThings",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a tag for the specified resource.
//
// Deprecated: since: 2022-08-30
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 are returned.
//
// This member is required.
ResourceArn *string
// A list of tags to add to the resource.>
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "TagResource",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a system instance from its target (Cloud or Greengrass).
//
// Deprecated: since: 2022-08-30
func (c *Client) UndeploySystemInstance(ctx context.Context, params *UndeploySystemInstanceInput, optFns ...func(*Options)) (*UndeploySystemInstanceOutput, error) {
if params == nil {
params = &UndeploySystemInstanceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UndeploySystemInstance", params, optFns, c.addOperationUndeploySystemInstanceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UndeploySystemInstanceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UndeploySystemInstanceInput struct {
// The ID of the system instance to remove from its target.
Id *string
noSmithyDocumentSerde
}
type UndeploySystemInstanceOutput struct {
// An object that contains summary information about the system instance that was
// removed from its target.
Summary *types.SystemInstanceSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUndeploySystemInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUndeploySystemInstance{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUndeploySystemInstance{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUndeploySystemInstance(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUndeploySystemInstance(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "UndeploySystemInstance",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a tag from the specified resource.
//
// Deprecated: since: 2022-08-30
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 whose tags are to be removed.
//
// This member is required.
ResourceArn *string
// A list of tag key names to remove from the resource. You don't specify the
// value. Both the key and its associated value are removed. This parameter to the
// API requires a JSON text string argument. For information on how to format a
// JSON parameter for the various command line tool environments, see Using JSON
// for Parameters (https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html#cli-using-param-json)
// in the AWS CLI User Guide.
//
// 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(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "UntagResource",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified workflow. All deployed systems and system instances that
// use the workflow will see the changes in the flow when it is redeployed. If you
// don't want this behavior, copy the workflow (creating a new workflow with a
// different ID), and update the copy. The workflow can contain only entities in
// the specified namespace.
//
// Deprecated: since: 2022-08-30
func (c *Client) UpdateFlowTemplate(ctx context.Context, params *UpdateFlowTemplateInput, optFns ...func(*Options)) (*UpdateFlowTemplateOutput, error) {
if params == nil {
params = &UpdateFlowTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateFlowTemplate", params, optFns, c.addOperationUpdateFlowTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateFlowTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateFlowTemplateInput struct {
// The DefinitionDocument that contains the updated workflow definition.
//
// This member is required.
Definition *types.DefinitionDocument
// The ID of the workflow to be updated. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:workflow:WORKFLOWNAME
//
// This member is required.
Id *string
// The version of the user's namespace. If no value is specified, the latest
// version is used by default. Use the GetFlowTemplateRevisions if you want to
// find earlier revisions of the flow to update.
CompatibleNamespaceVersion *int64
noSmithyDocumentSerde
}
type UpdateFlowTemplateOutput struct {
// An object containing summary information about the updated workflow.
Summary *types.FlowTemplateSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateFlowTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateFlowTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateFlowTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateFlowTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFlowTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateFlowTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "UpdateFlowTemplate",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified system. You don't need to run this action after updating
// a workflow. Any deployment that uses the system will see the changes in the
// system when it is redeployed.
//
// Deprecated: since: 2022-08-30
func (c *Client) UpdateSystemTemplate(ctx context.Context, params *UpdateSystemTemplateInput, optFns ...func(*Options)) (*UpdateSystemTemplateOutput, error) {
if params == nil {
params = &UpdateSystemTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSystemTemplate", params, optFns, c.addOperationUpdateSystemTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSystemTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSystemTemplateInput struct {
// The DefinitionDocument that contains the updated system definition.
//
// This member is required.
Definition *types.DefinitionDocument
// The ID of the system to be updated. The ID should be in the following format.
// urn:tdm:REGION/ACCOUNT ID/default:system:SYSTEMNAME
//
// This member is required.
Id *string
// The version of the user's namespace. Defaults to the latest version of the
// user's namespace. If no value is specified, the latest version is used by
// default.
CompatibleNamespaceVersion *int64
noSmithyDocumentSerde
}
type UpdateSystemTemplateOutput struct {
// An object containing summary information about the updated system.
Summary *types.SystemTemplateSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSystemTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSystemTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSystemTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSystemTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSystemTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateSystemTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "UpdateSystemTemplate",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Asynchronously uploads one or more entity definitions to the user's namespace.
// The document parameter is required if syncWithPublicNamespace and
// deleteExistingEntites are false. If the syncWithPublicNamespace parameter is
// set to true , the user's namespace will synchronize with the latest version of
// the public namespace. If deprecateExistingEntities is set to true, all entities
// in the latest version will be deleted before the new DefinitionDocument is
// uploaded. When a user uploads entity definitions for the first time, the service
// creates a new namespace for the user. The new namespace tracks the public
// namespace. Currently users can have only one namespace. The namespace version
// increments whenever a user uploads entity definitions that are
// backwards-incompatible and whenever a user sets the syncWithPublicNamespace
// parameter or the deprecateExistingEntities parameter to true . The IDs for all
// of the entities should be in URN format. Each entity must be in the user's
// namespace. Users can't create entities in the public namespace, but entity
// definitions can refer to entities in the public namespace. Valid entities are
// Device , DeviceModel , Service , Capability , State , Action , Event , Property
// , Mapping , Enum .
//
// Deprecated: since: 2022-08-30
func (c *Client) UploadEntityDefinitions(ctx context.Context, params *UploadEntityDefinitionsInput, optFns ...func(*Options)) (*UploadEntityDefinitionsOutput, error) {
if params == nil {
params = &UploadEntityDefinitionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UploadEntityDefinitions", params, optFns, c.addOperationUploadEntityDefinitionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UploadEntityDefinitionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type UploadEntityDefinitionsInput struct {
// A Boolean that specifies whether to deprecate all entities in the latest
// version before uploading the new DefinitionDocument . If set to true , the
// upload will create a new namespace version.
DeprecateExistingEntities bool
// The DefinitionDocument that defines the updated entities.
Document *types.DefinitionDocument
// A Boolean that specifies whether to synchronize with the latest version of the
// public namespace. If set to true , the upload will create a new namespace
// version.
SyncWithPublicNamespace bool
noSmithyDocumentSerde
}
type UploadEntityDefinitionsOutput struct {
// The ID that specifies the upload action. You can use this to track the status
// of the upload.
//
// This member is required.
UploadId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUploadEntityDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUploadEntityDefinitions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUploadEntityDefinitions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUploadEntityDefinitionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUploadEntityDefinitions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUploadEntityDefinitions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "iotthingsgraph",
OperationName: "UploadEntityDefinitions",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsAwsjson11_deserializeOpAssociateEntityToThing struct {
}
func (*awsAwsjson11_deserializeOpAssociateEntityToThing) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAssociateEntityToThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorAssociateEntityToThing(response, &metadata)
}
output := &AssociateEntityToThingOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentAssociateEntityToThingOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorAssociateEntityToThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateFlowTemplate struct {
}
func (*awsAwsjson11_deserializeOpCreateFlowTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateFlowTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateFlowTemplate(response, &metadata)
}
output := &CreateFlowTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateFlowTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateFlowTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateSystemInstance struct {
}
func (*awsAwsjson11_deserializeOpCreateSystemInstance) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateSystemInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateSystemInstance(response, &metadata)
}
output := &CreateSystemInstanceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateSystemInstanceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateSystemInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateSystemTemplate struct {
}
func (*awsAwsjson11_deserializeOpCreateSystemTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateSystemTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorCreateSystemTemplate(response, &metadata)
}
output := &CreateSystemTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentCreateSystemTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateSystemTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteFlowTemplate struct {
}
func (*awsAwsjson11_deserializeOpDeleteFlowTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteFlowTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteFlowTemplate(response, &metadata)
}
output := &DeleteFlowTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteFlowTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteFlowTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteNamespace struct {
}
func (*awsAwsjson11_deserializeOpDeleteNamespace) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteNamespace(response, &metadata)
}
output := &DeleteNamespaceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteNamespaceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteSystemInstance struct {
}
func (*awsAwsjson11_deserializeOpDeleteSystemInstance) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteSystemInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteSystemInstance(response, &metadata)
}
output := &DeleteSystemInstanceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteSystemInstanceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteSystemInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteSystemTemplate struct {
}
func (*awsAwsjson11_deserializeOpDeleteSystemTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteSystemTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeleteSystemTemplate(response, &metadata)
}
output := &DeleteSystemTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeleteSystemTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteSystemTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeploySystemInstance struct {
}
func (*awsAwsjson11_deserializeOpDeploySystemInstance) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeploySystemInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeploySystemInstance(response, &metadata)
}
output := &DeploySystemInstanceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeploySystemInstanceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeploySystemInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeprecateFlowTemplate struct {
}
func (*awsAwsjson11_deserializeOpDeprecateFlowTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeprecateFlowTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeprecateFlowTemplate(response, &metadata)
}
output := &DeprecateFlowTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeprecateFlowTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeprecateFlowTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeprecateSystemTemplate struct {
}
func (*awsAwsjson11_deserializeOpDeprecateSystemTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeprecateSystemTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDeprecateSystemTemplate(response, &metadata)
}
output := &DeprecateSystemTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDeprecateSystemTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeprecateSystemTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeNamespace struct {
}
func (*awsAwsjson11_deserializeOpDescribeNamespace) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDescribeNamespace(response, &metadata)
}
output := &DescribeNamespaceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDescribeNamespaceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDescribeNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDissociateEntityFromThing struct {
}
func (*awsAwsjson11_deserializeOpDissociateEntityFromThing) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDissociateEntityFromThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorDissociateEntityFromThing(response, &metadata)
}
output := &DissociateEntityFromThingOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentDissociateEntityFromThingOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDissociateEntityFromThing(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetEntities struct {
}
func (*awsAwsjson11_deserializeOpGetEntities) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetEntities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetEntities(response, &metadata)
}
output := &GetEntitiesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetEntitiesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetEntities(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetFlowTemplate struct {
}
func (*awsAwsjson11_deserializeOpGetFlowTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetFlowTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetFlowTemplate(response, &metadata)
}
output := &GetFlowTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetFlowTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetFlowTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetFlowTemplateRevisions struct {
}
func (*awsAwsjson11_deserializeOpGetFlowTemplateRevisions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetFlowTemplateRevisions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetFlowTemplateRevisions(response, &metadata)
}
output := &GetFlowTemplateRevisionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetFlowTemplateRevisionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetFlowTemplateRevisions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetNamespaceDeletionStatus struct {
}
func (*awsAwsjson11_deserializeOpGetNamespaceDeletionStatus) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetNamespaceDeletionStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetNamespaceDeletionStatus(response, &metadata)
}
output := &GetNamespaceDeletionStatusOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetNamespaceDeletionStatusOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetNamespaceDeletionStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetSystemInstance struct {
}
func (*awsAwsjson11_deserializeOpGetSystemInstance) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetSystemInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetSystemInstance(response, &metadata)
}
output := &GetSystemInstanceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetSystemInstanceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetSystemInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetSystemTemplate struct {
}
func (*awsAwsjson11_deserializeOpGetSystemTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetSystemTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetSystemTemplate(response, &metadata)
}
output := &GetSystemTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetSystemTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetSystemTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetSystemTemplateRevisions struct {
}
func (*awsAwsjson11_deserializeOpGetSystemTemplateRevisions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetSystemTemplateRevisions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetSystemTemplateRevisions(response, &metadata)
}
output := &GetSystemTemplateRevisionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetSystemTemplateRevisionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetSystemTemplateRevisions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetUploadStatus struct {
}
func (*awsAwsjson11_deserializeOpGetUploadStatus) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetUploadStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorGetUploadStatus(response, &metadata)
}
output := &GetUploadStatusOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentGetUploadStatusOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorGetUploadStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListFlowExecutionMessages struct {
}
func (*awsAwsjson11_deserializeOpListFlowExecutionMessages) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListFlowExecutionMessages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListFlowExecutionMessages(response, &metadata)
}
output := &ListFlowExecutionMessagesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListFlowExecutionMessagesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListFlowExecutionMessages(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_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, awsAwsjson11_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 = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_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("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSearchEntities struct {
}
func (*awsAwsjson11_deserializeOpSearchEntities) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSearchEntities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorSearchEntities(response, &metadata)
}
output := &SearchEntitiesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentSearchEntitiesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSearchEntities(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSearchFlowExecutions struct {
}
func (*awsAwsjson11_deserializeOpSearchFlowExecutions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSearchFlowExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorSearchFlowExecutions(response, &metadata)
}
output := &SearchFlowExecutionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentSearchFlowExecutionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSearchFlowExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSearchFlowTemplates struct {
}
func (*awsAwsjson11_deserializeOpSearchFlowTemplates) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSearchFlowTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorSearchFlowTemplates(response, &metadata)
}
output := &SearchFlowTemplatesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentSearchFlowTemplatesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSearchFlowTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSearchSystemInstances struct {
}
func (*awsAwsjson11_deserializeOpSearchSystemInstances) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSearchSystemInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorSearchSystemInstances(response, &metadata)
}
output := &SearchSystemInstancesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentSearchSystemInstancesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSearchSystemInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSearchSystemTemplates struct {
}
func (*awsAwsjson11_deserializeOpSearchSystemTemplates) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSearchSystemTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorSearchSystemTemplates(response, &metadata)
}
output := &SearchSystemTemplatesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentSearchSystemTemplatesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSearchSystemTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSearchThings struct {
}
func (*awsAwsjson11_deserializeOpSearchThings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSearchThings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorSearchThings(response, &metadata)
}
output := &SearchThingsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentSearchThingsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSearchThings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTagResource struct {
}
func (*awsAwsjson11_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_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, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_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("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUndeploySystemInstance struct {
}
func (*awsAwsjson11_deserializeOpUndeploySystemInstance) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUndeploySystemInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUndeploySystemInstance(response, &metadata)
}
output := &UndeploySystemInstanceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUndeploySystemInstanceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUndeploySystemInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUntagResource struct {
}
func (*awsAwsjson11_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_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, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_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("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceAlreadyExistsException", errorCode):
return awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateFlowTemplate struct {
}
func (*awsAwsjson11_deserializeOpUpdateFlowTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateFlowTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateFlowTemplate(response, &metadata)
}
output := &UpdateFlowTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateFlowTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateFlowTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateSystemTemplate struct {
}
func (*awsAwsjson11_deserializeOpUpdateSystemTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateSystemTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUpdateSystemTemplate(response, &metadata)
}
output := &UpdateSystemTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUpdateSystemTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateSystemTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUploadEntityDefinitions struct {
}
func (*awsAwsjson11_deserializeOpUploadEntityDefinitions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUploadEntityDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUploadEntityDefinitions(response, &metadata)
}
output := &UploadEntityDefinitionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUploadEntityDefinitionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUploadEntityDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalFailureException", errorCode):
return awsAwsjson11_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.InternalFailureException{}
err := awsAwsjson11_deserializeDocumentInternalFailureException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.InvalidRequestException{}
err := awsAwsjson11_deserializeDocumentInvalidRequestException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.LimitExceededException{}
err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ResourceAlreadyExistsException{}
err := awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ResourceInUseException{}
err := awsAwsjson11_deserializeDocumentResourceInUseException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ResourceNotFoundException{}
err := awsAwsjson11_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 awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.ThrottlingException{}
err := awsAwsjson11_deserializeDocumentThrottlingException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeDocumentDefinitionDocument(v **types.DefinitionDocument, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DefinitionDocument
if *v == nil {
sv = &types.DefinitionDocument{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "language":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DefinitionLanguage to be of type string, got %T instead", value)
}
sv.Language = types.DefinitionLanguage(jtv)
}
case "text":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DefinitionText to be of type string, got %T instead", value)
}
sv.Text = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDependencyRevision(v **types.DependencyRevision, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DependencyRevision
if *v == nil {
sv = &types.DependencyRevision{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Urn to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "revisionNumber":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RevisionNumber = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDependencyRevisions(v *[]types.DependencyRevision, 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.DependencyRevision
if *v == nil {
cv = []types.DependencyRevision{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DependencyRevision
destAddr := &col
if err := awsAwsjson11_deserializeDocumentDependencyRevision(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentEntityDescription(v **types.EntityDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.EntityDescription
if *v == nil {
sv = &types.EntityDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "definition":
if err := awsAwsjson11_deserializeDocumentDefinitionDocument(&sv.Definition, value); err != nil {
return err
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Urn to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntityType to be of type string, got %T instead", value)
}
sv.Type = types.EntityType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEntityDescriptions(v *[]types.EntityDescription, 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.EntityDescription
if *v == nil {
cv = []types.EntityDescription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EntityDescription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentEntityDescription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFlowExecutionMessage(v **types.FlowExecutionMessage, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.FlowExecutionMessage
if *v == nil {
sv = &types.FlowExecutionMessage{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "eventType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FlowExecutionEventType to be of type string, got %T instead", value)
}
sv.EventType = types.FlowExecutionEventType(jtv)
}
case "messageId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FlowExecutionMessageId to be of type string, got %T instead", value)
}
sv.MessageId = ptr.String(jtv)
}
case "payload":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FlowExecutionMessagePayload to be of type string, got %T instead", value)
}
sv.Payload = ptr.String(jtv)
}
case "timestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Timestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFlowExecutionMessages(v *[]types.FlowExecutionMessage, 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.FlowExecutionMessage
if *v == nil {
cv = []types.FlowExecutionMessage{}
} else {
cv = *v
}
for _, value := range shape {
var col types.FlowExecutionMessage
destAddr := &col
if err := awsAwsjson11_deserializeDocumentFlowExecutionMessage(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFlowExecutionSummaries(v *[]types.FlowExecutionSummary, 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.FlowExecutionSummary
if *v == nil {
cv = []types.FlowExecutionSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.FlowExecutionSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentFlowExecutionSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFlowExecutionSummary(v **types.FlowExecutionSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.FlowExecutionSummary
if *v == nil {
sv = &types.FlowExecutionSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "flowExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FlowExecutionId to be of type string, got %T instead", value)
}
sv.FlowExecutionId = ptr.String(jtv)
}
case "flowTemplateId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Urn to be of type string, got %T instead", value)
}
sv.FlowTemplateId = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FlowExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.FlowExecutionStatus(jtv)
}
case "systemInstanceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Urn to be of type string, got %T instead", value)
}
sv.SystemInstanceId = ptr.String(jtv)
}
case "updatedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFlowTemplateDescription(v **types.FlowTemplateDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.FlowTemplateDescription
if *v == nil {
sv = &types.FlowTemplateDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "definition":
if err := awsAwsjson11_deserializeDocumentDefinitionDocument(&sv.Definition, value); err != nil {
return err
}
case "summary":
if err := awsAwsjson11_deserializeDocumentFlowTemplateSummary(&sv.Summary, value); err != nil {
return err
}
case "validatedNamespaceVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ValidatedNamespaceVersion = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFlowTemplateSummaries(v *[]types.FlowTemplateSummary, 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.FlowTemplateSummary
if *v == nil {
cv = []types.FlowTemplateSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.FlowTemplateSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentFlowTemplateSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentFlowTemplateSummary(v **types.FlowTemplateSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.FlowTemplateSummary
if *v == nil {
sv = &types.FlowTemplateSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Urn to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "revisionNumber":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RevisionNumber = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalFailureException
if *v == nil {
sv = &types.InternalFailureException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.InvalidRequestException
if *v == nil {
sv = &types.InvalidRequestException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LimitExceededException
if *v == nil {
sv = &types.LimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMetricsConfiguration(v **types.MetricsConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.MetricsConfiguration
if *v == nil {
sv = &types.MetricsConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "cloudMetricEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.CloudMetricEnabled = jtv
}
case "metricRuleRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.MetricRuleRoleArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ResourceAlreadyExistsException
if *v == nil {
sv = &types.ResourceAlreadyExistsException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceInUseException
if *v == nil {
sv = &types.ResourceInUseException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStringList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSystemInstanceDescription(v **types.SystemInstanceDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SystemInstanceDescription
if *v == nil {
sv = &types.SystemInstanceDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "definition":
if err := awsAwsjson11_deserializeDocumentDefinitionDocument(&sv.Definition, value); err != nil {
return err
}
case "flowActionsRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.FlowActionsRoleArn = ptr.String(jtv)
}
case "metricsConfiguration":
if err := awsAwsjson11_deserializeDocumentMetricsConfiguration(&sv.MetricsConfiguration, value); err != nil {
return err
}
case "s3BucketName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value)
}
sv.S3BucketName = ptr.String(jtv)
}
case "summary":
if err := awsAwsjson11_deserializeDocumentSystemInstanceSummary(&sv.Summary, value); err != nil {
return err
}
case "validatedDependencyRevisions":
if err := awsAwsjson11_deserializeDocumentDependencyRevisions(&sv.ValidatedDependencyRevisions, value); err != nil {
return err
}
case "validatedNamespaceVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ValidatedNamespaceVersion = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSystemInstanceSummaries(v *[]types.SystemInstanceSummary, 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.SystemInstanceSummary
if *v == nil {
cv = []types.SystemInstanceSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SystemInstanceSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSystemInstanceSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSystemInstanceSummary(v **types.SystemInstanceSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SystemInstanceSummary
if *v == nil {
sv = &types.SystemInstanceSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "greengrassGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GreengrassGroupId to be of type string, got %T instead", value)
}
sv.GreengrassGroupId = ptr.String(jtv)
}
case "greengrassGroupName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GroupName to be of type string, got %T instead", value)
}
sv.GreengrassGroupName = ptr.String(jtv)
}
case "greengrassGroupVersionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GreengrassGroupVersionId to be of type string, got %T instead", value)
}
sv.GreengrassGroupVersionId = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Urn to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SystemInstanceDeploymentStatus to be of type string, got %T instead", value)
}
sv.Status = types.SystemInstanceDeploymentStatus(jtv)
}
case "target":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeploymentTarget to be of type string, got %T instead", value)
}
sv.Target = types.DeploymentTarget(jtv)
}
case "updatedAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSystemTemplateDescription(v **types.SystemTemplateDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SystemTemplateDescription
if *v == nil {
sv = &types.SystemTemplateDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "definition":
if err := awsAwsjson11_deserializeDocumentDefinitionDocument(&sv.Definition, value); err != nil {
return err
}
case "summary":
if err := awsAwsjson11_deserializeDocumentSystemTemplateSummary(&sv.Summary, value); err != nil {
return err
}
case "validatedNamespaceVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ValidatedNamespaceVersion = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSystemTemplateSummaries(v *[]types.SystemTemplateSummary, 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.SystemTemplateSummary
if *v == nil {
cv = []types.SystemTemplateSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SystemTemplateSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSystemTemplateSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSystemTemplateSummary(v **types.SystemTemplateSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SystemTemplateSummary
if *v == nil {
sv = &types.SystemTemplateSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "createdAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Urn to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "revisionNumber":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RevisionNumber = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentThing(v **types.Thing, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Thing
if *v == nil {
sv = &types.Thing{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "thingArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ThingArn to be of type string, got %T instead", value)
}
sv.ThingArn = ptr.String(jtv)
}
case "thingName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ThingName to be of type string, got %T instead", value)
}
sv.ThingName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentThings(v *[]types.Thing, 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.Thing
if *v == nil {
cv = []types.Thing{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Thing
destAddr := &col
if err := awsAwsjson11_deserializeDocumentThing(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ThrottlingException
if *v == nil {
sv = &types.ThrottlingException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAssociateEntityToThingOutput(v **AssociateEntityToThingOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AssociateEntityToThingOutput
if *v == nil {
sv = &AssociateEntityToThingOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateFlowTemplateOutput(v **CreateFlowTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateFlowTemplateOutput
if *v == nil {
sv = &CreateFlowTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "summary":
if err := awsAwsjson11_deserializeDocumentFlowTemplateSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateSystemInstanceOutput(v **CreateSystemInstanceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateSystemInstanceOutput
if *v == nil {
sv = &CreateSystemInstanceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "summary":
if err := awsAwsjson11_deserializeDocumentSystemInstanceSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateSystemTemplateOutput(v **CreateSystemTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateSystemTemplateOutput
if *v == nil {
sv = &CreateSystemTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "summary":
if err := awsAwsjson11_deserializeDocumentSystemTemplateSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteFlowTemplateOutput(v **DeleteFlowTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteFlowTemplateOutput
if *v == nil {
sv = &DeleteFlowTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteNamespaceOutput(v **DeleteNamespaceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteNamespaceOutput
if *v == nil {
sv = &DeleteNamespaceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "namespaceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.NamespaceArn = ptr.String(jtv)
}
case "namespaceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NamespaceName to be of type string, got %T instead", value)
}
sv.NamespaceName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteSystemInstanceOutput(v **DeleteSystemInstanceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteSystemInstanceOutput
if *v == nil {
sv = &DeleteSystemInstanceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteSystemTemplateOutput(v **DeleteSystemTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteSystemTemplateOutput
if *v == nil {
sv = &DeleteSystemTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeploySystemInstanceOutput(v **DeploySystemInstanceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeploySystemInstanceOutput
if *v == nil {
sv = &DeploySystemInstanceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "greengrassDeploymentId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GreengrassDeploymentId to be of type string, got %T instead", value)
}
sv.GreengrassDeploymentId = ptr.String(jtv)
}
case "summary":
if err := awsAwsjson11_deserializeDocumentSystemInstanceSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeprecateFlowTemplateOutput(v **DeprecateFlowTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeprecateFlowTemplateOutput
if *v == nil {
sv = &DeprecateFlowTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeprecateSystemTemplateOutput(v **DeprecateSystemTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeprecateSystemTemplateOutput
if *v == nil {
sv = &DeprecateSystemTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeNamespaceOutput(v **DescribeNamespaceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeNamespaceOutput
if *v == nil {
sv = &DescribeNamespaceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "namespaceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.NamespaceArn = ptr.String(jtv)
}
case "namespaceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NamespaceName to be of type string, got %T instead", value)
}
sv.NamespaceName = ptr.String(jtv)
}
case "namespaceVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.NamespaceVersion = ptr.Int64(i64)
}
case "trackingNamespaceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NamespaceName to be of type string, got %T instead", value)
}
sv.TrackingNamespaceName = ptr.String(jtv)
}
case "trackingNamespaceVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TrackingNamespaceVersion = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDissociateEntityFromThingOutput(v **DissociateEntityFromThingOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DissociateEntityFromThingOutput
if *v == nil {
sv = &DissociateEntityFromThingOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetEntitiesOutput(v **GetEntitiesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetEntitiesOutput
if *v == nil {
sv = &GetEntitiesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "descriptions":
if err := awsAwsjson11_deserializeDocumentEntityDescriptions(&sv.Descriptions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetFlowTemplateOutput(v **GetFlowTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetFlowTemplateOutput
if *v == nil {
sv = &GetFlowTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "description":
if err := awsAwsjson11_deserializeDocumentFlowTemplateDescription(&sv.Description, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetFlowTemplateRevisionsOutput(v **GetFlowTemplateRevisionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetFlowTemplateRevisionsOutput
if *v == nil {
sv = &GetFlowTemplateRevisionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "summaries":
if err := awsAwsjson11_deserializeDocumentFlowTemplateSummaries(&sv.Summaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetNamespaceDeletionStatusOutput(v **GetNamespaceDeletionStatusOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetNamespaceDeletionStatusOutput
if *v == nil {
sv = &GetNamespaceDeletionStatusOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NamespaceDeletionStatusErrorCodes to be of type string, got %T instead", value)
}
sv.ErrorCode = types.NamespaceDeletionStatusErrorCodes(jtv)
}
case "errorMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ErrorMessage = ptr.String(jtv)
}
case "namespaceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.NamespaceArn = ptr.String(jtv)
}
case "namespaceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NamespaceName to be of type string, got %T instead", value)
}
sv.NamespaceName = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NamespaceDeletionStatus to be of type string, got %T instead", value)
}
sv.Status = types.NamespaceDeletionStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetSystemInstanceOutput(v **GetSystemInstanceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSystemInstanceOutput
if *v == nil {
sv = &GetSystemInstanceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "description":
if err := awsAwsjson11_deserializeDocumentSystemInstanceDescription(&sv.Description, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetSystemTemplateOutput(v **GetSystemTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSystemTemplateOutput
if *v == nil {
sv = &GetSystemTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "description":
if err := awsAwsjson11_deserializeDocumentSystemTemplateDescription(&sv.Description, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetSystemTemplateRevisionsOutput(v **GetSystemTemplateRevisionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSystemTemplateRevisionsOutput
if *v == nil {
sv = &GetSystemTemplateRevisionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "summaries":
if err := awsAwsjson11_deserializeDocumentSystemTemplateSummaries(&sv.Summaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetUploadStatusOutput(v **GetUploadStatusOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetUploadStatusOutput
if *v == nil {
sv = &GetUploadStatusOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "failureReason":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.FailureReason, value); err != nil {
return err
}
case "namespaceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Arn to be of type string, got %T instead", value)
}
sv.NamespaceArn = ptr.String(jtv)
}
case "namespaceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NamespaceName to be of type string, got %T instead", value)
}
sv.NamespaceName = ptr.String(jtv)
}
case "namespaceVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Version to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.NamespaceVersion = ptr.Int64(i64)
}
case "uploadId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UploadId to be of type string, got %T instead", value)
}
sv.UploadId = ptr.String(jtv)
}
case "uploadStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UploadStatus to be of type string, got %T instead", value)
}
sv.UploadStatus = types.UploadStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListFlowExecutionMessagesOutput(v **ListFlowExecutionMessagesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListFlowExecutionMessagesOutput
if *v == nil {
sv = &ListFlowExecutionMessagesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "messages":
if err := awsAwsjson11_deserializeDocumentFlowExecutionMessages(&sv.Messages, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_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 "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentSearchEntitiesOutput(v **SearchEntitiesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SearchEntitiesOutput
if *v == nil {
sv = &SearchEntitiesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "descriptions":
if err := awsAwsjson11_deserializeDocumentEntityDescriptions(&sv.Descriptions, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentSearchFlowExecutionsOutput(v **SearchFlowExecutionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SearchFlowExecutionsOutput
if *v == nil {
sv = &SearchFlowExecutionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "summaries":
if err := awsAwsjson11_deserializeDocumentFlowExecutionSummaries(&sv.Summaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentSearchFlowTemplatesOutput(v **SearchFlowTemplatesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SearchFlowTemplatesOutput
if *v == nil {
sv = &SearchFlowTemplatesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "summaries":
if err := awsAwsjson11_deserializeDocumentFlowTemplateSummaries(&sv.Summaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentSearchSystemInstancesOutput(v **SearchSystemInstancesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SearchSystemInstancesOutput
if *v == nil {
sv = &SearchSystemInstancesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "summaries":
if err := awsAwsjson11_deserializeDocumentSystemInstanceSummaries(&sv.Summaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentSearchSystemTemplatesOutput(v **SearchSystemTemplatesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SearchSystemTemplatesOutput
if *v == nil {
sv = &SearchSystemTemplatesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "summaries":
if err := awsAwsjson11_deserializeDocumentSystemTemplateSummaries(&sv.Summaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentSearchThingsOutput(v **SearchThingsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SearchThingsOutput
if *v == nil {
sv = &SearchThingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "things":
if err := awsAwsjson11_deserializeDocumentThings(&sv.Things, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagResourceOutput
if *v == nil {
sv = &TagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUndeploySystemInstanceOutput(v **UndeploySystemInstanceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UndeploySystemInstanceOutput
if *v == nil {
sv = &UndeploySystemInstanceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "summary":
if err := awsAwsjson11_deserializeDocumentSystemInstanceSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagResourceOutput
if *v == nil {
sv = &UntagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateFlowTemplateOutput(v **UpdateFlowTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateFlowTemplateOutput
if *v == nil {
sv = &UpdateFlowTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "summary":
if err := awsAwsjson11_deserializeDocumentFlowTemplateSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateSystemTemplateOutput(v **UpdateSystemTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateSystemTemplateOutput
if *v == nil {
sv = &UpdateSystemTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "summary":
if err := awsAwsjson11_deserializeDocumentSystemTemplateSummary(&sv.Summary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUploadEntityDefinitionsOutput(v **UploadEntityDefinitionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UploadEntityDefinitionsOutput
if *v == nil {
sv = &UploadEntityDefinitionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "uploadId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UploadId to be of type string, got %T instead", value)
}
sv.UploadId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 7,533 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package iotthingsgraph provides the API client, operations, and parameter types
// for AWS IoT Things Graph.
//
// AWS IoT Things Graph AWS IoT Things Graph provides an integrated set of tools
// that enable developers to connect devices and services that use different
// standards, such as units of measure and communication protocols. AWS IoT Things
// Graph makes it possible to build IoT applications with little to no code by
// connecting devices and services and defining how they interact at an abstract
// level. For more information about how AWS IoT Things Graph works, see the User
// Guide (https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-whatis.html) .
// The AWS IoT Things Graph service is discontinued.
package iotthingsgraph
| 15 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
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/iotthingsgraph/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 = "iotthingsgraph"
}
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 iotthingsgraph
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.14.12"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"path"
)
type awsAwsjson11_serializeOpAssociateEntityToThing struct {
}
func (*awsAwsjson11_serializeOpAssociateEntityToThing) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAssociateEntityToThing) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateEntityToThingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.AssociateEntityToThing")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAssociateEntityToThingInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateFlowTemplate struct {
}
func (*awsAwsjson11_serializeOpCreateFlowTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateFlowTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateFlowTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.CreateFlowTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateFlowTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateSystemInstance struct {
}
func (*awsAwsjson11_serializeOpCreateSystemInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateSystemInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSystemInstanceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.CreateSystemInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateSystemInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateSystemTemplate struct {
}
func (*awsAwsjson11_serializeOpCreateSystemTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateSystemTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSystemTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.CreateSystemTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateSystemTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteFlowTemplate struct {
}
func (*awsAwsjson11_serializeOpDeleteFlowTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteFlowTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteFlowTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.DeleteFlowTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteFlowTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteNamespace struct {
}
func (*awsAwsjson11_serializeOpDeleteNamespace) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteNamespaceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.DeleteNamespace")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteNamespaceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteSystemInstance struct {
}
func (*awsAwsjson11_serializeOpDeleteSystemInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteSystemInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSystemInstanceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.DeleteSystemInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteSystemInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteSystemTemplate struct {
}
func (*awsAwsjson11_serializeOpDeleteSystemTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteSystemTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSystemTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.DeleteSystemTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteSystemTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeploySystemInstance struct {
}
func (*awsAwsjson11_serializeOpDeploySystemInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeploySystemInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeploySystemInstanceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.DeploySystemInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeploySystemInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeprecateFlowTemplate struct {
}
func (*awsAwsjson11_serializeOpDeprecateFlowTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeprecateFlowTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeprecateFlowTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.DeprecateFlowTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeprecateFlowTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeprecateSystemTemplate struct {
}
func (*awsAwsjson11_serializeOpDeprecateSystemTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeprecateSystemTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeprecateSystemTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.DeprecateSystemTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeprecateSystemTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeNamespace struct {
}
func (*awsAwsjson11_serializeOpDescribeNamespace) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeNamespaceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.DescribeNamespace")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeNamespaceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDissociateEntityFromThing struct {
}
func (*awsAwsjson11_serializeOpDissociateEntityFromThing) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDissociateEntityFromThing) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DissociateEntityFromThingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.DissociateEntityFromThing")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDissociateEntityFromThingInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetEntities struct {
}
func (*awsAwsjson11_serializeOpGetEntities) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetEntities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetEntitiesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.GetEntities")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetEntitiesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetFlowTemplate struct {
}
func (*awsAwsjson11_serializeOpGetFlowTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetFlowTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetFlowTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.GetFlowTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetFlowTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetFlowTemplateRevisions struct {
}
func (*awsAwsjson11_serializeOpGetFlowTemplateRevisions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetFlowTemplateRevisions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetFlowTemplateRevisionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.GetFlowTemplateRevisions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetFlowTemplateRevisionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetNamespaceDeletionStatus struct {
}
func (*awsAwsjson11_serializeOpGetNamespaceDeletionStatus) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetNamespaceDeletionStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetNamespaceDeletionStatusInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.GetNamespaceDeletionStatus")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetNamespaceDeletionStatusInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetSystemInstance struct {
}
func (*awsAwsjson11_serializeOpGetSystemInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetSystemInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSystemInstanceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.GetSystemInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetSystemInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetSystemTemplate struct {
}
func (*awsAwsjson11_serializeOpGetSystemTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetSystemTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSystemTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.GetSystemTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetSystemTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetSystemTemplateRevisions struct {
}
func (*awsAwsjson11_serializeOpGetSystemTemplateRevisions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetSystemTemplateRevisions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSystemTemplateRevisionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.GetSystemTemplateRevisions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetSystemTemplateRevisionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetUploadStatus struct {
}
func (*awsAwsjson11_serializeOpGetUploadStatus) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetUploadStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetUploadStatusInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.GetUploadStatus")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetUploadStatusInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListFlowExecutionMessages struct {
}
func (*awsAwsjson11_serializeOpListFlowExecutionMessages) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListFlowExecutionMessages) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListFlowExecutionMessagesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.ListFlowExecutionMessages")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListFlowExecutionMessagesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSearchEntities struct {
}
func (*awsAwsjson11_serializeOpSearchEntities) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchEntities) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchEntitiesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.SearchEntities")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchEntitiesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSearchFlowExecutions struct {
}
func (*awsAwsjson11_serializeOpSearchFlowExecutions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchFlowExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchFlowExecutionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.SearchFlowExecutions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchFlowExecutionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSearchFlowTemplates struct {
}
func (*awsAwsjson11_serializeOpSearchFlowTemplates) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchFlowTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchFlowTemplatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.SearchFlowTemplates")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchFlowTemplatesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSearchSystemInstances struct {
}
func (*awsAwsjson11_serializeOpSearchSystemInstances) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchSystemInstances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchSystemInstancesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.SearchSystemInstances")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchSystemInstancesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSearchSystemTemplates struct {
}
func (*awsAwsjson11_serializeOpSearchSystemTemplates) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchSystemTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchSystemTemplatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.SearchSystemTemplates")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchSystemTemplatesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSearchThings struct {
}
func (*awsAwsjson11_serializeOpSearchThings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSearchThings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SearchThingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.SearchThings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSearchThingsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, 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("IotThingsGraphFrontEndService.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_serializeOpUndeploySystemInstance struct {
}
func (*awsAwsjson11_serializeOpUndeploySystemInstance) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUndeploySystemInstance) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UndeploySystemInstanceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.UndeploySystemInstance")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUndeploySystemInstanceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, 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("IotThingsGraphFrontEndService.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_serializeOpUpdateFlowTemplate struct {
}
func (*awsAwsjson11_serializeOpUpdateFlowTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateFlowTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateFlowTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.UpdateFlowTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateFlowTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateSystemTemplate struct {
}
func (*awsAwsjson11_serializeOpUpdateSystemTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateSystemTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSystemTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.UpdateSystemTemplate")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateSystemTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUploadEntityDefinitions struct {
}
func (*awsAwsjson11_serializeOpUploadEntityDefinitions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUploadEntityDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UploadEntityDefinitionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("IotThingsGraphFrontEndService.UploadEntityDefinitions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUploadEntityDefinitionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if 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_serializeDocumentDefinitionDocument(v *types.DefinitionDocument, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Language) > 0 {
ok := object.Key("language")
ok.String(string(v.Language))
}
if v.Text != nil {
ok := object.Key("text")
ok.String(*v.Text)
}
return nil
}
func awsAwsjson11_serializeDocumentEntityFilter(v *types.EntityFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if v.Value != nil {
ok := object.Key("value")
if err := awsAwsjson11_serializeDocumentEntityFilterValues(v.Value, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentEntityFilters(v []types.EntityFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentEntityFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentEntityFilterValues(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_serializeDocumentEntityTypes(v []types.EntityType, 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_serializeDocumentFlowTemplateFilter(v *types.FlowTemplateFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if v.Value != nil {
ok := object.Key("value")
if err := awsAwsjson11_serializeDocumentFlowTemplateFilterValues(v.Value, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFlowTemplateFilters(v []types.FlowTemplateFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentFlowTemplateFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentFlowTemplateFilterValues(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_serializeDocumentMetricsConfiguration(v *types.MetricsConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudMetricEnabled {
ok := object.Key("cloudMetricEnabled")
ok.Boolean(v.CloudMetricEnabled)
}
if v.MetricRuleRoleArn != nil {
ok := object.Key("metricRuleRoleArn")
ok.String(*v.MetricRuleRoleArn)
}
return nil
}
func awsAwsjson11_serializeDocumentSystemInstanceFilter(v *types.SystemInstanceFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if v.Value != nil {
ok := object.Key("value")
if err := awsAwsjson11_serializeDocumentSystemInstanceFilterValues(v.Value, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSystemInstanceFilters(v []types.SystemInstanceFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentSystemInstanceFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSystemInstanceFilterValues(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_serializeDocumentSystemTemplateFilter(v *types.SystemTemplateFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Name) > 0 {
ok := object.Key("name")
ok.String(string(v.Name))
}
if v.Value != nil {
ok := object.Key("value")
if err := awsAwsjson11_serializeDocumentSystemTemplateFilterValues(v.Value, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSystemTemplateFilters(v []types.SystemTemplateFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentSystemTemplateFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSystemTemplateFilterValues(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_serializeDocumentUrns(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_serializeOpDocumentAssociateEntityToThingInput(v *AssociateEntityToThingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EntityId != nil {
ok := object.Key("entityId")
ok.String(*v.EntityId)
}
if v.NamespaceVersion != nil {
ok := object.Key("namespaceVersion")
ok.Long(*v.NamespaceVersion)
}
if v.ThingName != nil {
ok := object.Key("thingName")
ok.String(*v.ThingName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateFlowTemplateInput(v *CreateFlowTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CompatibleNamespaceVersion != nil {
ok := object.Key("compatibleNamespaceVersion")
ok.Long(*v.CompatibleNamespaceVersion)
}
if v.Definition != nil {
ok := object.Key("definition")
if err := awsAwsjson11_serializeDocumentDefinitionDocument(v.Definition, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateSystemInstanceInput(v *CreateSystemInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Definition != nil {
ok := object.Key("definition")
if err := awsAwsjson11_serializeDocumentDefinitionDocument(v.Definition, ok); err != nil {
return err
}
}
if v.FlowActionsRoleArn != nil {
ok := object.Key("flowActionsRoleArn")
ok.String(*v.FlowActionsRoleArn)
}
if v.GreengrassGroupName != nil {
ok := object.Key("greengrassGroupName")
ok.String(*v.GreengrassGroupName)
}
if v.MetricsConfiguration != nil {
ok := object.Key("metricsConfiguration")
if err := awsAwsjson11_serializeDocumentMetricsConfiguration(v.MetricsConfiguration, ok); err != nil {
return err
}
}
if v.S3BucketName != nil {
ok := object.Key("s3BucketName")
ok.String(*v.S3BucketName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if len(v.Target) > 0 {
ok := object.Key("target")
ok.String(string(v.Target))
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateSystemTemplateInput(v *CreateSystemTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CompatibleNamespaceVersion != nil {
ok := object.Key("compatibleNamespaceVersion")
ok.Long(*v.CompatibleNamespaceVersion)
}
if v.Definition != nil {
ok := object.Key("definition")
if err := awsAwsjson11_serializeDocumentDefinitionDocument(v.Definition, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteFlowTemplateInput(v *DeleteFlowTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteNamespaceInput(v *DeleteNamespaceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteSystemInstanceInput(v *DeleteSystemInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteSystemTemplateInput(v *DeleteSystemTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeploySystemInstanceInput(v *DeploySystemInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeprecateFlowTemplateInput(v *DeprecateFlowTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeprecateSystemTemplateInput(v *DeprecateSystemTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeNamespaceInput(v *DescribeNamespaceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NamespaceName != nil {
ok := object.Key("namespaceName")
ok.String(*v.NamespaceName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDissociateEntityFromThingInput(v *DissociateEntityFromThingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.EntityType) > 0 {
ok := object.Key("entityType")
ok.String(string(v.EntityType))
}
if v.ThingName != nil {
ok := object.Key("thingName")
ok.String(*v.ThingName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetEntitiesInput(v *GetEntitiesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Ids != nil {
ok := object.Key("ids")
if err := awsAwsjson11_serializeDocumentUrns(v.Ids, ok); err != nil {
return err
}
}
if v.NamespaceVersion != nil {
ok := object.Key("namespaceVersion")
ok.Long(*v.NamespaceVersion)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetFlowTemplateInput(v *GetFlowTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.RevisionNumber != nil {
ok := object.Key("revisionNumber")
ok.Long(*v.RevisionNumber)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetFlowTemplateRevisionsInput(v *GetFlowTemplateRevisionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetNamespaceDeletionStatusInput(v *GetNamespaceDeletionStatusInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentGetSystemInstanceInput(v *GetSystemInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetSystemTemplateInput(v *GetSystemTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.RevisionNumber != nil {
ok := object.Key("revisionNumber")
ok.Long(*v.RevisionNumber)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetSystemTemplateRevisionsInput(v *GetSystemTemplateRevisionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetUploadStatusInput(v *GetUploadStatusInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.UploadId != nil {
ok := object.Key("uploadId")
ok.String(*v.UploadId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListFlowExecutionMessagesInput(v *ListFlowExecutionMessagesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FlowExecutionId != nil {
ok := object.Key("flowExecutionId")
ok.String(*v.FlowExecutionId)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.ResourceArn != nil {
ok := object.Key("resourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchEntitiesInput(v *SearchEntitiesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EntityTypes != nil {
ok := object.Key("entityTypes")
if err := awsAwsjson11_serializeDocumentEntityTypes(v.EntityTypes, ok); err != nil {
return err
}
}
if v.Filters != nil {
ok := object.Key("filters")
if err := awsAwsjson11_serializeDocumentEntityFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NamespaceVersion != nil {
ok := object.Key("namespaceVersion")
ok.Long(*v.NamespaceVersion)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchFlowExecutionsInput(v *SearchFlowExecutionsInput, 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.FlowExecutionId != nil {
ok := object.Key("flowExecutionId")
ok.String(*v.FlowExecutionId)
}
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.StartTime != nil {
ok := object.Key("startTime")
ok.Double(smithytime.FormatEpochSeconds(*v.StartTime))
}
if v.SystemInstanceId != nil {
ok := object.Key("systemInstanceId")
ok.String(*v.SystemInstanceId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchFlowTemplatesInput(v *SearchFlowTemplatesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsAwsjson11_serializeDocumentFlowTemplateFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchSystemInstancesInput(v *SearchSystemInstancesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsAwsjson11_serializeDocumentSystemInstanceFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchSystemTemplatesInput(v *SearchSystemTemplatesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsAwsjson11_serializeDocumentSystemTemplateFilters(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSearchThingsInput(v *SearchThingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EntityId != nil {
ok := object.Key("entityId")
ok.String(*v.EntityId)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NamespaceVersion != nil {
ok := object.Key("namespaceVersion")
ok.Long(*v.NamespaceVersion)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
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.Tags != nil {
ok := object.Key("tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUndeploySystemInstanceInput(v *UndeploySystemInstanceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
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.TagKeys != nil {
ok := object.Key("tagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateFlowTemplateInput(v *UpdateFlowTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CompatibleNamespaceVersion != nil {
ok := object.Key("compatibleNamespaceVersion")
ok.Long(*v.CompatibleNamespaceVersion)
}
if v.Definition != nil {
ok := object.Key("definition")
if err := awsAwsjson11_serializeDocumentDefinitionDocument(v.Definition, ok); err != nil {
return err
}
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateSystemTemplateInput(v *UpdateSystemTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CompatibleNamespaceVersion != nil {
ok := object.Key("compatibleNamespaceVersion")
ok.Long(*v.CompatibleNamespaceVersion)
}
if v.Definition != nil {
ok := object.Key("definition")
if err := awsAwsjson11_serializeDocumentDefinitionDocument(v.Definition, ok); err != nil {
return err
}
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUploadEntityDefinitionsInput(v *UploadEntityDefinitionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeprecateExistingEntities {
ok := object.Key("deprecateExistingEntities")
ok.Boolean(v.DeprecateExistingEntities)
}
if v.Document != nil {
ok := object.Key("document")
if err := awsAwsjson11_serializeDocumentDefinitionDocument(v.Document, ok); err != nil {
return err
}
}
if v.SyncWithPublicNamespace {
ok := object.Key("syncWithPublicNamespace")
ok.Boolean(v.SyncWithPublicNamespace)
}
return nil
}
| 2,893 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package iotthingsgraph
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/iotthingsgraph/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAssociateEntityToThing struct {
}
func (*validateOpAssociateEntityToThing) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateEntityToThing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateEntityToThingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateEntityToThingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateFlowTemplate struct {
}
func (*validateOpCreateFlowTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateFlowTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateFlowTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateFlowTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSystemInstance struct {
}
func (*validateOpCreateSystemInstance) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSystemInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSystemInstanceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSystemInstanceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSystemTemplate struct {
}
func (*validateOpCreateSystemTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSystemTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSystemTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSystemTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteFlowTemplate struct {
}
func (*validateOpDeleteFlowTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteFlowTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteFlowTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteFlowTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSystemTemplate struct {
}
func (*validateOpDeleteSystemTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSystemTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSystemTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSystemTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeprecateFlowTemplate struct {
}
func (*validateOpDeprecateFlowTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeprecateFlowTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeprecateFlowTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeprecateFlowTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeprecateSystemTemplate struct {
}
func (*validateOpDeprecateSystemTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeprecateSystemTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeprecateSystemTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeprecateSystemTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDissociateEntityFromThing struct {
}
func (*validateOpDissociateEntityFromThing) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDissociateEntityFromThing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DissociateEntityFromThingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDissociateEntityFromThingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetEntities struct {
}
func (*validateOpGetEntities) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetEntities) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetEntitiesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetEntitiesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFlowTemplate struct {
}
func (*validateOpGetFlowTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFlowTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFlowTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFlowTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFlowTemplateRevisions struct {
}
func (*validateOpGetFlowTemplateRevisions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFlowTemplateRevisions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFlowTemplateRevisionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFlowTemplateRevisionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSystemInstance struct {
}
func (*validateOpGetSystemInstance) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSystemInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSystemInstanceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSystemInstanceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSystemTemplate struct {
}
func (*validateOpGetSystemTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSystemTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSystemTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSystemTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSystemTemplateRevisions struct {
}
func (*validateOpGetSystemTemplateRevisions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSystemTemplateRevisions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSystemTemplateRevisionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSystemTemplateRevisionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetUploadStatus struct {
}
func (*validateOpGetUploadStatus) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetUploadStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetUploadStatusInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetUploadStatusInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListFlowExecutionMessages struct {
}
func (*validateOpListFlowExecutionMessages) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListFlowExecutionMessages) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListFlowExecutionMessagesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListFlowExecutionMessagesInput(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 validateOpSearchEntities struct {
}
func (*validateOpSearchEntities) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchEntities) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchEntitiesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchEntitiesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchFlowExecutions struct {
}
func (*validateOpSearchFlowExecutions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchFlowExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchFlowExecutionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchFlowExecutionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchFlowTemplates struct {
}
func (*validateOpSearchFlowTemplates) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchFlowTemplates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchFlowTemplatesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchFlowTemplatesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchSystemTemplates struct {
}
func (*validateOpSearchSystemTemplates) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchSystemTemplates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchSystemTemplatesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchSystemTemplatesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSearchThings struct {
}
func (*validateOpSearchThings) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSearchThings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SearchThingsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSearchThingsInput(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 validateOpUpdateFlowTemplate struct {
}
func (*validateOpUpdateFlowTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateFlowTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateFlowTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateFlowTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSystemTemplate struct {
}
func (*validateOpUpdateSystemTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSystemTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSystemTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSystemTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUploadEntityDefinitions struct {
}
func (*validateOpUploadEntityDefinitions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUploadEntityDefinitions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UploadEntityDefinitionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUploadEntityDefinitionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAssociateEntityToThingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateEntityToThing{}, middleware.After)
}
func addOpCreateFlowTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateFlowTemplate{}, middleware.After)
}
func addOpCreateSystemInstanceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSystemInstance{}, middleware.After)
}
func addOpCreateSystemTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSystemTemplate{}, middleware.After)
}
func addOpDeleteFlowTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteFlowTemplate{}, middleware.After)
}
func addOpDeleteSystemTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSystemTemplate{}, middleware.After)
}
func addOpDeprecateFlowTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeprecateFlowTemplate{}, middleware.After)
}
func addOpDeprecateSystemTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeprecateSystemTemplate{}, middleware.After)
}
func addOpDissociateEntityFromThingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDissociateEntityFromThing{}, middleware.After)
}
func addOpGetEntitiesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetEntities{}, middleware.After)
}
func addOpGetFlowTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFlowTemplate{}, middleware.After)
}
func addOpGetFlowTemplateRevisionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFlowTemplateRevisions{}, middleware.After)
}
func addOpGetSystemInstanceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSystemInstance{}, middleware.After)
}
func addOpGetSystemTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSystemTemplate{}, middleware.After)
}
func addOpGetSystemTemplateRevisionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSystemTemplateRevisions{}, middleware.After)
}
func addOpGetUploadStatusValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetUploadStatus{}, middleware.After)
}
func addOpListFlowExecutionMessagesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListFlowExecutionMessages{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpSearchEntitiesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchEntities{}, middleware.After)
}
func addOpSearchFlowExecutionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchFlowExecutions{}, middleware.After)
}
func addOpSearchFlowTemplatesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchFlowTemplates{}, middleware.After)
}
func addOpSearchSystemTemplatesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchSystemTemplates{}, middleware.After)
}
func addOpSearchThingsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSearchThings{}, 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 addOpUpdateFlowTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateFlowTemplate{}, middleware.After)
}
func addOpUpdateSystemTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSystemTemplate{}, middleware.After)
}
func addOpUploadEntityDefinitionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUploadEntityDefinitions{}, middleware.After)
}
func validateDefinitionDocument(v *types.DefinitionDocument) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DefinitionDocument"}
if len(v.Language) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Language"))
}
if v.Text == nil {
invalidParams.Add(smithy.NewErrParamRequired("Text"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFlowTemplateFilter(v *types.FlowTemplateFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FlowTemplateFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFlowTemplateFilters(v []types.FlowTemplateFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FlowTemplateFilters"}
for i := range v {
if err := validateFlowTemplateFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSystemTemplateFilter(v *types.SystemTemplateFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SystemTemplateFilter"}
if len(v.Name) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSystemTemplateFilters(v []types.SystemTemplateFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SystemTemplateFilters"}
for i := range v {
if err := validateSystemTemplateFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTagList(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagList"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateEntityToThingInput(v *AssociateEntityToThingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateEntityToThingInput"}
if v.ThingName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ThingName"))
}
if v.EntityId == nil {
invalidParams.Add(smithy.NewErrParamRequired("EntityId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateFlowTemplateInput(v *CreateFlowTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateFlowTemplateInput"}
if v.Definition == nil {
invalidParams.Add(smithy.NewErrParamRequired("Definition"))
} else if v.Definition != nil {
if err := validateDefinitionDocument(v.Definition); err != nil {
invalidParams.AddNested("Definition", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSystemInstanceInput(v *CreateSystemInstanceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSystemInstanceInput"}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if v.Definition == nil {
invalidParams.Add(smithy.NewErrParamRequired("Definition"))
} else if v.Definition != nil {
if err := validateDefinitionDocument(v.Definition); err != nil {
invalidParams.AddNested("Definition", err.(smithy.InvalidParamsError))
}
}
if len(v.Target) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Target"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSystemTemplateInput(v *CreateSystemTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSystemTemplateInput"}
if v.Definition == nil {
invalidParams.Add(smithy.NewErrParamRequired("Definition"))
} else if v.Definition != nil {
if err := validateDefinitionDocument(v.Definition); err != nil {
invalidParams.AddNested("Definition", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteFlowTemplateInput(v *DeleteFlowTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteFlowTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSystemTemplateInput(v *DeleteSystemTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSystemTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeprecateFlowTemplateInput(v *DeprecateFlowTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeprecateFlowTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeprecateSystemTemplateInput(v *DeprecateSystemTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeprecateSystemTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDissociateEntityFromThingInput(v *DissociateEntityFromThingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DissociateEntityFromThingInput"}
if v.ThingName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ThingName"))
}
if len(v.EntityType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("EntityType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetEntitiesInput(v *GetEntitiesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetEntitiesInput"}
if v.Ids == nil {
invalidParams.Add(smithy.NewErrParamRequired("Ids"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFlowTemplateInput(v *GetFlowTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFlowTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFlowTemplateRevisionsInput(v *GetFlowTemplateRevisionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFlowTemplateRevisionsInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSystemInstanceInput(v *GetSystemInstanceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSystemInstanceInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSystemTemplateInput(v *GetSystemTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSystemTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSystemTemplateRevisionsInput(v *GetSystemTemplateRevisionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSystemTemplateRevisionsInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetUploadStatusInput(v *GetUploadStatusInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetUploadStatusInput"}
if v.UploadId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UploadId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListFlowExecutionMessagesInput(v *ListFlowExecutionMessagesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListFlowExecutionMessagesInput"}
if v.FlowExecutionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("FlowExecutionId"))
}
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 validateOpSearchEntitiesInput(v *SearchEntitiesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchEntitiesInput"}
if v.EntityTypes == nil {
invalidParams.Add(smithy.NewErrParamRequired("EntityTypes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchFlowExecutionsInput(v *SearchFlowExecutionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchFlowExecutionsInput"}
if v.SystemInstanceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SystemInstanceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchFlowTemplatesInput(v *SearchFlowTemplatesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchFlowTemplatesInput"}
if v.Filters != nil {
if err := validateFlowTemplateFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchSystemTemplatesInput(v *SearchSystemTemplatesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchSystemTemplatesInput"}
if v.Filters != nil {
if err := validateSystemTemplateFilters(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSearchThingsInput(v *SearchThingsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SearchThingsInput"}
if v.EntityId == nil {
invalidParams.Add(smithy.NewErrParamRequired("EntityId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} else if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateFlowTemplateInput(v *UpdateFlowTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateFlowTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.Definition == nil {
invalidParams.Add(smithy.NewErrParamRequired("Definition"))
} else if v.Definition != nil {
if err := validateDefinitionDocument(v.Definition); err != nil {
invalidParams.AddNested("Definition", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSystemTemplateInput(v *UpdateSystemTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSystemTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.Definition == nil {
invalidParams.Add(smithy.NewErrParamRequired("Definition"))
} else if v.Definition != nil {
if err := validateDefinitionDocument(v.Definition); err != nil {
invalidParams.AddNested("Definition", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUploadEntityDefinitionsInput(v *UploadEntityDefinitionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UploadEntityDefinitionsInput"}
if v.Document != nil {
if err := validateDefinitionDocument(v.Document); err != nil {
invalidParams.AddNested("Document", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 1,283 |
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 IoTThingsGraph 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: "iotthingsgraph.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "iotthingsgraph",
},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotthingsgraph-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "iotthingsgraph",
},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "iotthingsgraph-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "iotthingsgraph",
},
},
{
Variant: 0,
}: {
Hostname: "iotthingsgraph.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "iotthingsgraph",
},
},
},
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-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "iotthingsgraph.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotthingsgraph-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "iotthingsgraph-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotthingsgraph.{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: "iotthingsgraph-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotthingsgraph.{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: "iotthingsgraph-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotthingsgraph.{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: "iotthingsgraph-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotthingsgraph.{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: "iotthingsgraph-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotthingsgraph.{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: "iotthingsgraph.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "iotthingsgraph-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "iotthingsgraph-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "iotthingsgraph.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 329 |
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 DefinitionLanguage string
// Enum values for DefinitionLanguage
const (
DefinitionLanguageGraphql DefinitionLanguage = "GRAPHQL"
)
// Values returns all known values for DefinitionLanguage. 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 (DefinitionLanguage) Values() []DefinitionLanguage {
return []DefinitionLanguage{
"GRAPHQL",
}
}
type DeploymentTarget string
// Enum values for DeploymentTarget
const (
DeploymentTargetGreengrass DeploymentTarget = "GREENGRASS"
DeploymentTargetCloud DeploymentTarget = "CLOUD"
)
// Values returns all known values for DeploymentTarget. 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 (DeploymentTarget) Values() []DeploymentTarget {
return []DeploymentTarget{
"GREENGRASS",
"CLOUD",
}
}
type EntityFilterName string
// Enum values for EntityFilterName
const (
EntityFilterNameName EntityFilterName = "NAME"
EntityFilterNameNamespace EntityFilterName = "NAMESPACE"
EntityFilterNameSemanticTypePath EntityFilterName = "SEMANTIC_TYPE_PATH"
EntityFilterNameReferencedEntityId EntityFilterName = "REFERENCED_ENTITY_ID"
)
// Values returns all known values for EntityFilterName. 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 (EntityFilterName) Values() []EntityFilterName {
return []EntityFilterName{
"NAME",
"NAMESPACE",
"SEMANTIC_TYPE_PATH",
"REFERENCED_ENTITY_ID",
}
}
type EntityType string
// Enum values for EntityType
const (
EntityTypeDevice EntityType = "DEVICE"
EntityTypeService EntityType = "SERVICE"
EntityTypeDeviceModel EntityType = "DEVICE_MODEL"
EntityTypeCapability EntityType = "CAPABILITY"
EntityTypeState EntityType = "STATE"
EntityTypeAction EntityType = "ACTION"
EntityTypeEvent EntityType = "EVENT"
EntityTypeProperty EntityType = "PROPERTY"
EntityTypeMapping EntityType = "MAPPING"
EntityTypeEnum EntityType = "ENUM"
)
// Values returns all known values for EntityType. 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 (EntityType) Values() []EntityType {
return []EntityType{
"DEVICE",
"SERVICE",
"DEVICE_MODEL",
"CAPABILITY",
"STATE",
"ACTION",
"EVENT",
"PROPERTY",
"MAPPING",
"ENUM",
}
}
type FlowExecutionEventType string
// Enum values for FlowExecutionEventType
const (
FlowExecutionEventTypeExecutionStarted FlowExecutionEventType = "EXECUTION_STARTED"
FlowExecutionEventTypeExecutionFailed FlowExecutionEventType = "EXECUTION_FAILED"
FlowExecutionEventTypeExecutionAborted FlowExecutionEventType = "EXECUTION_ABORTED"
FlowExecutionEventTypeExecutionSucceeded FlowExecutionEventType = "EXECUTION_SUCCEEDED"
FlowExecutionEventTypeStepStarted FlowExecutionEventType = "STEP_STARTED"
FlowExecutionEventTypeStepFailed FlowExecutionEventType = "STEP_FAILED"
FlowExecutionEventTypeStepSucceeded FlowExecutionEventType = "STEP_SUCCEEDED"
FlowExecutionEventTypeActivityScheduled FlowExecutionEventType = "ACTIVITY_SCHEDULED"
FlowExecutionEventTypeActivityStarted FlowExecutionEventType = "ACTIVITY_STARTED"
FlowExecutionEventTypeActivityFailed FlowExecutionEventType = "ACTIVITY_FAILED"
FlowExecutionEventTypeActivitySucceeded FlowExecutionEventType = "ACTIVITY_SUCCEEDED"
FlowExecutionEventTypeStartFlowExecutionTask FlowExecutionEventType = "START_FLOW_EXECUTION_TASK"
FlowExecutionEventTypeScheduleNextReadyStepsTask FlowExecutionEventType = "SCHEDULE_NEXT_READY_STEPS_TASK"
FlowExecutionEventTypeThingActionTask FlowExecutionEventType = "THING_ACTION_TASK"
FlowExecutionEventTypeThingActionTaskFailed FlowExecutionEventType = "THING_ACTION_TASK_FAILED"
FlowExecutionEventTypeThingActionTaskSucceeded FlowExecutionEventType = "THING_ACTION_TASK_SUCCEEDED"
FlowExecutionEventTypeAcknowledgeTaskMessage FlowExecutionEventType = "ACKNOWLEDGE_TASK_MESSAGE"
)
// Values returns all known values for FlowExecutionEventType. 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 (FlowExecutionEventType) Values() []FlowExecutionEventType {
return []FlowExecutionEventType{
"EXECUTION_STARTED",
"EXECUTION_FAILED",
"EXECUTION_ABORTED",
"EXECUTION_SUCCEEDED",
"STEP_STARTED",
"STEP_FAILED",
"STEP_SUCCEEDED",
"ACTIVITY_SCHEDULED",
"ACTIVITY_STARTED",
"ACTIVITY_FAILED",
"ACTIVITY_SUCCEEDED",
"START_FLOW_EXECUTION_TASK",
"SCHEDULE_NEXT_READY_STEPS_TASK",
"THING_ACTION_TASK",
"THING_ACTION_TASK_FAILED",
"THING_ACTION_TASK_SUCCEEDED",
"ACKNOWLEDGE_TASK_MESSAGE",
}
}
type FlowExecutionStatus string
// Enum values for FlowExecutionStatus
const (
FlowExecutionStatusRunning FlowExecutionStatus = "RUNNING"
FlowExecutionStatusAborted FlowExecutionStatus = "ABORTED"
FlowExecutionStatusSucceeded FlowExecutionStatus = "SUCCEEDED"
FlowExecutionStatusFailed FlowExecutionStatus = "FAILED"
)
// Values returns all known values for FlowExecutionStatus. 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 (FlowExecutionStatus) Values() []FlowExecutionStatus {
return []FlowExecutionStatus{
"RUNNING",
"ABORTED",
"SUCCEEDED",
"FAILED",
}
}
type FlowTemplateFilterName string
// Enum values for FlowTemplateFilterName
const (
FlowTemplateFilterNameDeviceModelId FlowTemplateFilterName = "DEVICE_MODEL_ID"
)
// Values returns all known values for FlowTemplateFilterName. 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 (FlowTemplateFilterName) Values() []FlowTemplateFilterName {
return []FlowTemplateFilterName{
"DEVICE_MODEL_ID",
}
}
type NamespaceDeletionStatus string
// Enum values for NamespaceDeletionStatus
const (
NamespaceDeletionStatusInProgress NamespaceDeletionStatus = "IN_PROGRESS"
NamespaceDeletionStatusSucceeded NamespaceDeletionStatus = "SUCCEEDED"
NamespaceDeletionStatusFailed NamespaceDeletionStatus = "FAILED"
)
// Values returns all known values for NamespaceDeletionStatus. 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 (NamespaceDeletionStatus) Values() []NamespaceDeletionStatus {
return []NamespaceDeletionStatus{
"IN_PROGRESS",
"SUCCEEDED",
"FAILED",
}
}
type NamespaceDeletionStatusErrorCodes string
// Enum values for NamespaceDeletionStatusErrorCodes
const (
NamespaceDeletionStatusErrorCodesValidationFailed NamespaceDeletionStatusErrorCodes = "VALIDATION_FAILED"
)
// Values returns all known values for NamespaceDeletionStatusErrorCodes. 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 (NamespaceDeletionStatusErrorCodes) Values() []NamespaceDeletionStatusErrorCodes {
return []NamespaceDeletionStatusErrorCodes{
"VALIDATION_FAILED",
}
}
type SystemInstanceDeploymentStatus string
// Enum values for SystemInstanceDeploymentStatus
const (
SystemInstanceDeploymentStatusNotDeployed SystemInstanceDeploymentStatus = "NOT_DEPLOYED"
SystemInstanceDeploymentStatusBootstrap SystemInstanceDeploymentStatus = "BOOTSTRAP"
SystemInstanceDeploymentStatusDeployInProgress SystemInstanceDeploymentStatus = "DEPLOY_IN_PROGRESS"
SystemInstanceDeploymentStatusDeployedInTarget SystemInstanceDeploymentStatus = "DEPLOYED_IN_TARGET"
SystemInstanceDeploymentStatusUndeployInProgress SystemInstanceDeploymentStatus = "UNDEPLOY_IN_PROGRESS"
SystemInstanceDeploymentStatusFailed SystemInstanceDeploymentStatus = "FAILED"
SystemInstanceDeploymentStatusPendingDelete SystemInstanceDeploymentStatus = "PENDING_DELETE"
SystemInstanceDeploymentStatusDeletedInTarget SystemInstanceDeploymentStatus = "DELETED_IN_TARGET"
)
// Values returns all known values for SystemInstanceDeploymentStatus. 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 (SystemInstanceDeploymentStatus) Values() []SystemInstanceDeploymentStatus {
return []SystemInstanceDeploymentStatus{
"NOT_DEPLOYED",
"BOOTSTRAP",
"DEPLOY_IN_PROGRESS",
"DEPLOYED_IN_TARGET",
"UNDEPLOY_IN_PROGRESS",
"FAILED",
"PENDING_DELETE",
"DELETED_IN_TARGET",
}
}
type SystemInstanceFilterName string
// Enum values for SystemInstanceFilterName
const (
SystemInstanceFilterNameSystemTemplateId SystemInstanceFilterName = "SYSTEM_TEMPLATE_ID"
SystemInstanceFilterNameStatus SystemInstanceFilterName = "STATUS"
SystemInstanceFilterNameGreengrassGroupName SystemInstanceFilterName = "GREENGRASS_GROUP_NAME"
)
// Values returns all known values for SystemInstanceFilterName. 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 (SystemInstanceFilterName) Values() []SystemInstanceFilterName {
return []SystemInstanceFilterName{
"SYSTEM_TEMPLATE_ID",
"STATUS",
"GREENGRASS_GROUP_NAME",
}
}
type SystemTemplateFilterName string
// Enum values for SystemTemplateFilterName
const (
SystemTemplateFilterNameFlowTemplateId SystemTemplateFilterName = "FLOW_TEMPLATE_ID"
)
// Values returns all known values for SystemTemplateFilterName. 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 (SystemTemplateFilterName) Values() []SystemTemplateFilterName {
return []SystemTemplateFilterName{
"FLOW_TEMPLATE_ID",
}
}
type UploadStatus string
// Enum values for UploadStatus
const (
UploadStatusInProgress UploadStatus = "IN_PROGRESS"
UploadStatusSucceeded UploadStatus = "SUCCEEDED"
UploadStatusFailed UploadStatus = "FAILED"
)
// Values returns all known values for UploadStatus. 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 (UploadStatus) Values() []UploadStatus {
return []UploadStatus{
"IN_PROGRESS",
"SUCCEEDED",
"FAILED",
}
}
| 304 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.