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 finspacedata
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"
)
// Denies access to the FinSpace web application and API for the specified user.
func (c *Client) DisableUser(ctx context.Context, params *DisableUserInput, optFns ...func(*Options)) (*DisableUserOutput, error) {
if params == nil {
params = &DisableUserInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisableUser", params, optFns, c.addOperationDisableUserMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisableUserOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisableUserInput struct {
// The unique identifier for the user account that you want to disable.
//
// This member is required.
UserId *string
// A token that ensures idempotency. This token expires in 10 minutes.
ClientToken *string
noSmithyDocumentSerde
}
type DisableUserOutput struct {
// The unique identifier for the disabled user account.
UserId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisableUserMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDisableUser{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisableUser{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDisableUserMiddleware(stack, options); err != nil {
return err
}
if err = addOpDisableUserValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableUser(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpDisableUser struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDisableUser) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDisableUser) 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.(*DisableUserInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DisableUserInput ")
}
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_opDisableUserMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDisableUser{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDisableUser(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "DisableUser",
}
}
| 167 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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 user account from a permission group.
func (c *Client) DisassociateUserFromPermissionGroup(ctx context.Context, params *DisassociateUserFromPermissionGroupInput, optFns ...func(*Options)) (*DisassociateUserFromPermissionGroupOutput, error) {
if params == nil {
params = &DisassociateUserFromPermissionGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisassociateUserFromPermissionGroup", params, optFns, c.addOperationDisassociateUserFromPermissionGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisassociateUserFromPermissionGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type DisassociateUserFromPermissionGroupInput struct {
// The unique identifier for the permission group.
//
// This member is required.
PermissionGroupId *string
// The unique identifier for the user.
//
// This member is required.
UserId *string
// A token that ensures idempotency. This token expires in 10 minutes.
ClientToken *string
noSmithyDocumentSerde
}
type DisassociateUserFromPermissionGroupOutput struct {
// The returned status code of the response.
StatusCode int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisassociateUserFromPermissionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateUserFromPermissionGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateUserFromPermissionGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opDisassociateUserFromPermissionGroupMiddleware(stack, options); err != nil {
return err
}
if err = addOpDisassociateUserFromPermissionGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateUserFromPermissionGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpDisassociateUserFromPermissionGroup struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpDisassociateUserFromPermissionGroup) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpDisassociateUserFromPermissionGroup) 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.(*DisassociateUserFromPermissionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *DisassociateUserFromPermissionGroupInput ")
}
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_opDisassociateUserFromPermissionGroupMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpDisassociateUserFromPermissionGroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opDisassociateUserFromPermissionGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "DisassociateUserFromPermissionGroup",
}
}
| 172 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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"
)
// Allows the specified user to access the FinSpace web application and API.
func (c *Client) EnableUser(ctx context.Context, params *EnableUserInput, optFns ...func(*Options)) (*EnableUserOutput, error) {
if params == nil {
params = &EnableUserInput{}
}
result, metadata, err := c.invokeOperation(ctx, "EnableUser", params, optFns, c.addOperationEnableUserMiddlewares)
if err != nil {
return nil, err
}
out := result.(*EnableUserOutput)
out.ResultMetadata = metadata
return out, nil
}
type EnableUserInput struct {
// The unique identifier for the user account that you want to enable.
//
// This member is required.
UserId *string
// A token that ensures idempotency. This token expires in 10 minutes.
ClientToken *string
noSmithyDocumentSerde
}
type EnableUserOutput struct {
// The unique identifier for the enabled user account.
UserId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationEnableUserMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpEnableUser{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpEnableUser{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opEnableUserMiddleware(stack, options); err != nil {
return err
}
if err = addOpEnableUserValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableUser(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpEnableUser struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpEnableUser) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpEnableUser) 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.(*EnableUserInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *EnableUserInput ")
}
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_opEnableUserMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpEnableUser{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opEnableUser(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "EnableUser",
}
}
| 167 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Get information about a Changeset.
func (c *Client) GetChangeset(ctx context.Context, params *GetChangesetInput, optFns ...func(*Options)) (*GetChangesetOutput, error) {
if params == nil {
params = &GetChangesetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetChangeset", params, optFns, c.addOperationGetChangesetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetChangesetOutput)
out.ResultMetadata = metadata
return out, nil
}
// Request to describe a changeset.
type GetChangesetInput struct {
// The unique identifier of the Changeset for which to get data.
//
// This member is required.
ChangesetId *string
// The unique identifier for the FinSpace Dataset where the Changeset is created.
//
// This member is required.
DatasetId *string
noSmithyDocumentSerde
}
// The response from a describe changeset operation
type GetChangesetOutput struct {
// Beginning time from which the Changeset is active. The value is determined as
// epoch time in milliseconds. For example, the value for Monday, November 1, 2021
// 12:00:00 PM UTC is specified as 1635768000000.
ActiveFromTimestamp *int64
// Time until which the Changeset is active. The value is determined as epoch time
// in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM
// UTC is specified as 1635768000000.
ActiveUntilTimestamp *int64
// Type that indicates how a Changeset is applied to a Dataset.
// - REPLACE – Changeset is considered as a replacement to all prior loaded
// Changesets.
// - APPEND – Changeset is considered as an addition to the end of all prior
// loaded Changesets.
// - MODIFY – Changeset is considered as a replacement to a specific prior
// ingested Changeset.
ChangeType types.ChangeType
// The ARN identifier of the Changeset.
ChangesetArn *string
// The unique identifier for a Changeset.
ChangesetId *string
// The timestamp at which the Changeset was created in FinSpace. The value is
// determined as epoch time in milliseconds. For example, the value for Monday,
// November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
CreateTime int64
// The unique identifier for the FinSpace Dataset where the Changeset is created.
DatasetId *string
// The structure with error messages.
ErrorInfo *types.ChangesetErrorInfo
// Structure of the source file(s).
FormatParams map[string]string
// Options that define the location of the data being ingested.
SourceParams map[string]string
// The status of Changeset creation operation.
Status types.IngestionStatus
// The unique identifier of the updated Changeset.
UpdatedByChangesetId *string
// The unique identifier of the Changeset that is being updated.
UpdatesChangesetId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetChangesetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetChangeset{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetChangeset{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetChangesetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetChangeset(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetChangeset(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "GetChangeset",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about a Dataset.
func (c *Client) GetDataset(ctx context.Context, params *GetDatasetInput, optFns ...func(*Options)) (*GetDatasetOutput, error) {
if params == nil {
params = &GetDatasetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDataset", params, optFns, c.addOperationGetDatasetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDatasetOutput)
out.ResultMetadata = metadata
return out, nil
}
// Request for the GetDataset operation.
type GetDatasetInput struct {
// The unique identifier for a Dataset.
//
// This member is required.
DatasetId *string
noSmithyDocumentSerde
}
// Response for the GetDataset operation
type GetDatasetOutput struct {
// The unique resource identifier for a Dataset.
Alias *string
// The timestamp at which the Dataset was created in FinSpace. The value is
// determined as epoch time in milliseconds. For example, the value for Monday,
// November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
CreateTime int64
// The ARN identifier of the Dataset.
DatasetArn *string
// A description of the Dataset.
DatasetDescription *string
// The unique identifier for a Dataset.
DatasetId *string
// Display title for a Dataset.
DatasetTitle *string
// The format in which Dataset data is structured.
// - TABULAR – Data is structured in a tabular format.
// - NON_TABULAR – Data is structured in a non-tabular format.
Kind types.DatasetKind
// The last time that the Dataset was modified. The value is determined as epoch
// time in milliseconds. For example, the value for Monday, November 1, 2021
// 12:00:00 PM UTC is specified as 1635768000000.
LastModifiedTime int64
// Definition for a schema on a tabular Dataset.
SchemaDefinition *types.SchemaUnion
// Status of the Dataset creation.
// - PENDING – Dataset is pending creation.
// - FAILED – Dataset creation has failed.
// - SUCCESS – Dataset creation has succeeded.
// - RUNNING – Dataset creation is running.
Status types.DatasetStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDatasetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDataset{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDataset{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetDatasetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataset(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetDataset(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "GetDataset",
}
}
| 167 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about a Dataview.
func (c *Client) GetDataView(ctx context.Context, params *GetDataViewInput, optFns ...func(*Options)) (*GetDataViewOutput, error) {
if params == nil {
params = &GetDataViewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDataView", params, optFns, c.addOperationGetDataViewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDataViewOutput)
out.ResultMetadata = metadata
return out, nil
}
// Request for retrieving a data view detail. Grouped / accessible within a
// dataset by its dataset id.
type GetDataViewInput struct {
// The unique identifier for the Dataview.
//
// This member is required.
DataViewId *string
// The unique identifier for the Dataset used in the Dataview.
//
// This member is required.
DatasetId *string
noSmithyDocumentSerde
}
// Response from retrieving a dataview, which includes details on the target
// database and table name
type GetDataViewOutput struct {
// Time range to use for the Dataview. The value is determined as epoch time in
// milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM
// UTC is specified as 1635768000000.
AsOfTimestamp *int64
// Flag to indicate Dataview should be updated automatically.
AutoUpdate bool
// The timestamp at which the Dataview was created in FinSpace. The value is
// determined as epoch time in milliseconds. For example, the value for Monday,
// November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
CreateTime int64
// The ARN identifier of the Dataview.
DataViewArn *string
// The unique identifier for the Dataview.
DataViewId *string
// The unique identifier for the Dataset used in the Dataview.
DatasetId *string
// Options that define the destination type for the Dataview.
DestinationTypeParams *types.DataViewDestinationTypeParams
// Information about an error that occurred for the Dataview.
ErrorInfo *types.DataViewErrorInfo
// The last time that a Dataview was modified. The value is determined as epoch
// time in milliseconds. For example, the value for Monday, November 1, 2021
// 12:00:00 PM UTC is specified as 1635768000000.
LastModifiedTime int64
// Ordered set of column names used to partition data.
PartitionColumns []string
// Columns to be used for sorting the data.
SortColumns []string
// The status of a Dataview creation.
// - RUNNING – Dataview creation is running.
// - STARTING – Dataview creation is starting.
// - FAILED – Dataview creation has failed.
// - CANCELLED – Dataview creation has been cancelled.
// - TIMEOUT – Dataview creation has timed out.
// - SUCCESS – Dataview creation has succeeded.
// - PENDING – Dataview creation is pending.
// - FAILED_CLEANUP_FAILED – Dataview creation failed and resource cleanup
// failed.
Status types.DataViewStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDataViewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDataView{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDataView{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetDataViewValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataView(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetDataView(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "GetDataView",
}
}
| 185 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the credentials to access the external Dataview from an S3 location. To
// call this API:
// - You must retrieve the programmatic credentials.
// - You must be a member of a FinSpace user group, where the dataset that you
// want to access has Read Dataset Data permissions.
func (c *Client) GetExternalDataViewAccessDetails(ctx context.Context, params *GetExternalDataViewAccessDetailsInput, optFns ...func(*Options)) (*GetExternalDataViewAccessDetailsOutput, error) {
if params == nil {
params = &GetExternalDataViewAccessDetailsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetExternalDataViewAccessDetails", params, optFns, c.addOperationGetExternalDataViewAccessDetailsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetExternalDataViewAccessDetailsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetExternalDataViewAccessDetailsInput struct {
// The unique identifier for the Dataview that you want to access.
//
// This member is required.
DataViewId *string
// The unique identifier for the Dataset.
//
// This member is required.
DatasetId *string
noSmithyDocumentSerde
}
type GetExternalDataViewAccessDetailsOutput struct {
// The credentials required to access the external Dataview from the S3 location.
Credentials *types.AwsCredentials
// The location where the external Dataview is stored.
S3Location *types.S3Location
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetExternalDataViewAccessDetailsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetExternalDataViewAccessDetails{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetExternalDataViewAccessDetails{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetExternalDataViewAccessDetailsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExternalDataViewAccessDetails(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetExternalDataViewAccessDetails(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "GetExternalDataViewAccessDetails",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the details of a specific permission group.
func (c *Client) GetPermissionGroup(ctx context.Context, params *GetPermissionGroupInput, optFns ...func(*Options)) (*GetPermissionGroupOutput, error) {
if params == nil {
params = &GetPermissionGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetPermissionGroup", params, optFns, c.addOperationGetPermissionGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetPermissionGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetPermissionGroupInput struct {
// The unique identifier for the permission group.
//
// This member is required.
PermissionGroupId *string
noSmithyDocumentSerde
}
type GetPermissionGroupOutput struct {
// The structure for a permission group.
PermissionGroup *types.PermissionGroup
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetPermissionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPermissionGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPermissionGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetPermissionGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPermissionGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetPermissionGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "GetPermissionGroup",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Request programmatic credentials to use with FinSpace SDK.
func (c *Client) GetProgrammaticAccessCredentials(ctx context.Context, params *GetProgrammaticAccessCredentialsInput, optFns ...func(*Options)) (*GetProgrammaticAccessCredentialsOutput, error) {
if params == nil {
params = &GetProgrammaticAccessCredentialsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetProgrammaticAccessCredentials", params, optFns, c.addOperationGetProgrammaticAccessCredentialsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetProgrammaticAccessCredentialsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Request for GetProgrammaticAccessCredentials operation
type GetProgrammaticAccessCredentialsInput struct {
// The FinSpace environment identifier.
//
// This member is required.
EnvironmentId *string
// The time duration in which the credentials remain valid.
DurationInMinutes int64
noSmithyDocumentSerde
}
// Response for GetProgrammaticAccessCredentials operation
type GetProgrammaticAccessCredentialsOutput struct {
// Returns the programmatic credentials.
Credentials *types.Credentials
// Returns the duration in which the credentials will remain valid.
DurationInMinutes int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetProgrammaticAccessCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProgrammaticAccessCredentials{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProgrammaticAccessCredentials{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetProgrammaticAccessCredentialsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetProgrammaticAccessCredentials(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetProgrammaticAccessCredentials(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "GetProgrammaticAccessCredentials",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves details for a specific user.
func (c *Client) GetUser(ctx context.Context, params *GetUserInput, optFns ...func(*Options)) (*GetUserOutput, error) {
if params == nil {
params = &GetUserInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetUser", params, optFns, c.addOperationGetUserMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetUserOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetUserInput struct {
// The unique identifier of the user to get data for.
//
// This member is required.
UserId *string
noSmithyDocumentSerde
}
type GetUserOutput struct {
// Indicates whether the user can use the GetProgrammaticAccessCredentials API to
// obtain credentials that can then be used to access other FinSpace Data API
// operations.
// - ENABLED – The user has permissions to use the APIs.
// - DISABLED – The user does not have permissions to use any APIs.
ApiAccess types.ApiAccess
// The ARN identifier of an AWS user or role that is allowed to call the
// GetProgrammaticAccessCredentials API to obtain a credentials token for a
// specific FinSpace user. This must be an IAM role within your FinSpace account.
ApiAccessPrincipalArn *string
// The timestamp at which the user account was created in FinSpace. The value is
// determined as epoch time in milliseconds.
CreateTime int64
// The email address that is associated with the user.
EmailAddress *string
// The first name of the user.
FirstName *string
// Describes the last time the user account was disabled. The value is determined
// as epoch time in milliseconds.
LastDisabledTime int64
// Describes the last time the user account was enabled. The value is determined
// as epoch time in milliseconds.
LastEnabledTime int64
// Describes the last time that the user logged into their account. The value is
// determined as epoch time in milliseconds.
LastLoginTime int64
// Describes the last time the user account was updated. The value is determined
// as epoch time in milliseconds.
LastModifiedTime int64
// The last name of the user.
LastName *string
// The current status of the user account.
// - CREATING – The user account creation is in progress.
// - ENABLED – The user account is created and is currently active.
// - DISABLED – The user account is currently inactive.
Status types.UserStatus
// Indicates the type of user.
// - SUPER_USER – A user with permission to all the functionality and data in
// FinSpace.
//
// - APP_USER – A user with specific permissions in FinSpace. The users are
// assigned permissions by adding them to a permission group.
Type types.UserType
// The unique identifier for the user account that is retrieved.
UserId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetUserMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetUser{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetUser{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetUserValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetUser(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetUser(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "GetUser",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// A temporary Amazon S3 location, where you can copy your files from a source
// location to stage or use as a scratch space in FinSpace notebook.
func (c *Client) GetWorkingLocation(ctx context.Context, params *GetWorkingLocationInput, optFns ...func(*Options)) (*GetWorkingLocationOutput, error) {
if params == nil {
params = &GetWorkingLocationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetWorkingLocation", params, optFns, c.addOperationGetWorkingLocationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetWorkingLocationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetWorkingLocationInput struct {
// Specify the type of the working location.
// - SAGEMAKER – Use the Amazon S3 location as a temporary location to store data
// content when working with FinSpace Notebooks that run on SageMaker studio.
// - INGESTION – Use the Amazon S3 location as a staging location to copy your
// data content and then use the location with the Changeset creation operation.
LocationType types.LocationType
noSmithyDocumentSerde
}
type GetWorkingLocationOutput struct {
// Returns the Amazon S3 bucket name for the working location.
S3Bucket *string
// Returns the Amazon S3 Path for the working location.
S3Path *string
// Returns the Amazon S3 URI for the working location.
S3Uri *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetWorkingLocationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWorkingLocation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWorkingLocation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); 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_opGetWorkingLocation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetWorkingLocation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "GetWorkingLocation",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the FinSpace Changesets for a Dataset.
func (c *Client) ListChangesets(ctx context.Context, params *ListChangesetsInput, optFns ...func(*Options)) (*ListChangesetsOutput, error) {
if params == nil {
params = &ListChangesetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListChangesets", params, optFns, c.addOperationListChangesetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListChangesetsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Request to ListChangesetsRequest. It exposes minimal query filters.
type ListChangesetsInput struct {
// The unique identifier for the FinSpace Dataset to which the Changeset belongs.
//
// This member is required.
DatasetId *string
// The maximum number of results per page.
MaxResults *int32
// A token that indicates where a results page should begin.
NextToken *string
noSmithyDocumentSerde
}
// Response to ListChangesetsResponse. This returns a list of dataset changesets
// that match the query criteria.
type ListChangesetsOutput struct {
// List of Changesets found.
Changesets []types.ChangesetSummary
// A token that indicates where a results page should begin.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListChangesetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListChangesets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListChangesets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListChangesetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListChangesets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListChangesetsAPIClient is a client that implements the ListChangesets
// operation.
type ListChangesetsAPIClient interface {
ListChangesets(context.Context, *ListChangesetsInput, ...func(*Options)) (*ListChangesetsOutput, error)
}
var _ ListChangesetsAPIClient = (*Client)(nil)
// ListChangesetsPaginatorOptions is the paginator options for ListChangesets
type ListChangesetsPaginatorOptions struct {
// The maximum number of results per page.
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
}
// ListChangesetsPaginator is a paginator for ListChangesets
type ListChangesetsPaginator struct {
options ListChangesetsPaginatorOptions
client ListChangesetsAPIClient
params *ListChangesetsInput
nextToken *string
firstPage bool
}
// NewListChangesetsPaginator returns a new ListChangesetsPaginator
func NewListChangesetsPaginator(client ListChangesetsAPIClient, params *ListChangesetsInput, optFns ...func(*ListChangesetsPaginatorOptions)) *ListChangesetsPaginator {
if params == nil {
params = &ListChangesetsInput{}
}
options := ListChangesetsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListChangesetsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListChangesetsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListChangesets page.
func (p *ListChangesetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChangesetsOutput, 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.ListChangesets(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_opListChangesets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "ListChangesets",
}
}
| 231 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all of the active Datasets that a user has access to.
func (c *Client) ListDatasets(ctx context.Context, params *ListDatasetsInput, optFns ...func(*Options)) (*ListDatasetsOutput, error) {
if params == nil {
params = &ListDatasetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDatasets", params, optFns, c.addOperationListDatasetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDatasetsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Request for the ListDatasets operation.
type ListDatasetsInput struct {
// The maximum number of results per page.
MaxResults *int32
// A token that indicates where a results page should begin.
NextToken *string
noSmithyDocumentSerde
}
// Response for the ListDatasets operation
type ListDatasetsOutput struct {
// List of Datasets.
Datasets []types.Dataset
// A token that indicates where a results page should begin.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDatasetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListDatasets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDatasets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); 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_opListDatasets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListDatasetsAPIClient is a client that implements the ListDatasets operation.
type ListDatasetsAPIClient interface {
ListDatasets(context.Context, *ListDatasetsInput, ...func(*Options)) (*ListDatasetsOutput, error)
}
var _ ListDatasetsAPIClient = (*Client)(nil)
// ListDatasetsPaginatorOptions is the paginator options for ListDatasets
type ListDatasetsPaginatorOptions struct {
// The maximum number of results per page.
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
}
// ListDatasetsPaginator is a paginator for ListDatasets
type ListDatasetsPaginator struct {
options ListDatasetsPaginatorOptions
client ListDatasetsAPIClient
params *ListDatasetsInput
nextToken *string
firstPage bool
}
// NewListDatasetsPaginator returns a new ListDatasetsPaginator
func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator {
if params == nil {
params = &ListDatasetsInput{}
}
options := ListDatasetsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListDatasetsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListDatasetsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListDatasets page.
func (p *ListDatasetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetsOutput, 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.ListDatasets(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_opListDatasets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "ListDatasets",
}
}
| 221 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all available Dataviews for a Dataset.
func (c *Client) ListDataViews(ctx context.Context, params *ListDataViewsInput, optFns ...func(*Options)) (*ListDataViewsOutput, error) {
if params == nil {
params = &ListDataViewsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDataViews", params, optFns, c.addOperationListDataViewsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDataViewsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Request for a list data views.
type ListDataViewsInput struct {
// The unique identifier of the Dataset for which to retrieve Dataviews.
//
// This member is required.
DatasetId *string
// The maximum number of results per page.
MaxResults *int32
// A token that indicates where a results page should begin.
NextToken *string
noSmithyDocumentSerde
}
type ListDataViewsOutput struct {
// A list of Dataviews.
DataViews []types.DataViewSummary
// A token that indicates where a results page should begin.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDataViewsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListDataViews{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDataViews{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListDataViewsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDataViews(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListDataViewsAPIClient is a client that implements the ListDataViews operation.
type ListDataViewsAPIClient interface {
ListDataViews(context.Context, *ListDataViewsInput, ...func(*Options)) (*ListDataViewsOutput, error)
}
var _ ListDataViewsAPIClient = (*Client)(nil)
// ListDataViewsPaginatorOptions is the paginator options for ListDataViews
type ListDataViewsPaginatorOptions struct {
// The maximum number of results per page.
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
}
// ListDataViewsPaginator is a paginator for ListDataViews
type ListDataViewsPaginator struct {
options ListDataViewsPaginatorOptions
client ListDataViewsAPIClient
params *ListDataViewsInput
nextToken *string
firstPage bool
}
// NewListDataViewsPaginator returns a new ListDataViewsPaginator
func NewListDataViewsPaginator(client ListDataViewsAPIClient, params *ListDataViewsInput, optFns ...func(*ListDataViewsPaginatorOptions)) *ListDataViewsPaginator {
if params == nil {
params = &ListDataViewsInput{}
}
options := ListDataViewsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListDataViewsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListDataViewsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListDataViews page.
func (p *ListDataViewsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataViewsOutput, 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.ListDataViews(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_opListDataViews(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "ListDataViews",
}
}
| 228 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all available permission groups in FinSpace.
func (c *Client) ListPermissionGroups(ctx context.Context, params *ListPermissionGroupsInput, optFns ...func(*Options)) (*ListPermissionGroupsOutput, error) {
if params == nil {
params = &ListPermissionGroupsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListPermissionGroups", params, optFns, c.addOperationListPermissionGroupsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListPermissionGroupsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListPermissionGroupsInput struct {
// The maximum number of results per page.
//
// This member is required.
MaxResults int32
// A token that indicates where a results page should begin.
NextToken *string
noSmithyDocumentSerde
}
type ListPermissionGroupsOutput struct {
// A token that indicates where a results page should begin.
NextToken *string
// A list of all the permission groups.
PermissionGroups []types.PermissionGroup
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListPermissionGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListPermissionGroups{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPermissionGroups{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListPermissionGroupsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPermissionGroups(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListPermissionGroupsAPIClient is a client that implements the
// ListPermissionGroups operation.
type ListPermissionGroupsAPIClient interface {
ListPermissionGroups(context.Context, *ListPermissionGroupsInput, ...func(*Options)) (*ListPermissionGroupsOutput, error)
}
var _ ListPermissionGroupsAPIClient = (*Client)(nil)
// ListPermissionGroupsPaginatorOptions is the paginator options for
// ListPermissionGroups
type ListPermissionGroupsPaginatorOptions struct {
// The maximum number of results per page.
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
}
// ListPermissionGroupsPaginator is a paginator for ListPermissionGroups
type ListPermissionGroupsPaginator struct {
options ListPermissionGroupsPaginatorOptions
client ListPermissionGroupsAPIClient
params *ListPermissionGroupsInput
nextToken *string
firstPage bool
}
// NewListPermissionGroupsPaginator returns a new ListPermissionGroupsPaginator
func NewListPermissionGroupsPaginator(client ListPermissionGroupsAPIClient, params *ListPermissionGroupsInput, optFns ...func(*ListPermissionGroupsPaginatorOptions)) *ListPermissionGroupsPaginator {
if params == nil {
params = &ListPermissionGroupsInput{}
}
options := ListPermissionGroupsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListPermissionGroupsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListPermissionGroupsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListPermissionGroups page.
func (p *ListPermissionGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionGroupsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListPermissionGroups(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_opListPermissionGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "ListPermissionGroups",
}
}
| 222 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all the permission groups that are associated with a specific user
// account.
func (c *Client) ListPermissionGroupsByUser(ctx context.Context, params *ListPermissionGroupsByUserInput, optFns ...func(*Options)) (*ListPermissionGroupsByUserOutput, error) {
if params == nil {
params = &ListPermissionGroupsByUserInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListPermissionGroupsByUser", params, optFns, c.addOperationListPermissionGroupsByUserMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListPermissionGroupsByUserOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListPermissionGroupsByUserInput struct {
// The maximum number of results per page.
//
// This member is required.
MaxResults int32
// The unique identifier for the user.
//
// This member is required.
UserId *string
// A token that indicates where a results page should begin.
NextToken *string
noSmithyDocumentSerde
}
type ListPermissionGroupsByUserOutput struct {
// A token that indicates where a results page should begin.
NextToken *string
// A list of returned permission groups.
PermissionGroups []types.PermissionGroupByUser
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListPermissionGroupsByUserMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListPermissionGroupsByUser{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPermissionGroupsByUser{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListPermissionGroupsByUserValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPermissionGroupsByUser(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListPermissionGroupsByUser(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "ListPermissionGroupsByUser",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all available user accounts in FinSpace.
func (c *Client) ListUsers(ctx context.Context, params *ListUsersInput, optFns ...func(*Options)) (*ListUsersOutput, error) {
if params == nil {
params = &ListUsersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListUsers", params, optFns, c.addOperationListUsersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListUsersOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListUsersInput struct {
// The maximum number of results per page.
//
// This member is required.
MaxResults int32
// A token that indicates where a results page should begin.
NextToken *string
noSmithyDocumentSerde
}
type ListUsersOutput struct {
// A token that indicates where a results page should begin.
NextToken *string
// A list of all the user accounts.
Users []types.User
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListUsers{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListUsers{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListUsersValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListUsers(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListUsersAPIClient is a client that implements the ListUsers operation.
type ListUsersAPIClient interface {
ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error)
}
var _ ListUsersAPIClient = (*Client)(nil)
// ListUsersPaginatorOptions is the paginator options for ListUsers
type ListUsersPaginatorOptions struct {
// The maximum number of results per page.
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
}
// ListUsersPaginator is a paginator for ListUsers
type ListUsersPaginator struct {
options ListUsersPaginatorOptions
client ListUsersAPIClient
params *ListUsersInput
nextToken *string
firstPage bool
}
// NewListUsersPaginator returns a new ListUsersPaginator
func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator {
if params == nil {
params = &ListUsersInput{}
}
options := ListUsersPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListUsersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListUsersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListUsers page.
func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListUsers(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_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "ListUsers",
}
}
| 220 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists details of all the users in a specific permission group.
func (c *Client) ListUsersByPermissionGroup(ctx context.Context, params *ListUsersByPermissionGroupInput, optFns ...func(*Options)) (*ListUsersByPermissionGroupOutput, error) {
if params == nil {
params = &ListUsersByPermissionGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListUsersByPermissionGroup", params, optFns, c.addOperationListUsersByPermissionGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListUsersByPermissionGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListUsersByPermissionGroupInput struct {
// The maximum number of results per page.
//
// This member is required.
MaxResults int32
// The unique identifier for the permission group.
//
// This member is required.
PermissionGroupId *string
// A token that indicates where a results page should begin.
NextToken *string
noSmithyDocumentSerde
}
type ListUsersByPermissionGroupOutput struct {
// A token that indicates where a results page should begin.
NextToken *string
// Lists details of all users in a specific permission group.
Users []types.UserByPermissionGroup
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListUsersByPermissionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListUsersByPermissionGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListUsersByPermissionGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListUsersByPermissionGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListUsersByPermissionGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListUsersByPermissionGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "ListUsersByPermissionGroup",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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"
)
// Resets the password for a specified user ID and generates a temporary one. Only
// a superuser can reset password for other users. Resetting the password
// immediately invalidates the previous password associated with the user.
func (c *Client) ResetUserPassword(ctx context.Context, params *ResetUserPasswordInput, optFns ...func(*Options)) (*ResetUserPasswordOutput, error) {
if params == nil {
params = &ResetUserPasswordInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ResetUserPassword", params, optFns, c.addOperationResetUserPasswordMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ResetUserPasswordOutput)
out.ResultMetadata = metadata
return out, nil
}
type ResetUserPasswordInput struct {
// The unique identifier of the user that a temporary password is requested for.
//
// This member is required.
UserId *string
// A token that ensures idempotency. This token expires in 10 minutes.
ClientToken *string
noSmithyDocumentSerde
}
type ResetUserPasswordOutput struct {
// A randomly generated temporary password for the requested user account. This
// password expires in 7 days.
TemporaryPassword *string
// The unique identifier of the user that a new password is generated for.
UserId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationResetUserPasswordMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpResetUserPassword{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpResetUserPassword{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opResetUserPasswordMiddleware(stack, options); err != nil {
return err
}
if err = addOpResetUserPasswordValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetUserPassword(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpResetUserPassword struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpResetUserPassword) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpResetUserPassword) 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.(*ResetUserPasswordInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *ResetUserPasswordInput ")
}
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_opResetUserPasswordMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpResetUserPassword{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opResetUserPassword(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "ResetUserPassword",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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 FinSpace Changeset.
func (c *Client) UpdateChangeset(ctx context.Context, params *UpdateChangesetInput, optFns ...func(*Options)) (*UpdateChangesetOutput, error) {
if params == nil {
params = &UpdateChangesetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateChangeset", params, optFns, c.addOperationUpdateChangesetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateChangesetOutput)
out.ResultMetadata = metadata
return out, nil
}
// Request to update an existing changeset.
type UpdateChangesetInput struct {
// The unique identifier for the Changeset to update.
//
// This member is required.
ChangesetId *string
// The unique identifier for the FinSpace Dataset in which the Changeset is
// created.
//
// This member is required.
DatasetId *string
// Options that define the structure of the source file(s) including the format
// type ( formatType ), header row ( withHeader ), data separation character (
// separator ) and the type of compression ( compression ). formatType is a
// required attribute and can have the following values:
// - PARQUET – Parquet source file format.
// - CSV – CSV source file format.
// - JSON – JSON source file format.
// - XML – XML source file format.
// Here is an example of how you could specify the formatParams : "formatParams":
// { "formatType": "CSV", "withHeader": "true", "separator": ",",
// "compression":"None" } Note that if you only provide formatType as CSV , the
// rest of the attributes will automatically default to CSV values as following: {
// "withHeader": "true", "separator": "," } For more information about supported
// file formats, see Supported Data Types and File Formats (https://docs.aws.amazon.com/finspace/latest/userguide/supported-data-types.html)
// in the FinSpace User Guide.
//
// This member is required.
FormatParams map[string]string
// Options that define the location of the data being ingested ( s3SourcePath ) and
// the source of the changeset ( sourceType ). Both s3SourcePath and sourceType
// are required attributes. Here is an example of how you could specify the
// sourceParams : "sourceParams": { "s3SourcePath":
// "s3://finspace-landing-us-east-2-bk7gcfvitndqa6ebnvys4d/scratch/wr5hh8pwkpqqkxa4sxrmcw/ingestion/equity.csv",
// "sourceType": "S3" } The S3 path that you specify must allow the FinSpace role
// access. To do that, you first need to configure the IAM policy on S3 bucket. For
// more information, see Loading data from an Amazon S3 Bucket using the FinSpace
// API (https://docs.aws.amazon.com/finspace/latest/data-api/fs-using-the-finspace-api.html#access-s3-buckets)
// section.
//
// This member is required.
SourceParams map[string]string
// A token that ensures idempotency. This token expires in 10 minutes.
ClientToken *string
noSmithyDocumentSerde
}
// The response from a update changeset operation.
type UpdateChangesetOutput struct {
// The unique identifier for the Changeset to update.
ChangesetId *string
// The unique identifier for the FinSpace Dataset in which the Changeset is
// created.
DatasetId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateChangesetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateChangeset{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateChangeset{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateChangesetMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateChangesetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateChangeset(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpUpdateChangeset struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateChangeset) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateChangeset) 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.(*UpdateChangesetInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateChangesetInput ")
}
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_opUpdateChangesetMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateChangeset{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateChangeset(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "UpdateChangeset",
}
}
| 212 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a FinSpace Dataset.
func (c *Client) UpdateDataset(ctx context.Context, params *UpdateDatasetInput, optFns ...func(*Options)) (*UpdateDatasetOutput, error) {
if params == nil {
params = &UpdateDatasetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateDataset", params, optFns, c.addOperationUpdateDatasetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateDatasetOutput)
out.ResultMetadata = metadata
return out, nil
}
// The request for an UpdateDataset operation
type UpdateDatasetInput struct {
// The unique identifier for the Dataset to update.
//
// This member is required.
DatasetId *string
// A display title for the Dataset.
//
// This member is required.
DatasetTitle *string
// The format in which the Dataset data is structured.
// - TABULAR – Data is structured in a tabular format.
// - NON_TABULAR – Data is structured in a non-tabular format.
//
// This member is required.
Kind types.DatasetKind
// The unique resource identifier for a Dataset.
Alias *string
// A token that ensures idempotency. This token expires in 10 minutes.
ClientToken *string
// A description for the Dataset.
DatasetDescription *string
// Definition for a schema on a tabular Dataset.
SchemaDefinition *types.SchemaUnion
noSmithyDocumentSerde
}
// The response from an UpdateDataset operation
type UpdateDatasetOutput struct {
// The unique identifier for updated Dataset.
DatasetId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateDatasetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDataset{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDataset{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateDatasetMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateDatasetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDataset(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpUpdateDataset struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateDataset) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateDataset) 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.(*UpdateDatasetInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateDatasetInput ")
}
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_opUpdateDatasetMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateDataset{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateDataset(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "UpdateDataset",
}
}
| 191 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Modifies the details of a permission group. You cannot modify a
// permissionGroupID .
func (c *Client) UpdatePermissionGroup(ctx context.Context, params *UpdatePermissionGroupInput, optFns ...func(*Options)) (*UpdatePermissionGroupOutput, error) {
if params == nil {
params = &UpdatePermissionGroupInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdatePermissionGroup", params, optFns, c.addOperationUpdatePermissionGroupMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdatePermissionGroupOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdatePermissionGroupInput struct {
// The unique identifier for the permission group to update.
//
// This member is required.
PermissionGroupId *string
// The permissions that are granted to a specific group for accessing the FinSpace
// application. When assigning application permissions, be aware that the
// permission ManageUsersAndGroups allows users to grant themselves or others
// access to any functionality in their FinSpace environment's application. It
// should only be granted to trusted users.
// - CreateDataset – Group members can create new datasets.
// - ManageClusters – Group members can manage Apache Spark clusters from
// FinSpace notebooks.
// - ManageUsersAndGroups – Group members can manage users and permission groups.
// This is a privileged permission that allows users to grant themselves or others
// access to any functionality in the application. It should only be granted to
// trusted users.
// - ManageAttributeSets – Group members can manage attribute sets.
// - ViewAuditData – Group members can view audit data.
// - AccessNotebooks – Group members will have access to FinSpace notebooks.
// - GetTemporaryCredentials – Group members can get temporary API credentials.
ApplicationPermissions []types.ApplicationPermission
// A token that ensures idempotency. This token expires in 10 minutes.
ClientToken *string
// A brief description for the permission group.
Description *string
// The name of the permission group.
Name *string
noSmithyDocumentSerde
}
type UpdatePermissionGroupOutput struct {
// The unique identifier for the updated permission group.
PermissionGroupId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdatePermissionGroupMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePermissionGroup{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePermissionGroup{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdatePermissionGroupMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdatePermissionGroupValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePermissionGroup(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpUpdatePermissionGroup struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdatePermissionGroup) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdatePermissionGroup) 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.(*UpdatePermissionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdatePermissionGroupInput ")
}
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_opUpdatePermissionGroupMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdatePermissionGroup{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdatePermissionGroup(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "UpdatePermissionGroup",
}
}
| 193 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Modifies the details of the specified user account. You cannot update the userId
// for a user.
func (c *Client) UpdateUser(ctx context.Context, params *UpdateUserInput, optFns ...func(*Options)) (*UpdateUserOutput, error) {
if params == nil {
params = &UpdateUserInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateUser", params, optFns, c.addOperationUpdateUserMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateUserOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateUserInput struct {
// The unique identifier for the user account to update.
//
// This member is required.
UserId *string
// The option to indicate whether the user can use the
// GetProgrammaticAccessCredentials API to obtain credentials that can then be used
// to access other FinSpace Data API operations.
// - ENABLED – The user has permissions to use the APIs.
// - DISABLED – The user does not have permissions to use any APIs.
ApiAccess types.ApiAccess
// The ARN identifier of an AWS user or role that is allowed to call the
// GetProgrammaticAccessCredentials API to obtain a credentials token for a
// specific FinSpace user. This must be an IAM role within your FinSpace account.
ApiAccessPrincipalArn *string
// A token that ensures idempotency. This token expires in 10 minutes.
ClientToken *string
// The first name of the user.
FirstName *string
// The last name of the user.
LastName *string
// The option to indicate the type of user.
// - SUPER_USER – A user with permission to all the functionality and data in
// FinSpace.
// - APP_USER – A user with specific permissions in FinSpace. The users are
// assigned permissions by adding them to a permission group.
Type types.UserType
noSmithyDocumentSerde
}
type UpdateUserOutput struct {
// The unique identifier of the updated user account.
UserId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateUserMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateUser{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateUser{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addRestJsonContentTypeCustomization(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opUpdateUserMiddleware(stack, options); err != nil {
return err
}
if err = addOpUpdateUserValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateUser(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpUpdateUser struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpUpdateUser) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpUpdateUser) 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.(*UpdateUserInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateUserInput ")
}
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_opUpdateUserMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateUser{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opUpdateUser(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "finspace-api",
OperationName: "UpdateUser",
}
}
| 194 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/finspacedata/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsRestjson1_deserializeOpAssociateUserToPermissionGroup struct {
}
func (*awsRestjson1_deserializeOpAssociateUserToPermissionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpAssociateUserToPermissionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorAssociateUserToPermissionGroup(response, &metadata)
}
output := &AssociateUserToPermissionGroupOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsAssociateUserToPermissionGroupOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorAssociateUserToPermissionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsAssociateUserToPermissionGroupOutput(v *AssociateUserToPermissionGroupOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
v.StatusCode = int32(response.StatusCode)
return nil
}
type awsRestjson1_deserializeOpCreateChangeset struct {
}
func (*awsRestjson1_deserializeOpCreateChangeset) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateChangeset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateChangeset(response, &metadata)
}
output := &CreateChangesetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateChangesetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateChangeset(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateChangesetOutput(v **CreateChangesetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateChangesetOutput
if *v == nil {
sv = &CreateChangesetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "changesetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetId to be of type string, got %T instead", value)
}
sv.ChangesetId = ptr.String(jtv)
}
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateDataset struct {
}
func (*awsRestjson1_deserializeOpCreateDataset) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateDataset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateDataset(response, &metadata)
}
output := &CreateDatasetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateDatasetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateDataset(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateDatasetOutput(v **CreateDatasetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateDatasetOutput
if *v == nil {
sv = &CreateDatasetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateDataView struct {
}
func (*awsRestjson1_deserializeOpCreateDataView) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateDataView) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateDataView(response, &metadata)
}
output := &CreateDataViewOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateDataViewOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateDataView(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateDataViewOutput(v **CreateDataViewOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateDataViewOutput
if *v == nil {
sv = &CreateDataViewOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
case "dataViewId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataViewId to be of type string, got %T instead", value)
}
sv.DataViewId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreatePermissionGroup struct {
}
func (*awsRestjson1_deserializeOpCreatePermissionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreatePermissionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreatePermissionGroup(response, &metadata)
}
output := &CreatePermissionGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreatePermissionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreatePermissionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreatePermissionGroupOutput(v **CreatePermissionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreatePermissionGroupOutput
if *v == nil {
sv = &CreatePermissionGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "permissionGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupId to be of type string, got %T instead", value)
}
sv.PermissionGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateUser struct {
}
func (*awsRestjson1_deserializeOpCreateUser) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateUser(response, &metadata)
}
output := &CreateUserOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateUserOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateUserOutput(v **CreateUserOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateUserOutput
if *v == nil {
sv = &CreateUserOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "userId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserId to be of type string, got %T instead", value)
}
sv.UserId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteDataset struct {
}
func (*awsRestjson1_deserializeOpDeleteDataset) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteDataset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataset(response, &metadata)
}
output := &DeleteDatasetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDeleteDatasetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteDataset(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteDatasetOutput(v **DeleteDatasetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteDatasetOutput
if *v == nil {
sv = &DeleteDatasetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeletePermissionGroup struct {
}
func (*awsRestjson1_deserializeOpDeletePermissionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeletePermissionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeletePermissionGroup(response, &metadata)
}
output := &DeletePermissionGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDeletePermissionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeletePermissionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeletePermissionGroupOutput(v **DeletePermissionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeletePermissionGroupOutput
if *v == nil {
sv = &DeletePermissionGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "permissionGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupId to be of type string, got %T instead", value)
}
sv.PermissionGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDisableUser struct {
}
func (*awsRestjson1_deserializeOpDisableUser) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDisableUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDisableUser(response, &metadata)
}
output := &DisableUserOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDisableUserOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDisableUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDisableUserOutput(v **DisableUserOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DisableUserOutput
if *v == nil {
sv = &DisableUserOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "userId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserId to be of type string, got %T instead", value)
}
sv.UserId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDisassociateUserFromPermissionGroup struct {
}
func (*awsRestjson1_deserializeOpDisassociateUserFromPermissionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDisassociateUserFromPermissionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDisassociateUserFromPermissionGroup(response, &metadata)
}
output := &DisassociateUserFromPermissionGroupOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsDisassociateUserFromPermissionGroupOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDisassociateUserFromPermissionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsDisassociateUserFromPermissionGroupOutput(v *DisassociateUserFromPermissionGroupOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
v.StatusCode = int32(response.StatusCode)
return nil
}
type awsRestjson1_deserializeOpEnableUser struct {
}
func (*awsRestjson1_deserializeOpEnableUser) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpEnableUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorEnableUser(response, &metadata)
}
output := &EnableUserOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentEnableUserOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorEnableUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentEnableUserOutput(v **EnableUserOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *EnableUserOutput
if *v == nil {
sv = &EnableUserOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "userId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserId to be of type string, got %T instead", value)
}
sv.UserId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetChangeset struct {
}
func (*awsRestjson1_deserializeOpGetChangeset) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetChangeset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetChangeset(response, &metadata)
}
output := &GetChangesetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetChangesetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetChangeset(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetChangesetOutput(v **GetChangesetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetChangesetOutput
if *v == nil {
sv = &GetChangesetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "activeFromTimestamp":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ActiveFromTimestamp = ptr.Int64(i64)
}
case "activeUntilTimestamp":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ActiveUntilTimestamp = ptr.Int64(i64)
}
case "changesetArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetArn to be of type string, got %T instead", value)
}
sv.ChangesetArn = ptr.String(jtv)
}
case "changesetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetId to be of type string, got %T instead", value)
}
sv.ChangesetId = ptr.String(jtv)
}
case "changeType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeType to be of type string, got %T instead", value)
}
sv.ChangeType = types.ChangeType(jtv)
}
case "createTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CreateTime = i64
}
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
case "errorInfo":
if err := awsRestjson1_deserializeDocumentChangesetErrorInfo(&sv.ErrorInfo, value); err != nil {
return err
}
case "formatParams":
if err := awsRestjson1_deserializeDocumentFormatParams(&sv.FormatParams, value); err != nil {
return err
}
case "sourceParams":
if err := awsRestjson1_deserializeDocumentSourceParams(&sv.SourceParams, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IngestionStatus to be of type string, got %T instead", value)
}
sv.Status = types.IngestionStatus(jtv)
}
case "updatedByChangesetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetId to be of type string, got %T instead", value)
}
sv.UpdatedByChangesetId = ptr.String(jtv)
}
case "updatesChangesetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetId to be of type string, got %T instead", value)
}
sv.UpdatesChangesetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDataset struct {
}
func (*awsRestjson1_deserializeOpGetDataset) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDataset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetDataset(response, &metadata)
}
output := &GetDatasetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetDatasetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetDataset(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDatasetOutput(v **GetDatasetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDatasetOutput
if *v == nil {
sv = &GetDatasetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "alias":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AliasString to be of type string, got %T instead", value)
}
sv.Alias = ptr.String(jtv)
}
case "createTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CreateTime = i64
}
case "datasetArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetArn to be of type string, got %T instead", value)
}
sv.DatasetArn = ptr.String(jtv)
}
case "datasetDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetDescription to be of type string, got %T instead", value)
}
sv.DatasetDescription = ptr.String(jtv)
}
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
case "datasetTitle":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetTitle to be of type string, got %T instead", value)
}
sv.DatasetTitle = ptr.String(jtv)
}
case "kind":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetKind to be of type string, got %T instead", value)
}
sv.Kind = types.DatasetKind(jtv)
}
case "lastModifiedTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastModifiedTime = i64
}
case "schemaDefinition":
if err := awsRestjson1_deserializeDocumentSchemaUnion(&sv.SchemaDefinition, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetStatus to be of type string, got %T instead", value)
}
sv.Status = types.DatasetStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDataView struct {
}
func (*awsRestjson1_deserializeOpGetDataView) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDataView) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetDataView(response, &metadata)
}
output := &GetDataViewOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetDataViewOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetDataView(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDataViewOutput(v **GetDataViewOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDataViewOutput
if *v == nil {
sv = &GetDataViewOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "asOfTimestamp":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.AsOfTimestamp = ptr.Int64(i64)
}
case "autoUpdate":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.AutoUpdate = jtv
}
case "createTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CreateTime = i64
}
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
case "dataViewArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataViewArn to be of type string, got %T instead", value)
}
sv.DataViewArn = ptr.String(jtv)
}
case "dataViewId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataViewId to be of type string, got %T instead", value)
}
sv.DataViewId = ptr.String(jtv)
}
case "destinationTypeParams":
if err := awsRestjson1_deserializeDocumentDataViewDestinationTypeParams(&sv.DestinationTypeParams, value); err != nil {
return err
}
case "errorInfo":
if err := awsRestjson1_deserializeDocumentDataViewErrorInfo(&sv.ErrorInfo, value); err != nil {
return err
}
case "lastModifiedTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastModifiedTime = i64
}
case "partitionColumns":
if err := awsRestjson1_deserializeDocumentPartitionColumnList(&sv.PartitionColumns, value); err != nil {
return err
}
case "sortColumns":
if err := awsRestjson1_deserializeDocumentSortColumnList(&sv.SortColumns, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataViewStatus to be of type string, got %T instead", value)
}
sv.Status = types.DataViewStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetExternalDataViewAccessDetails struct {
}
func (*awsRestjson1_deserializeOpGetExternalDataViewAccessDetails) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetExternalDataViewAccessDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetExternalDataViewAccessDetails(response, &metadata)
}
output := &GetExternalDataViewAccessDetailsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetExternalDataViewAccessDetailsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetExternalDataViewAccessDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetExternalDataViewAccessDetailsOutput(v **GetExternalDataViewAccessDetailsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetExternalDataViewAccessDetailsOutput
if *v == nil {
sv = &GetExternalDataViewAccessDetailsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "credentials":
if err := awsRestjson1_deserializeDocumentAwsCredentials(&sv.Credentials, value); err != nil {
return err
}
case "s3Location":
if err := awsRestjson1_deserializeDocumentS3Location(&sv.S3Location, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetPermissionGroup struct {
}
func (*awsRestjson1_deserializeOpGetPermissionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetPermissionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetPermissionGroup(response, &metadata)
}
output := &GetPermissionGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetPermissionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetPermissionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetPermissionGroupOutput(v **GetPermissionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetPermissionGroupOutput
if *v == nil {
sv = &GetPermissionGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "permissionGroup":
if err := awsRestjson1_deserializeDocumentPermissionGroup(&sv.PermissionGroup, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetProgrammaticAccessCredentials struct {
}
func (*awsRestjson1_deserializeOpGetProgrammaticAccessCredentials) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetProgrammaticAccessCredentials) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetProgrammaticAccessCredentials(response, &metadata)
}
output := &GetProgrammaticAccessCredentialsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetProgrammaticAccessCredentialsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetProgrammaticAccessCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetProgrammaticAccessCredentialsOutput(v **GetProgrammaticAccessCredentialsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetProgrammaticAccessCredentialsOutput
if *v == nil {
sv = &GetProgrammaticAccessCredentialsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "credentials":
if err := awsRestjson1_deserializeDocumentCredentials(&sv.Credentials, value); err != nil {
return err
}
case "durationInMinutes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SessionDuration to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInMinutes = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetUser struct {
}
func (*awsRestjson1_deserializeOpGetUser) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetUser(response, &metadata)
}
output := &GetUserOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetUserOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetUserOutput(v **GetUserOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetUserOutput
if *v == nil {
sv = &GetUserOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "apiAccess":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApiAccess to be of type string, got %T instead", value)
}
sv.ApiAccess = types.ApiAccess(jtv)
}
case "apiAccessPrincipalArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.ApiAccessPrincipalArn = ptr.String(jtv)
}
case "createTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CreateTime = i64
}
case "emailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Email to be of type string, got %T instead", value)
}
sv.EmailAddress = ptr.String(jtv)
}
case "firstName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FirstName to be of type string, got %T instead", value)
}
sv.FirstName = ptr.String(jtv)
}
case "lastDisabledTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastDisabledTime = i64
}
case "lastEnabledTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastEnabledTime = i64
}
case "lastLoginTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastLoginTime = i64
}
case "lastModifiedTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastModifiedTime = i64
}
case "lastName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LastName to be of type string, got %T instead", value)
}
sv.LastName = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserStatus to be of type string, got %T instead", value)
}
sv.Status = types.UserStatus(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserType to be of type string, got %T instead", value)
}
sv.Type = types.UserType(jtv)
}
case "userId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserId to be of type string, got %T instead", value)
}
sv.UserId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetWorkingLocation struct {
}
func (*awsRestjson1_deserializeOpGetWorkingLocation) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetWorkingLocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetWorkingLocation(response, &metadata)
}
output := &GetWorkingLocationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetWorkingLocationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetWorkingLocation(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetWorkingLocationOutput(v **GetWorkingLocationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetWorkingLocationOutput
if *v == nil {
sv = &GetWorkingLocationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "s3Bucket":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected stringValueLength1to63 to be of type string, got %T instead", value)
}
sv.S3Bucket = ptr.String(jtv)
}
case "s3Path":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected stringValueLength1to1024 to be of type string, got %T instead", value)
}
sv.S3Path = ptr.String(jtv)
}
case "s3Uri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected stringValueLength1to1024 to be of type string, got %T instead", value)
}
sv.S3Uri = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListChangesets struct {
}
func (*awsRestjson1_deserializeOpListChangesets) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListChangesets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListChangesets(response, &metadata)
}
output := &ListChangesetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListChangesetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListChangesets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListChangesetsOutput(v **ListChangesetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListChangesetsOutput
if *v == nil {
sv = &ListChangesetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "changesets":
if err := awsRestjson1_deserializeDocumentChangesetList(&sv.Changesets, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListDatasets struct {
}
func (*awsRestjson1_deserializeOpListDatasets) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListDatasets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListDatasets(response, &metadata)
}
output := &ListDatasetsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListDatasetsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListDatasets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListDatasetsOutput(v **ListDatasetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDatasetsOutput
if *v == nil {
sv = &ListDatasetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "datasets":
if err := awsRestjson1_deserializeDocumentDatasetList(&sv.Datasets, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListDataViews struct {
}
func (*awsRestjson1_deserializeOpListDataViews) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListDataViews) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListDataViews(response, &metadata)
}
output := &ListDataViewsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListDataViewsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListDataViews(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListDataViewsOutput(v **ListDataViewsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDataViewsOutput
if *v == nil {
sv = &ListDataViewsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "dataViews":
if err := awsRestjson1_deserializeDocumentDataViewList(&sv.DataViews, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListPermissionGroups struct {
}
func (*awsRestjson1_deserializeOpListPermissionGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListPermissionGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListPermissionGroups(response, &metadata)
}
output := &ListPermissionGroupsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListPermissionGroupsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListPermissionGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListPermissionGroupsOutput(v **ListPermissionGroupsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListPermissionGroupsOutput
if *v == nil {
sv = &ListPermissionGroupsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "permissionGroups":
if err := awsRestjson1_deserializeDocumentPermissionGroupList(&sv.PermissionGroups, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListPermissionGroupsByUser struct {
}
func (*awsRestjson1_deserializeOpListPermissionGroupsByUser) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListPermissionGroupsByUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListPermissionGroupsByUser(response, &metadata)
}
output := &ListPermissionGroupsByUserOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListPermissionGroupsByUserOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListPermissionGroupsByUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListPermissionGroupsByUserOutput(v **ListPermissionGroupsByUserOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListPermissionGroupsByUserOutput
if *v == nil {
sv = &ListPermissionGroupsByUserOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "permissionGroups":
if err := awsRestjson1_deserializeDocumentPermissionGroupByUserList(&sv.PermissionGroups, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListUsers struct {
}
func (*awsRestjson1_deserializeOpListUsers) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListUsers(response, &metadata)
}
output := &ListUsersOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListUsersOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListUsersOutput
if *v == nil {
sv = &ListUsersOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "users":
if err := awsRestjson1_deserializeDocumentUserList(&sv.Users, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListUsersByPermissionGroup struct {
}
func (*awsRestjson1_deserializeOpListUsersByPermissionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListUsersByPermissionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListUsersByPermissionGroup(response, &metadata)
}
output := &ListUsersByPermissionGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListUsersByPermissionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListUsersByPermissionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListUsersByPermissionGroupOutput(v **ListUsersByPermissionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListUsersByPermissionGroupOutput
if *v == nil {
sv = &ListUsersByPermissionGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "users":
if err := awsRestjson1_deserializeDocumentUserByPermissionGroupList(&sv.Users, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpResetUserPassword struct {
}
func (*awsRestjson1_deserializeOpResetUserPassword) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpResetUserPassword) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorResetUserPassword(response, &metadata)
}
output := &ResetUserPasswordOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentResetUserPasswordOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorResetUserPassword(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentResetUserPasswordOutput(v **ResetUserPasswordOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ResetUserPasswordOutput
if *v == nil {
sv = &ResetUserPasswordOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "temporaryPassword":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Password to be of type string, got %T instead", value)
}
sv.TemporaryPassword = ptr.String(jtv)
}
case "userId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserId to be of type string, got %T instead", value)
}
sv.UserId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateChangeset struct {
}
func (*awsRestjson1_deserializeOpUpdateChangeset) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateChangeset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdateChangeset(response, &metadata)
}
output := &UpdateChangesetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateChangesetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateChangeset(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateChangesetOutput(v **UpdateChangesetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateChangesetOutput
if *v == nil {
sv = &UpdateChangesetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "changesetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetId to be of type string, got %T instead", value)
}
sv.ChangesetId = ptr.String(jtv)
}
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateDataset struct {
}
func (*awsRestjson1_deserializeOpUpdateDataset) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateDataset) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataset(response, &metadata)
}
output := &UpdateDatasetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateDatasetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateDataset(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateDatasetOutput(v **UpdateDatasetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateDatasetOutput
if *v == nil {
sv = &UpdateDatasetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdatePermissionGroup struct {
}
func (*awsRestjson1_deserializeOpUpdatePermissionGroup) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdatePermissionGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdatePermissionGroup(response, &metadata)
}
output := &UpdatePermissionGroupOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdatePermissionGroupOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdatePermissionGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdatePermissionGroupOutput(v **UpdatePermissionGroupOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdatePermissionGroupOutput
if *v == nil {
sv = &UpdatePermissionGroupOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "permissionGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupId to be of type string, got %T instead", value)
}
sv.PermissionGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateUser struct {
}
func (*awsRestjson1_deserializeOpUpdateUser) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdateUser(response, &metadata)
}
output := &UpdateUserOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateUserOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateUser(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateUserOutput(v **UpdateUserOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateUserOutput
if *v == nil {
sv = &UpdateUserOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "userId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserId to be of type string, got %T instead", value)
}
sv.UserId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AccessDeniedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ConflictException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServerException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.LimitExceededException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentLimitExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceNotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ThrottlingException{}
return output
}
func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ValidationException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentValidationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AccessDeniedException
if *v == nil {
sv = &types.AccessDeniedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentApplicationPermissionList(v *[]types.ApplicationPermission, 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.ApplicationPermission
if *v == nil {
cv = []types.ApplicationPermission{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ApplicationPermission
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApplicationPermission to be of type string, got %T instead", value)
}
col = types.ApplicationPermission(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAwsCredentials(v **types.AwsCredentials, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AwsCredentials
if *v == nil {
sv = &types.AwsCredentials{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "accessKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccessKeyId to be of type string, got %T instead", value)
}
sv.AccessKeyId = ptr.String(jtv)
}
case "expiration":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Expiration = i64
}
case "secretAccessKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SecretAccessKey to be of type string, got %T instead", value)
}
sv.SecretAccessKey = ptr.String(jtv)
}
case "sessionToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SessionToken to be of type string, got %T instead", value)
}
sv.SessionToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentChangesetErrorInfo(v **types.ChangesetErrorInfo, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ChangesetErrorInfo
if *v == nil {
sv = &types.ChangesetErrorInfo{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCategory":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCategory to be of type string, got %T instead", value)
}
sv.ErrorCategory = types.ErrorCategory(jtv)
}
case "errorMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.ErrorMessage = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentChangesetList(v *[]types.ChangesetSummary, 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.ChangesetSummary
if *v == nil {
cv = []types.ChangesetSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ChangesetSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentChangesetSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentChangesetSummary(v **types.ChangesetSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ChangesetSummary
if *v == nil {
sv = &types.ChangesetSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "activeFromTimestamp":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ActiveFromTimestamp = ptr.Int64(i64)
}
case "activeUntilTimestamp":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ActiveUntilTimestamp = ptr.Int64(i64)
}
case "changesetArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetArn to be of type string, got %T instead", value)
}
sv.ChangesetArn = ptr.String(jtv)
}
case "changesetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetId to be of type string, got %T instead", value)
}
sv.ChangesetId = ptr.String(jtv)
}
case "changeType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangeType to be of type string, got %T instead", value)
}
sv.ChangeType = types.ChangeType(jtv)
}
case "createTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CreateTime = i64
}
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
case "errorInfo":
if err := awsRestjson1_deserializeDocumentChangesetErrorInfo(&sv.ErrorInfo, value); err != nil {
return err
}
case "formatParams":
if err := awsRestjson1_deserializeDocumentFormatParams(&sv.FormatParams, value); err != nil {
return err
}
case "sourceParams":
if err := awsRestjson1_deserializeDocumentSourceParams(&sv.SourceParams, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IngestionStatus to be of type string, got %T instead", value)
}
sv.Status = types.IngestionStatus(jtv)
}
case "updatedByChangesetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetId to be of type string, got %T instead", value)
}
sv.UpdatedByChangesetId = ptr.String(jtv)
}
case "updatesChangesetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChangesetId to be of type string, got %T instead", value)
}
sv.UpdatesChangesetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentColumnDefinition(v **types.ColumnDefinition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ColumnDefinition
if *v == nil {
sv = &types.ColumnDefinition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "columnDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ColumnDescription to be of type string, got %T instead", value)
}
sv.ColumnDescription = ptr.String(jtv)
}
case "columnName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ColumnName to be of type string, got %T instead", value)
}
sv.ColumnName = ptr.String(jtv)
}
case "dataType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ColumnDataType to be of type string, got %T instead", value)
}
sv.DataType = types.ColumnDataType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentColumnList(v *[]types.ColumnDefinition, 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.ColumnDefinition
if *v == nil {
cv = []types.ColumnDefinition{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ColumnDefinition
destAddr := &col
if err := awsRestjson1_deserializeDocumentColumnDefinition(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentColumnNameList(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 ColumnName to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCredentials(v **types.Credentials, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Credentials
if *v == nil {
sv = &types.Credentials{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "accessKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StringValueLength1to2552 to be of type string, got %T instead", value)
}
sv.AccessKeyId = ptr.String(jtv)
}
case "secretAccessKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected stringValueMaxLength1000 to be of type string, got %T instead", value)
}
sv.SecretAccessKey = ptr.String(jtv)
}
case "sessionToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected stringValueMaxLength1000 to be of type string, got %T instead", value)
}
sv.SessionToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataset(v **types.Dataset, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Dataset
if *v == nil {
sv = &types.Dataset{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "alias":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AliasString to be of type string, got %T instead", value)
}
sv.Alias = ptr.String(jtv)
}
case "createTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CreateTime = i64
}
case "datasetArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetArn to be of type string, got %T instead", value)
}
sv.DatasetArn = ptr.String(jtv)
}
case "datasetDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetDescription to be of type string, got %T instead", value)
}
sv.DatasetDescription = ptr.String(jtv)
}
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
case "datasetTitle":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetTitle to be of type string, got %T instead", value)
}
sv.DatasetTitle = ptr.String(jtv)
}
case "kind":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetKind to be of type string, got %T instead", value)
}
sv.Kind = types.DatasetKind(jtv)
}
case "lastModifiedTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastModifiedTime = i64
}
case "ownerInfo":
if err := awsRestjson1_deserializeDocumentDatasetOwnerInfo(&sv.OwnerInfo, value); err != nil {
return err
}
case "schemaDefinition":
if err := awsRestjson1_deserializeDocumentSchemaUnion(&sv.SchemaDefinition, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDatasetList(v *[]types.Dataset, 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.Dataset
if *v == nil {
cv = []types.Dataset{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Dataset
destAddr := &col
if err := awsRestjson1_deserializeDocumentDataset(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDatasetOwnerInfo(v **types.DatasetOwnerInfo, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DatasetOwnerInfo
if *v == nil {
sv = &types.DatasetOwnerInfo{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "email":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Email to be of type string, got %T instead", value)
}
sv.Email = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OwnerName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "phoneNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value)
}
sv.PhoneNumber = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataViewDestinationTypeParams(v **types.DataViewDestinationTypeParams, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DataViewDestinationTypeParams
if *v == nil {
sv = &types.DataViewDestinationTypeParams{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "destinationType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataViewDestinationType to be of type string, got %T instead", value)
}
sv.DestinationType = ptr.String(jtv)
}
case "s3DestinationExportFileFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExportFileFormat to be of type string, got %T instead", value)
}
sv.S3DestinationExportFileFormat = types.ExportFileFormat(jtv)
}
case "s3DestinationExportFileFormatOptions":
if err := awsRestjson1_deserializeDocumentS3DestinationFormatOptions(&sv.S3DestinationExportFileFormatOptions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataViewErrorInfo(v **types.DataViewErrorInfo, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DataViewErrorInfo
if *v == nil {
sv = &types.DataViewErrorInfo{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCategory":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCategory to be of type string, got %T instead", value)
}
sv.ErrorCategory = types.ErrorCategory(jtv)
}
case "errorMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.ErrorMessage = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataViewList(v *[]types.DataViewSummary, 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.DataViewSummary
if *v == nil {
cv = []types.DataViewSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DataViewSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentDataViewSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDataViewSummary(v **types.DataViewSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DataViewSummary
if *v == nil {
sv = &types.DataViewSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "asOfTimestamp":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.AsOfTimestamp = ptr.Int64(i64)
}
case "autoUpdate":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.AutoUpdate = jtv
}
case "createTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CreateTime = i64
}
case "datasetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DatasetId to be of type string, got %T instead", value)
}
sv.DatasetId = ptr.String(jtv)
}
case "dataViewArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataViewArn to be of type string, got %T instead", value)
}
sv.DataViewArn = ptr.String(jtv)
}
case "dataViewId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataViewId to be of type string, got %T instead", value)
}
sv.DataViewId = ptr.String(jtv)
}
case "destinationTypeProperties":
if err := awsRestjson1_deserializeDocumentDataViewDestinationTypeParams(&sv.DestinationTypeProperties, value); err != nil {
return err
}
case "errorInfo":
if err := awsRestjson1_deserializeDocumentDataViewErrorInfo(&sv.ErrorInfo, value); err != nil {
return err
}
case "lastModifiedTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastModifiedTime = i64
}
case "partitionColumns":
if err := awsRestjson1_deserializeDocumentPartitionColumnList(&sv.PartitionColumns, value); err != nil {
return err
}
case "sortColumns":
if err := awsRestjson1_deserializeDocumentSortColumnList(&sv.SortColumns, value); err != nil {
return err
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataViewStatus to be of type string, got %T instead", value)
}
sv.Status = types.DataViewStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentFormatParams(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StringMapValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerException
if *v == nil {
sv = &types.InternalServerException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LimitExceededException
if *v == nil {
sv = &types.LimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPartitionColumnList(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 StringValueLength1to255 to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentPermissionGroup(v **types.PermissionGroup, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.PermissionGroup
if *v == nil {
sv = &types.PermissionGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationPermissions":
if err := awsRestjson1_deserializeDocumentApplicationPermissionList(&sv.ApplicationPermissions, value); err != nil {
return err
}
case "createTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CreateTime = i64
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "lastModifiedTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastModifiedTime = i64
}
case "membershipStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupMembershipStatus to be of type string, got %T instead", value)
}
sv.MembershipStatus = types.PermissionGroupMembershipStatus(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "permissionGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupId to be of type string, got %T instead", value)
}
sv.PermissionGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPermissionGroupByUser(v **types.PermissionGroupByUser, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.PermissionGroupByUser
if *v == nil {
sv = &types.PermissionGroupByUser{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "membershipStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupMembershipStatus to be of type string, got %T instead", value)
}
sv.MembershipStatus = types.PermissionGroupMembershipStatus(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "permissionGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupId to be of type string, got %T instead", value)
}
sv.PermissionGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPermissionGroupByUserList(v *[]types.PermissionGroupByUser, 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.PermissionGroupByUser
if *v == nil {
cv = []types.PermissionGroupByUser{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PermissionGroupByUser
destAddr := &col
if err := awsRestjson1_deserializeDocumentPermissionGroupByUser(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentPermissionGroupList(v *[]types.PermissionGroup, 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.PermissionGroup
if *v == nil {
cv = []types.PermissionGroup{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PermissionGroup
destAddr := &col
if err := awsRestjson1_deserializeDocumentPermissionGroup(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentS3DestinationFormatOptions(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StringMapValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentS3Location(v **types.S3Location, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.S3Location
if *v == nil {
sv = &types.S3Location{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "bucket":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value)
}
sv.Bucket = ptr.String(jtv)
}
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3Key to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSchemaDefinition(v **types.SchemaDefinition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SchemaDefinition
if *v == nil {
sv = &types.SchemaDefinition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "columns":
if err := awsRestjson1_deserializeDocumentColumnList(&sv.Columns, value); err != nil {
return err
}
case "primaryKeyColumns":
if err := awsRestjson1_deserializeDocumentColumnNameList(&sv.PrimaryKeyColumns, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSchemaUnion(v **types.SchemaUnion, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SchemaUnion
if *v == nil {
sv = &types.SchemaUnion{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "tabularSchemaConfig":
if err := awsRestjson1_deserializeDocumentSchemaDefinition(&sv.TabularSchemaConfig, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSortColumnList(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 StringValueLength1to255 to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSourceParams(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StringMapValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ThrottlingException
if *v == nil {
sv = &types.ThrottlingException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentUser(v **types.User, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.User
if *v == nil {
sv = &types.User{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "apiAccess":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApiAccess to be of type string, got %T instead", value)
}
sv.ApiAccess = types.ApiAccess(jtv)
}
case "apiAccessPrincipalArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.ApiAccessPrincipalArn = ptr.String(jtv)
}
case "createTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CreateTime = i64
}
case "emailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Email to be of type string, got %T instead", value)
}
sv.EmailAddress = ptr.String(jtv)
}
case "firstName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FirstName to be of type string, got %T instead", value)
}
sv.FirstName = ptr.String(jtv)
}
case "lastDisabledTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastDisabledTime = i64
}
case "lastEnabledTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastEnabledTime = i64
}
case "lastLoginTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastLoginTime = i64
}
case "lastModifiedTime":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected TimestampEpoch to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastModifiedTime = i64
}
case "lastName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LastName to be of type string, got %T instead", value)
}
sv.LastName = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserStatus to be of type string, got %T instead", value)
}
sv.Status = types.UserStatus(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserType to be of type string, got %T instead", value)
}
sv.Type = types.UserType(jtv)
}
case "userId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserId to be of type string, got %T instead", value)
}
sv.UserId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentUserByPermissionGroup(v **types.UserByPermissionGroup, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.UserByPermissionGroup
if *v == nil {
sv = &types.UserByPermissionGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "apiAccess":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApiAccess to be of type string, got %T instead", value)
}
sv.ApiAccess = types.ApiAccess(jtv)
}
case "apiAccessPrincipalArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.ApiAccessPrincipalArn = ptr.String(jtv)
}
case "emailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Email to be of type string, got %T instead", value)
}
sv.EmailAddress = ptr.String(jtv)
}
case "firstName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FirstName to be of type string, got %T instead", value)
}
sv.FirstName = ptr.String(jtv)
}
case "lastName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LastName to be of type string, got %T instead", value)
}
sv.LastName = ptr.String(jtv)
}
case "membershipStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PermissionGroupMembershipStatus to be of type string, got %T instead", value)
}
sv.MembershipStatus = types.PermissionGroupMembershipStatus(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserStatus to be of type string, got %T instead", value)
}
sv.Status = types.UserStatus(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserType to be of type string, got %T instead", value)
}
sv.Type = types.UserType(jtv)
}
case "userId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UserId to be of type string, got %T instead", value)
}
sv.UserId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentUserByPermissionGroupList(v *[]types.UserByPermissionGroup, 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.UserByPermissionGroup
if *v == nil {
cv = []types.UserByPermissionGroup{}
} else {
cv = *v
}
for _, value := range shape {
var col types.UserByPermissionGroup
destAddr := &col
if err := awsRestjson1_deserializeDocumentUserByPermissionGroup(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentUserList(v *[]types.User, 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.User
if *v == nil {
cv = []types.User{}
} else {
cv = *v
}
for _, value := range shape {
var col types.User
destAddr := &col
if err := awsRestjson1_deserializeDocumentUser(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 7,944 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package finspacedata provides the API client, operations, and parameter types
// for FinSpace Public API.
//
// The FinSpace APIs let you take actions inside the FinSpace.
package finspacedata
| 8 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
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/finspacedata/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 = "finspace-api"
}
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 finspacedata
// 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 finspacedata
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/finspacedata/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpAssociateUserToPermissionGroup struct {
}
func (*awsRestjson1_serializeOpAssociateUserToPermissionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAssociateUserToPermissionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AssociateUserToPermissionGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/permission-group/{permissionGroupId}/users/{userId}")
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_serializeOpHttpBindingsAssociateUserToPermissionGroupInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentAssociateUserToPermissionGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAssociateUserToPermissionGroupInput(v *AssociateUserToPermissionGroupInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PermissionGroupId == nil || len(*v.PermissionGroupId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member permissionGroupId must not be empty")}
}
if v.PermissionGroupId != nil {
if err := encoder.SetURI("permissionGroupId").String(*v.PermissionGroupId); err != nil {
return err
}
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentAssociateUserToPermissionGroupInput(v *AssociateUserToPermissionGroupInput, 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_serializeOpCreateChangeset struct {
}
func (*awsRestjson1_serializeOpCreateChangeset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateChangeset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateChangesetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}/changesetsv2")
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_serializeOpHttpBindingsCreateChangesetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateChangesetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateChangesetInput(v *CreateChangesetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateChangesetInput(v *CreateChangesetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ChangeType) > 0 {
ok := object.Key("changeType")
ok.String(string(v.ChangeType))
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.FormatParams != nil {
ok := object.Key("formatParams")
if err := awsRestjson1_serializeDocumentFormatParams(v.FormatParams, ok); err != nil {
return err
}
}
if v.SourceParams != nil {
ok := object.Key("sourceParams")
if err := awsRestjson1_serializeDocumentSourceParams(v.SourceParams, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateDataset struct {
}
func (*awsRestjson1_serializeOpCreateDataset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDatasetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasetsv2")
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_serializeOpDocumentCreateDatasetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDatasetInput(v *CreateDatasetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDatasetInput(v *CreateDatasetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Alias != nil {
ok := object.Key("alias")
ok.String(*v.Alias)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.DatasetDescription != nil {
ok := object.Key("datasetDescription")
ok.String(*v.DatasetDescription)
}
if v.DatasetTitle != nil {
ok := object.Key("datasetTitle")
ok.String(*v.DatasetTitle)
}
if len(v.Kind) > 0 {
ok := object.Key("kind")
ok.String(string(v.Kind))
}
if v.OwnerInfo != nil {
ok := object.Key("ownerInfo")
if err := awsRestjson1_serializeDocumentDatasetOwnerInfo(v.OwnerInfo, ok); err != nil {
return err
}
}
if v.PermissionGroupParams != nil {
ok := object.Key("permissionGroupParams")
if err := awsRestjson1_serializeDocumentPermissionGroupParams(v.PermissionGroupParams, ok); err != nil {
return err
}
}
if v.SchemaDefinition != nil {
ok := object.Key("schemaDefinition")
if err := awsRestjson1_serializeDocumentSchemaUnion(v.SchemaDefinition, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateDataView struct {
}
func (*awsRestjson1_serializeOpCreateDataView) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDataView) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDataViewInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}/dataviewsv2")
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_serializeOpHttpBindingsCreateDataViewInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateDataViewInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDataViewInput(v *CreateDataViewInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDataViewInput(v *CreateDataViewInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AsOfTimestamp != nil {
ok := object.Key("asOfTimestamp")
ok.Long(*v.AsOfTimestamp)
}
if v.AutoUpdate {
ok := object.Key("autoUpdate")
ok.Boolean(v.AutoUpdate)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.DestinationTypeParams != nil {
ok := object.Key("destinationTypeParams")
if err := awsRestjson1_serializeDocumentDataViewDestinationTypeParams(v.DestinationTypeParams, ok); err != nil {
return err
}
}
if v.PartitionColumns != nil {
ok := object.Key("partitionColumns")
if err := awsRestjson1_serializeDocumentPartitionColumnList(v.PartitionColumns, ok); err != nil {
return err
}
}
if v.SortColumns != nil {
ok := object.Key("sortColumns")
if err := awsRestjson1_serializeDocumentSortColumnList(v.SortColumns, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreatePermissionGroup struct {
}
func (*awsRestjson1_serializeOpCreatePermissionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreatePermissionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreatePermissionGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/permission-group")
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_serializeOpDocumentCreatePermissionGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreatePermissionGroupInput(v *CreatePermissionGroupInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreatePermissionGroupInput(v *CreatePermissionGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationPermissions != nil {
ok := object.Key("applicationPermissions")
if err := awsRestjson1_serializeDocumentApplicationPermissionList(v.ApplicationPermissions, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
type awsRestjson1_serializeOpCreateUser struct {
}
func (*awsRestjson1_serializeOpCreateUser) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateUserInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/user")
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_serializeOpDocumentCreateUserInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateUserInput(v *CreateUserInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateUserInput(v *CreateUserInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ApiAccess) > 0 {
ok := object.Key("ApiAccess")
ok.String(string(v.ApiAccess))
}
if v.ApiAccessPrincipalArn != nil {
ok := object.Key("apiAccessPrincipalArn")
ok.String(*v.ApiAccessPrincipalArn)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.EmailAddress != nil {
ok := object.Key("emailAddress")
ok.String(*v.EmailAddress)
}
if v.FirstName != nil {
ok := object.Key("firstName")
ok.String(*v.FirstName)
}
if v.LastName != nil {
ok := object.Key("lastName")
ok.String(*v.LastName)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
type awsRestjson1_serializeOpDeleteDataset struct {
}
func (*awsRestjson1_serializeOpDeleteDataset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDatasetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasetsv2/{datasetId}")
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_serializeOpHttpBindingsDeleteDatasetInput(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_serializeOpHttpBindingsDeleteDatasetInput(v *DeleteDatasetInput, 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.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeletePermissionGroup struct {
}
func (*awsRestjson1_serializeOpDeletePermissionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeletePermissionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeletePermissionGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/permission-group/{permissionGroupId}")
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_serializeOpHttpBindingsDeletePermissionGroupInput(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_serializeOpHttpBindingsDeletePermissionGroupInput(v *DeletePermissionGroupInput, 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.PermissionGroupId == nil || len(*v.PermissionGroupId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member permissionGroupId must not be empty")}
}
if v.PermissionGroupId != nil {
if err := encoder.SetURI("permissionGroupId").String(*v.PermissionGroupId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDisableUser struct {
}
func (*awsRestjson1_serializeOpDisableUser) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDisableUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisableUserInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/user/{userId}/disable")
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_serializeOpHttpBindingsDisableUserInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDisableUserInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDisableUserInput(v *DisableUserInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentDisableUserInput(v *DisableUserInput, 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_serializeOpDisassociateUserFromPermissionGroup struct {
}
func (*awsRestjson1_serializeOpDisassociateUserFromPermissionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDisassociateUserFromPermissionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisassociateUserFromPermissionGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/permission-group/{permissionGroupId}/users/{userId}")
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_serializeOpHttpBindingsDisassociateUserFromPermissionGroupInput(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_serializeOpHttpBindingsDisassociateUserFromPermissionGroupInput(v *DisassociateUserFromPermissionGroupInput, 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.PermissionGroupId == nil || len(*v.PermissionGroupId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member permissionGroupId must not be empty")}
}
if v.PermissionGroupId != nil {
if err := encoder.SetURI("permissionGroupId").String(*v.PermissionGroupId); err != nil {
return err
}
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpEnableUser struct {
}
func (*awsRestjson1_serializeOpEnableUser) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpEnableUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*EnableUserInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/user/{userId}/enable")
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_serializeOpHttpBindingsEnableUserInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentEnableUserInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsEnableUserInput(v *EnableUserInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentEnableUserInput(v *EnableUserInput, 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_serializeOpGetChangeset struct {
}
func (*awsRestjson1_serializeOpGetChangeset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetChangeset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetChangesetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}/changesetsv2/{changesetId}")
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_serializeOpHttpBindingsGetChangesetInput(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_serializeOpHttpBindingsGetChangesetInput(v *GetChangesetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ChangesetId == nil || len(*v.ChangesetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member changesetId must not be empty")}
}
if v.ChangesetId != nil {
if err := encoder.SetURI("changesetId").String(*v.ChangesetId); err != nil {
return err
}
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetDataset struct {
}
func (*awsRestjson1_serializeOpGetDataset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDatasetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasetsv2/{datasetId}")
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_serializeOpHttpBindingsGetDatasetInput(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_serializeOpHttpBindingsGetDatasetInput(v *GetDatasetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetDataView struct {
}
func (*awsRestjson1_serializeOpGetDataView) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDataView) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDataViewInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}/dataviewsv2/{dataViewId}")
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_serializeOpHttpBindingsGetDataViewInput(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_serializeOpHttpBindingsGetDataViewInput(v *GetDataViewInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
if v.DataViewId == nil || len(*v.DataViewId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member dataViewId must not be empty")}
}
if v.DataViewId != nil {
if err := encoder.SetURI("dataViewId").String(*v.DataViewId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetExternalDataViewAccessDetails struct {
}
func (*awsRestjson1_serializeOpGetExternalDataViewAccessDetails) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetExternalDataViewAccessDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetExternalDataViewAccessDetailsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}/dataviewsv2/{dataViewId}/external-access-details")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetExternalDataViewAccessDetailsInput(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_serializeOpHttpBindingsGetExternalDataViewAccessDetailsInput(v *GetExternalDataViewAccessDetailsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
if v.DataViewId == nil || len(*v.DataViewId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member dataViewId must not be empty")}
}
if v.DataViewId != nil {
if err := encoder.SetURI("dataViewId").String(*v.DataViewId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetPermissionGroup struct {
}
func (*awsRestjson1_serializeOpGetPermissionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetPermissionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetPermissionGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/permission-group/{permissionGroupId}")
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_serializeOpHttpBindingsGetPermissionGroupInput(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_serializeOpHttpBindingsGetPermissionGroupInput(v *GetPermissionGroupInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PermissionGroupId == nil || len(*v.PermissionGroupId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member permissionGroupId must not be empty")}
}
if v.PermissionGroupId != nil {
if err := encoder.SetURI("permissionGroupId").String(*v.PermissionGroupId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetProgrammaticAccessCredentials struct {
}
func (*awsRestjson1_serializeOpGetProgrammaticAccessCredentials) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetProgrammaticAccessCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetProgrammaticAccessCredentialsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/credentials/programmatic")
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_serializeOpHttpBindingsGetProgrammaticAccessCredentialsInput(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_serializeOpHttpBindingsGetProgrammaticAccessCredentialsInput(v *GetProgrammaticAccessCredentialsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DurationInMinutes != 0 {
encoder.SetQuery("durationInMinutes").Long(v.DurationInMinutes)
}
if v.EnvironmentId != nil {
encoder.SetQuery("environmentId").String(*v.EnvironmentId)
}
return nil
}
type awsRestjson1_serializeOpGetUser struct {
}
func (*awsRestjson1_serializeOpGetUser) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetUserInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/user/{userId}")
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_serializeOpHttpBindingsGetUserInput(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_serializeOpHttpBindingsGetUserInput(v *GetUserInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetWorkingLocation struct {
}
func (*awsRestjson1_serializeOpGetWorkingLocation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetWorkingLocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetWorkingLocationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/workingLocationV1")
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_serializeOpDocumentGetWorkingLocationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsGetWorkingLocationInput(v *GetWorkingLocationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentGetWorkingLocationInput(v *GetWorkingLocationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.LocationType) > 0 {
ok := object.Key("locationType")
ok.String(string(v.LocationType))
}
return nil
}
type awsRestjson1_serializeOpListChangesets struct {
}
func (*awsRestjson1_serializeOpListChangesets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListChangesets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListChangesetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}/changesetsv2")
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_serializeOpHttpBindingsListChangesetsInput(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_serializeOpHttpBindingsListChangesetsInput(v *ListChangesetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListDatasets struct {
}
func (*awsRestjson1_serializeOpListDatasets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDatasets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListDatasetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasetsv2")
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_serializeOpHttpBindingsListDatasetsInput(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_serializeOpHttpBindingsListDatasetsInput(v *ListDatasetsInput, 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_serializeOpListDataViews struct {
}
func (*awsRestjson1_serializeOpListDataViews) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDataViews) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListDataViewsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}/dataviewsv2")
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_serializeOpHttpBindingsListDataViewsInput(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_serializeOpHttpBindingsListDataViewsInput(v *ListDataViewsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListPermissionGroups struct {
}
func (*awsRestjson1_serializeOpListPermissionGroups) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListPermissionGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListPermissionGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/permission-group")
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_serializeOpHttpBindingsListPermissionGroupsInput(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_serializeOpHttpBindingsListPermissionGroupsInput(v *ListPermissionGroupsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
{
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListPermissionGroupsByUser struct {
}
func (*awsRestjson1_serializeOpListPermissionGroupsByUser) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListPermissionGroupsByUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListPermissionGroupsByUserInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/user/{userId}/permission-groups")
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_serializeOpHttpBindingsListPermissionGroupsByUserInput(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_serializeOpHttpBindingsListPermissionGroupsByUserInput(v *ListPermissionGroupsByUserInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
{
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListUsers struct {
}
func (*awsRestjson1_serializeOpListUsers) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListUsers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListUsersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/user")
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_serializeOpHttpBindingsListUsersInput(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_serializeOpHttpBindingsListUsersInput(v *ListUsersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
{
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListUsersByPermissionGroup struct {
}
func (*awsRestjson1_serializeOpListUsersByPermissionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListUsersByPermissionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListUsersByPermissionGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/permission-group/{permissionGroupId}/users")
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_serializeOpHttpBindingsListUsersByPermissionGroupInput(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_serializeOpHttpBindingsListUsersByPermissionGroupInput(v *ListUsersByPermissionGroupInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
{
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PermissionGroupId == nil || len(*v.PermissionGroupId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member permissionGroupId must not be empty")}
}
if v.PermissionGroupId != nil {
if err := encoder.SetURI("permissionGroupId").String(*v.PermissionGroupId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpResetUserPassword struct {
}
func (*awsRestjson1_serializeOpResetUserPassword) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpResetUserPassword) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ResetUserPasswordInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/user/{userId}/password")
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_serializeOpHttpBindingsResetUserPasswordInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentResetUserPasswordInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsResetUserPasswordInput(v *ResetUserPasswordInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentResetUserPasswordInput(v *ResetUserPasswordInput, 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_serializeOpUpdateChangeset struct {
}
func (*awsRestjson1_serializeOpUpdateChangeset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateChangeset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateChangesetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}/changesetsv2/{changesetId}")
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_serializeOpHttpBindingsUpdateChangesetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateChangesetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateChangesetInput(v *UpdateChangesetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ChangesetId == nil || len(*v.ChangesetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member changesetId must not be empty")}
}
if v.ChangesetId != nil {
if err := encoder.SetURI("changesetId").String(*v.ChangesetId); err != nil {
return err
}
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateChangesetInput(v *UpdateChangesetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.FormatParams != nil {
ok := object.Key("formatParams")
if err := awsRestjson1_serializeDocumentFormatParams(v.FormatParams, ok); err != nil {
return err
}
}
if v.SourceParams != nil {
ok := object.Key("sourceParams")
if err := awsRestjson1_serializeDocumentSourceParams(v.SourceParams, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateDataset struct {
}
func (*awsRestjson1_serializeOpUpdateDataset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateDatasetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasetsv2/{datasetId}")
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_serializeOpHttpBindingsUpdateDatasetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateDatasetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateDatasetInput(v *UpdateDatasetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateDatasetInput(v *UpdateDatasetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Alias != nil {
ok := object.Key("alias")
ok.String(*v.Alias)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.DatasetDescription != nil {
ok := object.Key("datasetDescription")
ok.String(*v.DatasetDescription)
}
if v.DatasetTitle != nil {
ok := object.Key("datasetTitle")
ok.String(*v.DatasetTitle)
}
if len(v.Kind) > 0 {
ok := object.Key("kind")
ok.String(string(v.Kind))
}
if v.SchemaDefinition != nil {
ok := object.Key("schemaDefinition")
if err := awsRestjson1_serializeDocumentSchemaUnion(v.SchemaDefinition, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdatePermissionGroup struct {
}
func (*awsRestjson1_serializeOpUpdatePermissionGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdatePermissionGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdatePermissionGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/permission-group/{permissionGroupId}")
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_serializeOpHttpBindingsUpdatePermissionGroupInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdatePermissionGroupInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdatePermissionGroupInput(v *UpdatePermissionGroupInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PermissionGroupId == nil || len(*v.PermissionGroupId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member permissionGroupId must not be empty")}
}
if v.PermissionGroupId != nil {
if err := encoder.SetURI("permissionGroupId").String(*v.PermissionGroupId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdatePermissionGroupInput(v *UpdatePermissionGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationPermissions != nil {
ok := object.Key("applicationPermissions")
if err := awsRestjson1_serializeDocumentApplicationPermissionList(v.ApplicationPermissions, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
type awsRestjson1_serializeOpUpdateUser struct {
}
func (*awsRestjson1_serializeOpUpdateUser) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateUserInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/user/{userId}")
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_serializeOpHttpBindingsUpdateUserInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateUserInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateUserInput(v *UpdateUserInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateUserInput(v *UpdateUserInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ApiAccess) > 0 {
ok := object.Key("apiAccess")
ok.String(string(v.ApiAccess))
}
if v.ApiAccessPrincipalArn != nil {
ok := object.Key("apiAccessPrincipalArn")
ok.String(*v.ApiAccessPrincipalArn)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.FirstName != nil {
ok := object.Key("firstName")
ok.String(*v.FirstName)
}
if v.LastName != nil {
ok := object.Key("lastName")
ok.String(*v.LastName)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentApplicationPermissionList(v []types.ApplicationPermission, 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_serializeDocumentColumnDefinition(v *types.ColumnDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ColumnDescription != nil {
ok := object.Key("columnDescription")
ok.String(*v.ColumnDescription)
}
if v.ColumnName != nil {
ok := object.Key("columnName")
ok.String(*v.ColumnName)
}
if len(v.DataType) > 0 {
ok := object.Key("dataType")
ok.String(string(v.DataType))
}
return nil
}
func awsRestjson1_serializeDocumentColumnList(v []types.ColumnDefinition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentColumnDefinition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentColumnNameList(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_serializeDocumentDatasetOwnerInfo(v *types.DatasetOwnerInfo, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Email != nil {
ok := object.Key("email")
ok.String(*v.Email)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.PhoneNumber != nil {
ok := object.Key("phoneNumber")
ok.String(*v.PhoneNumber)
}
return nil
}
func awsRestjson1_serializeDocumentDataViewDestinationTypeParams(v *types.DataViewDestinationTypeParams, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DestinationType != nil {
ok := object.Key("destinationType")
ok.String(*v.DestinationType)
}
if len(v.S3DestinationExportFileFormat) > 0 {
ok := object.Key("s3DestinationExportFileFormat")
ok.String(string(v.S3DestinationExportFileFormat))
}
if v.S3DestinationExportFileFormatOptions != nil {
ok := object.Key("s3DestinationExportFileFormatOptions")
if err := awsRestjson1_serializeDocumentS3DestinationFormatOptions(v.S3DestinationExportFileFormatOptions, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFormatParams(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_serializeDocumentPartitionColumnList(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_serializeDocumentPermissionGroupParams(v *types.PermissionGroupParams, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DatasetPermissions != nil {
ok := object.Key("datasetPermissions")
if err := awsRestjson1_serializeDocumentResourcePermissionsList(v.DatasetPermissions, ok); err != nil {
return err
}
}
if v.PermissionGroupId != nil {
ok := object.Key("permissionGroupId")
ok.String(*v.PermissionGroupId)
}
return nil
}
func awsRestjson1_serializeDocumentResourcePermission(v *types.ResourcePermission, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Permission != nil {
ok := object.Key("permission")
ok.String(*v.Permission)
}
return nil
}
func awsRestjson1_serializeDocumentResourcePermissionsList(v []types.ResourcePermission, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentResourcePermission(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentS3DestinationFormatOptions(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_serializeDocumentSchemaDefinition(v *types.SchemaDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Columns != nil {
ok := object.Key("columns")
if err := awsRestjson1_serializeDocumentColumnList(v.Columns, ok); err != nil {
return err
}
}
if v.PrimaryKeyColumns != nil {
ok := object.Key("primaryKeyColumns")
if err := awsRestjson1_serializeDocumentColumnNameList(v.PrimaryKeyColumns, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSchemaUnion(v *types.SchemaUnion, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TabularSchemaConfig != nil {
ok := object.Key("tabularSchemaConfig")
if err := awsRestjson1_serializeDocumentSchemaDefinition(v.TabularSchemaConfig, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSortColumnList(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_serializeDocumentSourceParams(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
}
| 2,636 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package finspacedata
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/finspacedata/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAssociateUserToPermissionGroup struct {
}
func (*validateOpAssociateUserToPermissionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAssociateUserToPermissionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AssociateUserToPermissionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAssociateUserToPermissionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateChangeset struct {
}
func (*validateOpCreateChangeset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateChangeset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateChangesetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateChangesetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDataset struct {
}
func (*validateOpCreateDataset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDatasetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDatasetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDataView struct {
}
func (*validateOpCreateDataView) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDataView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDataViewInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDataViewInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreatePermissionGroup struct {
}
func (*validateOpCreatePermissionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreatePermissionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreatePermissionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreatePermissionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateUser struct {
}
func (*validateOpCreateUser) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateUserInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateUserInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDataset struct {
}
func (*validateOpDeleteDataset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDatasetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDatasetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeletePermissionGroup struct {
}
func (*validateOpDeletePermissionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeletePermissionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeletePermissionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeletePermissionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisableUser struct {
}
func (*validateOpDisableUser) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisableUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisableUserInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisableUserInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisassociateUserFromPermissionGroup struct {
}
func (*validateOpDisassociateUserFromPermissionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisassociateUserFromPermissionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisassociateUserFromPermissionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisassociateUserFromPermissionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpEnableUser struct {
}
func (*validateOpEnableUser) ID() string {
return "OperationInputValidation"
}
func (m *validateOpEnableUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*EnableUserInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpEnableUserInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetChangeset struct {
}
func (*validateOpGetChangeset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetChangeset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetChangesetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetChangesetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDataset struct {
}
func (*validateOpGetDataset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDatasetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDatasetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDataView struct {
}
func (*validateOpGetDataView) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDataView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDataViewInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDataViewInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetExternalDataViewAccessDetails struct {
}
func (*validateOpGetExternalDataViewAccessDetails) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetExternalDataViewAccessDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetExternalDataViewAccessDetailsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetExternalDataViewAccessDetailsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetPermissionGroup struct {
}
func (*validateOpGetPermissionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetPermissionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetPermissionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetPermissionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetProgrammaticAccessCredentials struct {
}
func (*validateOpGetProgrammaticAccessCredentials) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetProgrammaticAccessCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetProgrammaticAccessCredentialsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetProgrammaticAccessCredentialsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetUser struct {
}
func (*validateOpGetUser) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetUserInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetUserInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListChangesets struct {
}
func (*validateOpListChangesets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListChangesets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListChangesetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListChangesetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListDataViews struct {
}
func (*validateOpListDataViews) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListDataViews) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListDataViewsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListDataViewsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListPermissionGroupsByUser struct {
}
func (*validateOpListPermissionGroupsByUser) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListPermissionGroupsByUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListPermissionGroupsByUserInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListPermissionGroupsByUserInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListPermissionGroups struct {
}
func (*validateOpListPermissionGroups) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListPermissionGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListPermissionGroupsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListPermissionGroupsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListUsersByPermissionGroup struct {
}
func (*validateOpListUsersByPermissionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListUsersByPermissionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListUsersByPermissionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListUsersByPermissionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListUsers struct {
}
func (*validateOpListUsers) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListUsers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListUsersInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListUsersInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpResetUserPassword struct {
}
func (*validateOpResetUserPassword) ID() string {
return "OperationInputValidation"
}
func (m *validateOpResetUserPassword) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ResetUserPasswordInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpResetUserPasswordInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateChangeset struct {
}
func (*validateOpUpdateChangeset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateChangeset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateChangesetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateChangesetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateDataset struct {
}
func (*validateOpUpdateDataset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateDatasetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateDatasetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdatePermissionGroup struct {
}
func (*validateOpUpdatePermissionGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdatePermissionGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdatePermissionGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdatePermissionGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateUser struct {
}
func (*validateOpUpdateUser) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateUser) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateUserInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateUserInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAssociateUserToPermissionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAssociateUserToPermissionGroup{}, middleware.After)
}
func addOpCreateChangesetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateChangeset{}, middleware.After)
}
func addOpCreateDatasetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDataset{}, middleware.After)
}
func addOpCreateDataViewValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDataView{}, middleware.After)
}
func addOpCreatePermissionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreatePermissionGroup{}, middleware.After)
}
func addOpCreateUserValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateUser{}, middleware.After)
}
func addOpDeleteDatasetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDataset{}, middleware.After)
}
func addOpDeletePermissionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeletePermissionGroup{}, middleware.After)
}
func addOpDisableUserValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisableUser{}, middleware.After)
}
func addOpDisassociateUserFromPermissionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisassociateUserFromPermissionGroup{}, middleware.After)
}
func addOpEnableUserValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpEnableUser{}, middleware.After)
}
func addOpGetChangesetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetChangeset{}, middleware.After)
}
func addOpGetDatasetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDataset{}, middleware.After)
}
func addOpGetDataViewValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDataView{}, middleware.After)
}
func addOpGetExternalDataViewAccessDetailsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetExternalDataViewAccessDetails{}, middleware.After)
}
func addOpGetPermissionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetPermissionGroup{}, middleware.After)
}
func addOpGetProgrammaticAccessCredentialsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetProgrammaticAccessCredentials{}, middleware.After)
}
func addOpGetUserValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetUser{}, middleware.After)
}
func addOpListChangesetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListChangesets{}, middleware.After)
}
func addOpListDataViewsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListDataViews{}, middleware.After)
}
func addOpListPermissionGroupsByUserValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListPermissionGroupsByUser{}, middleware.After)
}
func addOpListPermissionGroupsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListPermissionGroups{}, middleware.After)
}
func addOpListUsersByPermissionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListUsersByPermissionGroup{}, middleware.After)
}
func addOpListUsersValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListUsers{}, middleware.After)
}
func addOpResetUserPasswordValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpResetUserPassword{}, middleware.After)
}
func addOpUpdateChangesetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateChangeset{}, middleware.After)
}
func addOpUpdateDatasetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateDataset{}, middleware.After)
}
func addOpUpdatePermissionGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdatePermissionGroup{}, middleware.After)
}
func addOpUpdateUserValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateUser{}, middleware.After)
}
func validateDataViewDestinationTypeParams(v *types.DataViewDestinationTypeParams) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DataViewDestinationTypeParams"}
if v.DestinationType == nil {
invalidParams.Add(smithy.NewErrParamRequired("DestinationType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAssociateUserToPermissionGroupInput(v *AssociateUserToPermissionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AssociateUserToPermissionGroupInput"}
if v.PermissionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PermissionGroupId"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateChangesetInput(v *CreateChangesetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateChangesetInput"}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if len(v.ChangeType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ChangeType"))
}
if v.SourceParams == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceParams"))
}
if v.FormatParams == nil {
invalidParams.Add(smithy.NewErrParamRequired("FormatParams"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDatasetInput(v *CreateDatasetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDatasetInput"}
if v.DatasetTitle == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetTitle"))
}
if len(v.Kind) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Kind"))
}
if v.PermissionGroupParams == nil {
invalidParams.Add(smithy.NewErrParamRequired("PermissionGroupParams"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDataViewInput(v *CreateDataViewInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDataViewInput"}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if v.DestinationTypeParams == nil {
invalidParams.Add(smithy.NewErrParamRequired("DestinationTypeParams"))
} else if v.DestinationTypeParams != nil {
if err := validateDataViewDestinationTypeParams(v.DestinationTypeParams); err != nil {
invalidParams.AddNested("DestinationTypeParams", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreatePermissionGroupInput(v *CreatePermissionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreatePermissionGroupInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ApplicationPermissions == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationPermissions"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateUserInput(v *CreateUserInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateUserInput"}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDatasetInput(v *DeleteDatasetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDatasetInput"}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeletePermissionGroupInput(v *DeletePermissionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeletePermissionGroupInput"}
if v.PermissionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PermissionGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisableUserInput(v *DisableUserInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisableUserInput"}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisassociateUserFromPermissionGroupInput(v *DisassociateUserFromPermissionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisassociateUserFromPermissionGroupInput"}
if v.PermissionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PermissionGroupId"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpEnableUserInput(v *EnableUserInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EnableUserInput"}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetChangesetInput(v *GetChangesetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetChangesetInput"}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if v.ChangesetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangesetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDatasetInput(v *GetDatasetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDatasetInput"}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDataViewInput(v *GetDataViewInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDataViewInput"}
if v.DataViewId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataViewId"))
}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetExternalDataViewAccessDetailsInput(v *GetExternalDataViewAccessDetailsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetExternalDataViewAccessDetailsInput"}
if v.DataViewId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataViewId"))
}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetPermissionGroupInput(v *GetPermissionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetPermissionGroupInput"}
if v.PermissionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PermissionGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetProgrammaticAccessCredentialsInput(v *GetProgrammaticAccessCredentialsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetProgrammaticAccessCredentialsInput"}
if v.EnvironmentId == nil {
invalidParams.Add(smithy.NewErrParamRequired("EnvironmentId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetUserInput(v *GetUserInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetUserInput"}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListChangesetsInput(v *ListChangesetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListChangesetsInput"}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListDataViewsInput(v *ListDataViewsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListDataViewsInput"}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListPermissionGroupsByUserInput(v *ListPermissionGroupsByUserInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListPermissionGroupsByUserInput"}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListPermissionGroupsInput(v *ListPermissionGroupsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListPermissionGroupsInput"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListUsersByPermissionGroupInput(v *ListUsersByPermissionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListUsersByPermissionGroupInput"}
if v.PermissionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PermissionGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListUsersInput(v *ListUsersInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListUsersInput"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpResetUserPasswordInput(v *ResetUserPasswordInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ResetUserPasswordInput"}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateChangesetInput(v *UpdateChangesetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateChangesetInput"}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if v.ChangesetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChangesetId"))
}
if v.SourceParams == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceParams"))
}
if v.FormatParams == nil {
invalidParams.Add(smithy.NewErrParamRequired("FormatParams"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateDatasetInput(v *UpdateDatasetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateDatasetInput"}
if v.DatasetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetId"))
}
if v.DatasetTitle == nil {
invalidParams.Add(smithy.NewErrParamRequired("DatasetTitle"))
}
if len(v.Kind) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Kind"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdatePermissionGroupInput(v *UpdatePermissionGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdatePermissionGroupInput"}
if v.PermissionGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PermissionGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateUserInput(v *UpdateUserInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateUserInput"}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 1,210 |
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 finspace data 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: "finspace-api.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "finspace-api-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "finspace-api-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "finspace-api.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "finspace-api.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "finspace-api-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "finspace-api-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "finspace-api.{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: "finspace-api-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "finspace-api.{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: "finspace-api-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "finspace-api.{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: "finspace-api-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "finspace-api.{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: "finspace-api-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "finspace-api.{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: "finspace-api.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "finspace-api-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "finspace-api-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "finspace-api.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 314 |
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 ApiAccess string
// Enum values for ApiAccess
const (
ApiAccessEnabled ApiAccess = "ENABLED"
ApiAccessDisabled ApiAccess = "DISABLED"
)
// Values returns all known values for ApiAccess. 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 (ApiAccess) Values() []ApiAccess {
return []ApiAccess{
"ENABLED",
"DISABLED",
}
}
type ApplicationPermission string
// Enum values for ApplicationPermission
const (
ApplicationPermissionCreateDataset ApplicationPermission = "CreateDataset"
ApplicationPermissionManageClusters ApplicationPermission = "ManageClusters"
ApplicationPermissionManageUsersAndGroups ApplicationPermission = "ManageUsersAndGroups"
ApplicationPermissionManageAttributeSets ApplicationPermission = "ManageAttributeSets"
ApplicationPermissionViewAuditData ApplicationPermission = "ViewAuditData"
ApplicationPermissionAccessNotebooks ApplicationPermission = "AccessNotebooks"
ApplicationPermissionGetTemporaryCredentials ApplicationPermission = "GetTemporaryCredentials"
)
// Values returns all known values for ApplicationPermission. 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 (ApplicationPermission) Values() []ApplicationPermission {
return []ApplicationPermission{
"CreateDataset",
"ManageClusters",
"ManageUsersAndGroups",
"ManageAttributeSets",
"ViewAuditData",
"AccessNotebooks",
"GetTemporaryCredentials",
}
}
type ChangeType string
// Enum values for ChangeType
const (
ChangeTypeReplace ChangeType = "REPLACE"
ChangeTypeAppend ChangeType = "APPEND"
ChangeTypeModify ChangeType = "MODIFY"
)
// Values returns all known values for ChangeType. 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 (ChangeType) Values() []ChangeType {
return []ChangeType{
"REPLACE",
"APPEND",
"MODIFY",
}
}
type ColumnDataType string
// Enum values for ColumnDataType
const (
ColumnDataTypeString ColumnDataType = "STRING"
ColumnDataTypeChar ColumnDataType = "CHAR"
ColumnDataTypeInteger ColumnDataType = "INTEGER"
ColumnDataTypeTinyint ColumnDataType = "TINYINT"
ColumnDataTypeSmallint ColumnDataType = "SMALLINT"
ColumnDataTypeBigint ColumnDataType = "BIGINT"
ColumnDataTypeFloat ColumnDataType = "FLOAT"
ColumnDataTypeDouble ColumnDataType = "DOUBLE"
ColumnDataTypeDate ColumnDataType = "DATE"
ColumnDataTypeDatetime ColumnDataType = "DATETIME"
ColumnDataTypeBoolean ColumnDataType = "BOOLEAN"
ColumnDataTypeBinary ColumnDataType = "BINARY"
)
// Values returns all known values for ColumnDataType. 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 (ColumnDataType) Values() []ColumnDataType {
return []ColumnDataType{
"STRING",
"CHAR",
"INTEGER",
"TINYINT",
"SMALLINT",
"BIGINT",
"FLOAT",
"DOUBLE",
"DATE",
"DATETIME",
"BOOLEAN",
"BINARY",
}
}
type DatasetKind string
// Enum values for DatasetKind
const (
DatasetKindTabular DatasetKind = "TABULAR"
DatasetKindNonTabular DatasetKind = "NON_TABULAR"
)
// Values returns all known values for DatasetKind. 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 (DatasetKind) Values() []DatasetKind {
return []DatasetKind{
"TABULAR",
"NON_TABULAR",
}
}
type DatasetStatus string
// Enum values for DatasetStatus
const (
DatasetStatusPending DatasetStatus = "PENDING"
DatasetStatusFailed DatasetStatus = "FAILED"
DatasetStatusSuccess DatasetStatus = "SUCCESS"
DatasetStatusRunning DatasetStatus = "RUNNING"
)
// Values returns all known values for DatasetStatus. 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 (DatasetStatus) Values() []DatasetStatus {
return []DatasetStatus{
"PENDING",
"FAILED",
"SUCCESS",
"RUNNING",
}
}
type DataViewStatus string
// Enum values for DataViewStatus
const (
DataViewStatusRunning DataViewStatus = "RUNNING"
DataViewStatusStarting DataViewStatus = "STARTING"
DataViewStatusFailed DataViewStatus = "FAILED"
DataViewStatusCancelled DataViewStatus = "CANCELLED"
DataViewStatusTimeout DataViewStatus = "TIMEOUT"
DataViewStatusSuccess DataViewStatus = "SUCCESS"
DataViewStatusPending DataViewStatus = "PENDING"
DataViewStatusFailedCleanupFailed DataViewStatus = "FAILED_CLEANUP_FAILED"
)
// Values returns all known values for DataViewStatus. 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 (DataViewStatus) Values() []DataViewStatus {
return []DataViewStatus{
"RUNNING",
"STARTING",
"FAILED",
"CANCELLED",
"TIMEOUT",
"SUCCESS",
"PENDING",
"FAILED_CLEANUP_FAILED",
}
}
type ErrorCategory string
// Enum values for ErrorCategory
const (
ErrorCategoryValidation ErrorCategory = "VALIDATION"
ErrorCategoryServiceQuotaExceeded ErrorCategory = "SERVICE_QUOTA_EXCEEDED"
ErrorCategoryAccessDenied ErrorCategory = "ACCESS_DENIED"
ErrorCategoryResourceNotFound ErrorCategory = "RESOURCE_NOT_FOUND"
ErrorCategoryThrottling ErrorCategory = "THROTTLING"
ErrorCategoryInternalServiceException ErrorCategory = "INTERNAL_SERVICE_EXCEPTION"
ErrorCategoryCancelled ErrorCategory = "CANCELLED"
ErrorCategoryUserRecoverable ErrorCategory = "USER_RECOVERABLE"
)
// Values returns all known values for ErrorCategory. 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 (ErrorCategory) Values() []ErrorCategory {
return []ErrorCategory{
"VALIDATION",
"SERVICE_QUOTA_EXCEEDED",
"ACCESS_DENIED",
"RESOURCE_NOT_FOUND",
"THROTTLING",
"INTERNAL_SERVICE_EXCEPTION",
"CANCELLED",
"USER_RECOVERABLE",
}
}
type ExportFileFormat string
// Enum values for ExportFileFormat
const (
ExportFileFormatParquet ExportFileFormat = "PARQUET"
ExportFileFormatDelimitedText ExportFileFormat = "DELIMITED_TEXT"
)
// Values returns all known values for ExportFileFormat. 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 (ExportFileFormat) Values() []ExportFileFormat {
return []ExportFileFormat{
"PARQUET",
"DELIMITED_TEXT",
}
}
type IngestionStatus string
// Enum values for IngestionStatus
const (
IngestionStatusPending IngestionStatus = "PENDING"
IngestionStatusFailed IngestionStatus = "FAILED"
IngestionStatusSuccess IngestionStatus = "SUCCESS"
IngestionStatusRunning IngestionStatus = "RUNNING"
IngestionStatusStopRequested IngestionStatus = "STOP_REQUESTED"
)
// Values returns all known values for IngestionStatus. 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 (IngestionStatus) Values() []IngestionStatus {
return []IngestionStatus{
"PENDING",
"FAILED",
"SUCCESS",
"RUNNING",
"STOP_REQUESTED",
}
}
type LocationType string
// Enum values for LocationType
const (
LocationTypeIngestion LocationType = "INGESTION"
LocationTypeSagemaker LocationType = "SAGEMAKER"
)
// Values returns all known values for LocationType. 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 (LocationType) Values() []LocationType {
return []LocationType{
"INGESTION",
"SAGEMAKER",
}
}
type PermissionGroupMembershipStatus string
// Enum values for PermissionGroupMembershipStatus
const (
PermissionGroupMembershipStatusAdditionInProgress PermissionGroupMembershipStatus = "ADDITION_IN_PROGRESS"
PermissionGroupMembershipStatusAdditionSuccess PermissionGroupMembershipStatus = "ADDITION_SUCCESS"
PermissionGroupMembershipStatusRemovalInProgress PermissionGroupMembershipStatus = "REMOVAL_IN_PROGRESS"
)
// Values returns all known values for PermissionGroupMembershipStatus. 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 (PermissionGroupMembershipStatus) Values() []PermissionGroupMembershipStatus {
return []PermissionGroupMembershipStatus{
"ADDITION_IN_PROGRESS",
"ADDITION_SUCCESS",
"REMOVAL_IN_PROGRESS",
}
}
type UserStatus string
// Enum values for UserStatus
const (
UserStatusCreating UserStatus = "CREATING"
UserStatusEnabled UserStatus = "ENABLED"
UserStatusDisabled UserStatus = "DISABLED"
)
// Values returns all known values for UserStatus. 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 (UserStatus) Values() []UserStatus {
return []UserStatus{
"CREATING",
"ENABLED",
"DISABLED",
}
}
type UserType string
// Enum values for UserType
const (
UserTypeSuperUser UserType = "SUPER_USER"
UserTypeAppUser UserType = "APP_USER"
)
// Values returns all known values for UserType. 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 (UserType) Values() []UserType {
return []UserType{
"SUPER_USER",
"APP_USER",
}
}
| 327 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// You do not have sufficient access to perform this action.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request conflicts with an existing resource.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
Reason *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request processing has failed because of an unknown error, exception or
// failure.
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// A limit has exceeded.
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 }
// One or more resources can't be found.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
Reason *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 request was denied due to request throttling.
type ThrottlingException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ThrottlingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ThrottlingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ThrottlingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ThrottlingException"
}
return *e.ErrorCodeOverride
}
func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The input fails to satisfy the constraints specified by an AWS service.
type ValidationException struct {
Message *string
ErrorCodeOverride *string
Reason *string
noSmithyDocumentSerde
}
func (e *ValidationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ValidationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ValidationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ValidationException"
}
return *e.ErrorCodeOverride
}
func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 198 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
)
// The credentials required to access the external Dataview from the S3 location.
type AwsCredentials struct {
// The unique identifier for the security credentials.
AccessKeyId *string
// The Epoch time when the current credentials expire.
Expiration int64
// The secret access key that can be used to sign requests.
SecretAccessKey *string
// The token that users must pass to use the credentials.
SessionToken *string
noSmithyDocumentSerde
}
// The structure with error messages.
type ChangesetErrorInfo struct {
// The category of the error.
// - VALIDATION – The inputs to this request are invalid.
// - SERVICE_QUOTA_EXCEEDED – Service quotas have been exceeded. Please contact
// AWS support to increase quotas.
// - ACCESS_DENIED – Missing required permission to perform this request.
// - RESOURCE_NOT_FOUND – One or more inputs to this request were not found.
// - THROTTLING – The system temporarily lacks sufficient resources to process
// the request.
// - INTERNAL_SERVICE_EXCEPTION – An internal service error has occurred.
// - CANCELLED – Cancelled.
// - USER_RECOVERABLE – A user recoverable error has occurred.
ErrorCategory ErrorCategory
// The text of the error message.
ErrorMessage *string
noSmithyDocumentSerde
}
// A Changeset is unit of data in a Dataset.
type ChangesetSummary struct {
// Beginning time from which the Changeset is active. The value is determined as
// epoch time in milliseconds. For example, the value for Monday, November 1, 2021
// 12:00:00 PM UTC is specified as 1635768000000.
ActiveFromTimestamp *int64
// Time until which the Changeset is active. The value is determined as epoch time
// in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM
// UTC is specified as 1635768000000.
ActiveUntilTimestamp *int64
// Type that indicates how a Changeset is applied to a Dataset.
// - REPLACE – Changeset is considered as a replacement to all prior loaded
// Changesets.
// - APPEND – Changeset is considered as an addition to the end of all prior
// loaded Changesets.
// - MODIFY – Changeset is considered as a replacement to a specific prior
// ingested Changeset.
ChangeType ChangeType
// The ARN identifier of the Changeset.
ChangesetArn *string
// The unique identifier for a Changeset.
ChangesetId *string
// The timestamp at which the Changeset was created in FinSpace. The value is
// determined as epoch time in milliseconds. For example, the value for Monday,
// November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
CreateTime int64
// The unique identifier for the FinSpace Dataset in which the Changeset is
// created.
DatasetId *string
// The structure with error messages.
ErrorInfo *ChangesetErrorInfo
// Options that define the structure of the source file(s).
FormatParams map[string]string
// Options that define the location of the data being ingested.
SourceParams map[string]string
// Status of the Changeset ingestion.
// - PENDING – Changeset is pending creation.
// - FAILED – Changeset creation has failed.
// - SUCCESS – Changeset creation has succeeded.
// - RUNNING – Changeset creation is running.
// - STOP_REQUESTED – User requested Changeset creation to stop.
Status IngestionStatus
// The unique identifier of the updated Changeset.
UpdatedByChangesetId *string
// The unique identifier of the Changeset that is updated.
UpdatesChangesetId *string
noSmithyDocumentSerde
}
// The definition of a column in a tabular Dataset.
type ColumnDefinition struct {
// Description for a column.
ColumnDescription *string
// The name of a column.
ColumnName *string
// Data type of a column.
// - STRING – A String data type. CHAR – A char data type. INTEGER – An integer
// data type. TINYINT – A tinyint data type. SMALLINT – A smallint data type.
// BIGINT – A bigint data type. FLOAT – A float data type. DOUBLE – A double data
// type. DATE – A date data type. DATETIME – A datetime data type. BOOLEAN – A
// boolean data type. BINARY – A binary data type.
DataType ColumnDataType
noSmithyDocumentSerde
}
// Short term API credentials.
type Credentials struct {
// The access key identifier.
AccessKeyId *string
// The access key.
SecretAccessKey *string
// The session token.
SessionToken *string
noSmithyDocumentSerde
}
// The structure for a Dataset.
type Dataset struct {
// The unique resource identifier for a Dataset.
Alias *string
// The timestamp at which the Dataset was created in FinSpace. The value is
// determined as epoch time in milliseconds. For example, the value for Monday,
// November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
CreateTime int64
// The ARN identifier of the Dataset.
DatasetArn *string
// Description for a Dataset.
DatasetDescription *string
// An identifier for a Dataset.
DatasetId *string
// Display title for a Dataset.
DatasetTitle *string
// The format in which Dataset data is structured.
// - TABULAR – Data is structured in a tabular format.
// - NON_TABULAR – Data is structured in a non-tabular format.
Kind DatasetKind
// The last time that the Dataset was modified. The value is determined as epoch
// time in milliseconds. For example, the value for Monday, November 1, 2021
// 12:00:00 PM UTC is specified as 1635768000000.
LastModifiedTime int64
// Contact information for a Dataset owner.
OwnerInfo *DatasetOwnerInfo
// Definition for a schema on a tabular Dataset.
SchemaDefinition *SchemaUnion
noSmithyDocumentSerde
}
// A structure for Dataset owner info.
type DatasetOwnerInfo struct {
// Email address for the Dataset owner.
Email *string
// The name of the Dataset owner.
Name *string
// Phone number for the Dataset owner.
PhoneNumber *string
noSmithyDocumentSerde
}
// Structure for the Dataview destination type parameters.
type DataViewDestinationTypeParams struct {
// Destination type for a Dataview.
// - GLUE_TABLE – Glue table destination type.
// - S3 – S3 destination type.
//
// This member is required.
DestinationType *string
// Dataview export file format.
// - PARQUET – Parquet export file format.
// - DELIMITED_TEXT – Delimited text export file format.
S3DestinationExportFileFormat ExportFileFormat
// Format Options for S3 Destination type. Here is an example of how you could
// specify the s3DestinationExportFileFormatOptions
// { "header": "true", "delimiter": ",", "compression": "gzip" }
S3DestinationExportFileFormatOptions map[string]string
noSmithyDocumentSerde
}
// The structure with error messages.
type DataViewErrorInfo struct {
// The category of the error.
// - VALIDATION – The inputs to this request are invalid.
// - SERVICE_QUOTA_EXCEEDED – Service quotas have been exceeded. Please contact
// AWS support to increase quotas.
// - ACCESS_DENIED – Missing required permission to perform this request.
// - RESOURCE_NOT_FOUND – One or more inputs to this request were not found.
// - THROTTLING – The system temporarily lacks sufficient resources to process
// the request.
// - INTERNAL_SERVICE_EXCEPTION – An internal service error has occurred.
// - CANCELLED – Cancelled.
// - USER_RECOVERABLE – A user recoverable error has occurred.
ErrorCategory ErrorCategory
// The text of the error message.
ErrorMessage *string
noSmithyDocumentSerde
}
// Structure for the summary of a Dataview.
type DataViewSummary struct {
// Time range to use for the Dataview. The value is determined as epoch time in
// milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM
// UTC is specified as 1635768000000.
AsOfTimestamp *int64
// The flag to indicate Dataview should be updated automatically.
AutoUpdate bool
// The timestamp at which the Dataview was created in FinSpace. The value is
// determined as epoch time in milliseconds. For example, the value for Monday,
// November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
CreateTime int64
// The ARN identifier of the Dataview.
DataViewArn *string
// The unique identifier for the Dataview.
DataViewId *string
// Th unique identifier for the Dataview Dataset.
DatasetId *string
// Information about the Dataview destination.
DestinationTypeProperties *DataViewDestinationTypeParams
// The structure with error messages.
ErrorInfo *DataViewErrorInfo
// The last time that a Dataview was modified. The value is determined as epoch
// time in milliseconds. For example, the value for Monday, November 1, 2021
// 12:00:00 PM UTC is specified as 1635768000000.
LastModifiedTime int64
// Ordered set of column names used to partition data.
PartitionColumns []string
// Columns to be used for sorting the data.
SortColumns []string
// The status of a Dataview creation.
// - RUNNING – Dataview creation is running.
// - STARTING – Dataview creation is starting.
// - FAILED – Dataview creation has failed.
// - CANCELLED – Dataview creation has been cancelled.
// - TIMEOUT – Dataview creation has timed out.
// - SUCCESS – Dataview creation has succeeded.
// - PENDING – Dataview creation is pending.
// - FAILED_CLEANUP_FAILED – Dataview creation failed and resource cleanup
// failed.
Status DataViewStatus
noSmithyDocumentSerde
}
// The structure for a permission group.
type PermissionGroup struct {
// Indicates the permissions that are granted to a specific group for accessing
// the FinSpace application. When assigning application permissions, be aware that
// the permission ManageUsersAndGroups allows users to grant themselves or others
// access to any functionality in their FinSpace environment's application. It
// should only be granted to trusted users.
// - CreateDataset – Group members can create new datasets.
// - ManageClusters – Group members can manage Apache Spark clusters from
// FinSpace notebooks.
// - ManageUsersAndGroups – Group members can manage users and permission groups.
// This is a privileged permission that allows users to grant themselves or others
// access to any functionality in the application. It should only be granted to
// trusted users.
// - ManageAttributeSets – Group members can manage attribute sets.
// - ViewAuditData – Group members can view audit data.
// - AccessNotebooks – Group members will have access to FinSpace notebooks.
// - GetTemporaryCredentials – Group members can get temporary API credentials.
ApplicationPermissions []ApplicationPermission
// The timestamp at which the group was created in FinSpace. The value is
// determined as epoch time in milliseconds.
CreateTime int64
// A brief description for the permission group.
Description *string
// Describes the last time the permission group was updated. The value is
// determined as epoch time in milliseconds.
LastModifiedTime int64
// Indicates the status of the user account within a permission group.
// - ADDITION_IN_PROGRESS – The user account is currently being added to the
// permission group.
// - ADDITION_SUCCESS – The user account is successfully added to the permission
// group.
// - REMOVAL_IN_PROGRESS – The user is currently being removed from the
// permission group.
MembershipStatus PermissionGroupMembershipStatus
// The name of the permission group.
Name *string
// The unique identifier for the permission group.
PermissionGroupId *string
noSmithyDocumentSerde
}
// The structure of a permission group associated with a user account.
type PermissionGroupByUser struct {
// Indicates the status of the user account within a permission group.
// - ADDITION_IN_PROGRESS – The user account is currently being added to the
// permission group.
// - ADDITION_SUCCESS – The user account is successfully added to the permission
// group.
// - REMOVAL_IN_PROGRESS – The user is currently being removed from the
// permission group.
MembershipStatus PermissionGroupMembershipStatus
// The name of the permission group.
Name *string
// The unique identifier for the permission group.
PermissionGroupId *string
noSmithyDocumentSerde
}
// Permission group parameters for Dataset permissions. Here is an example of how
// you could specify the PermissionGroupParams : { "permissionGroupId":
// "0r6fCRtSTUk4XPfXQe3M0g", "datasetPermissions": [ {"permission":
// "ViewDatasetDetails"}, {"permission": "AddDatasetData"}, {"permission":
// "EditDatasetMetadata"}, {"permission": "DeleteDataset"} ] }
type PermissionGroupParams struct {
// List of resource permissions.
DatasetPermissions []ResourcePermission
// The unique identifier for the PermissionGroup .
PermissionGroupId *string
noSmithyDocumentSerde
}
// Resource permission for a dataset. When you create a dataset, all the other
// members of the same user group inherit access to the dataset. You can only
// create a dataset if your user group has application permission for Create
// Datasets. The following is a list of valid dataset permissions that you can
// apply:
// - ViewDatasetDetails
// - ReadDatasetDetails
// - AddDatasetData
// - CreateDataView
// - EditDatasetMetadata
// - DeleteDataset
//
// For more information on the dataset permissions, see Supported Dataset
// Permissions (https://docs.aws.amazon.com/finspace/latest/userguide/managing-user-permissions.html#supported-dataset-permissions)
// in the FinSpace User Guide.
type ResourcePermission struct {
// Permission for a resource.
Permission *string
noSmithyDocumentSerde
}
// The location of an external Dataview in an S3 bucket.
type S3Location struct {
// The name of the S3 bucket.
//
// This member is required.
Bucket *string
// The path of the folder, within the S3 bucket that contains the Dataset.
//
// This member is required.
Key *string
noSmithyDocumentSerde
}
// Definition for a schema on a tabular Dataset.
type SchemaDefinition struct {
// List of column definitions.
Columns []ColumnDefinition
// List of column names used for primary key.
PrimaryKeyColumns []string
noSmithyDocumentSerde
}
// A union of schema types.
type SchemaUnion struct {
// The configuration for a schema on a tabular Dataset.
TabularSchemaConfig *SchemaDefinition
noSmithyDocumentSerde
}
// The details of the user account.
type User struct {
// Indicates whether the user can use the GetProgrammaticAccessCredentials API to
// obtain credentials that can then be used to access other FinSpace Data API
// operations.
// - ENABLED – The user has permissions to use the APIs.
// - DISABLED – The user does not have permissions to use any APIs.
ApiAccess ApiAccess
// The ARN identifier of an AWS user or role that is allowed to call the
// GetProgrammaticAccessCredentials API to obtain a credentials token for a
// specific FinSpace user. This must be an IAM role within your FinSpace account.
ApiAccessPrincipalArn *string
// The timestamp at which the user account was created in FinSpace. The value is
// determined as epoch time in milliseconds.
CreateTime int64
// The email address of the user. The email address serves as a uniquer identifier
// for each user and cannot be changed after it's created.
EmailAddress *string
// The first name of the user.
FirstName *string
// Describes the last time the user account was disabled. The value is determined
// as epoch time in milliseconds.
LastDisabledTime int64
// Describes the last time the user account was enabled. The value is determined
// as epoch time in milliseconds.
LastEnabledTime int64
// Describes the last time that the user logged into their account. The value is
// determined as epoch time in milliseconds.
LastLoginTime int64
// Describes the last time the user account was updated. The value is determined
// as epoch time in milliseconds.
LastModifiedTime int64
// The last name of the user.
LastName *string
// The current status of the user account.
// - CREATING – The user account creation is in progress.
// - ENABLED – The user account is created and is currently active.
// - DISABLED – The user account is currently inactive.
Status UserStatus
// Indicates the type of user.
// - SUPER_USER – A user with permission to all the functionality and data in
// FinSpace.
// - APP_USER – A user with specific permissions in FinSpace. The users are
// assigned permissions by adding them to a permission group.
Type UserType
// The unique identifier for the user.
UserId *string
noSmithyDocumentSerde
}
// The structure of a user account associated with a permission group.
type UserByPermissionGroup struct {
// Indicates whether the user can access FinSpace API operations.
// - ENABLED – The user has permissions to use the API operations.
// - DISABLED – The user does not have permissions to use any API operations.
ApiAccess ApiAccess
// The IAM ARN identifier that is attached to FinSpace API calls.
ApiAccessPrincipalArn *string
// The email address of the user. The email address serves as a unique identifier
// for each user and cannot be changed after it's created.
EmailAddress *string
// The first name of the user.
FirstName *string
// The last name of the user.
LastName *string
// Indicates the status of the user account within a permission group.
// - ADDITION_IN_PROGRESS – The user account is currently being added to the
// permission group.
// - ADDITION_SUCCESS – The user account is successfully added to the permission
// group.
// - REMOVAL_IN_PROGRESS – The user is currently being removed from the
// permission group.
MembershipStatus PermissionGroupMembershipStatus
// The current status of the user account.
// - CREATING – The user account creation is in progress.
// - ENABLED – The user account is created and is currently active.
// - DISABLED – The user account is currently inactive.
Status UserStatus
// Indicates the type of user.
// - SUPER_USER – A user with permission to all the functionality and data in
// FinSpace.
// - APP_USER – A user with specific permissions in FinSpace. The users are
// assigned permissions by adding them to a permission group.
Type UserType
// The unique identifier for the user.
UserId *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 567 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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 = "Firehose"
const ServiceAPIVersion = "2015-08-04"
// Client provides the API client to make operations call for Amazon Kinesis
// Firehose.
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, "firehose", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 435 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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 firehose
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/firehose/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a Kinesis Data Firehose delivery stream. By default, you can create up
// to 50 delivery streams per Amazon Web Services Region. This is an asynchronous
// operation that immediately returns. The initial status of the delivery stream is
// CREATING . After the delivery stream is created, its status is ACTIVE and it
// now accepts data. If the delivery stream creation fails, the status transitions
// to CREATING_FAILED . Attempts to send data to a delivery stream that is not in
// the ACTIVE state cause an exception. To check the state of a delivery stream,
// use DescribeDeliveryStream . If the status of a delivery stream is
// CREATING_FAILED , this status doesn't change, and you can't invoke
// CreateDeliveryStream again on it. However, you can invoke the
// DeleteDeliveryStream operation to delete it. A Kinesis Data Firehose delivery
// stream can be configured to receive records directly from providers using
// PutRecord or PutRecordBatch , or it can be configured to use an existing Kinesis
// stream as its source. To specify a Kinesis data stream as input, set the
// DeliveryStreamType parameter to KinesisStreamAsSource , and provide the Kinesis
// stream Amazon Resource Name (ARN) and role ARN in the
// KinesisStreamSourceConfiguration parameter. To create a delivery stream with
// server-side encryption (SSE) enabled, include
// DeliveryStreamEncryptionConfigurationInput in your request. This is optional.
// You can also invoke StartDeliveryStreamEncryption to turn on SSE for an
// existing delivery stream that doesn't have SSE enabled. A delivery stream is
// configured with a single destination: Amazon S3, Amazon ES, Amazon Redshift, or
// Splunk. You must specify only one of the following destination configuration
// parameters: ExtendedS3DestinationConfiguration , S3DestinationConfiguration ,
// ElasticsearchDestinationConfiguration , RedshiftDestinationConfiguration , or
// SplunkDestinationConfiguration . When you specify S3DestinationConfiguration ,
// you can also provide the following optional values: BufferingHints,
// EncryptionConfiguration , and CompressionFormat . By default, if no
// BufferingHints value is provided, Kinesis Data Firehose buffers data up to 5 MB
// or for 5 minutes, whichever condition is satisfied first. BufferingHints is a
// hint, so there are some cases where the service cannot adhere to these
// conditions strictly. For example, record boundaries might be such that the size
// is a little over or under the configured buffering size. By default, no
// encryption is performed. We strongly recommend that you enable encryption to
// ensure secure data storage in Amazon S3. A few notes about Amazon Redshift as a
// destination:
// - An Amazon Redshift destination requires an S3 bucket as intermediate
// location. Kinesis Data Firehose first delivers data to Amazon S3 and then uses
// COPY syntax to load data into an Amazon Redshift table. This is specified in
// the RedshiftDestinationConfiguration.S3Configuration parameter.
// - The compression formats SNAPPY or ZIP cannot be specified in
// RedshiftDestinationConfiguration.S3Configuration because the Amazon Redshift
// COPY operation that reads from the S3 bucket doesn't support these compression
// formats.
// - We strongly recommend that you use the user name and password you provide
// exclusively with Kinesis Data Firehose, and that the permissions for the account
// are restricted for Amazon Redshift INSERT permissions.
//
// Kinesis Data Firehose assumes the IAM role that is configured as part of the
// destination. The role should allow the Kinesis Data Firehose principal to assume
// the role, and the role should have permissions that allow the service to deliver
// the data. For more information, see Grant Kinesis Data Firehose Access to an
// Amazon S3 Destination (https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3)
// in the Amazon Kinesis Data Firehose Developer Guide.
func (c *Client) CreateDeliveryStream(ctx context.Context, params *CreateDeliveryStreamInput, optFns ...func(*Options)) (*CreateDeliveryStreamOutput, error) {
if params == nil {
params = &CreateDeliveryStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateDeliveryStream", params, optFns, c.addOperationCreateDeliveryStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateDeliveryStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateDeliveryStreamInput struct {
// The name of the delivery stream. This name must be unique per Amazon Web
// Services account in the same Amazon Web Services Region. If the delivery streams
// are in different accounts or different Regions, you can have multiple delivery
// streams with the same name.
//
// This member is required.
DeliveryStreamName *string
// The destination in the Serverless offering for Amazon OpenSearch Service. You
// can specify only one destination.
AmazonOpenSearchServerlessDestinationConfiguration *types.AmazonOpenSearchServerlessDestinationConfiguration
// The destination in Amazon OpenSearch Service. You can specify only one
// destination.
AmazonopensearchserviceDestinationConfiguration *types.AmazonopensearchserviceDestinationConfiguration
// Used to specify the type and Amazon Resource Name (ARN) of the KMS key needed
// for Server-Side Encryption (SSE).
DeliveryStreamEncryptionConfigurationInput *types.DeliveryStreamEncryptionConfigurationInput
// The delivery stream type. This parameter can be one of the following values:
// - DirectPut : Provider applications access the delivery stream directly.
// - KinesisStreamAsSource : The delivery stream uses a Kinesis data stream as a
// source.
DeliveryStreamType types.DeliveryStreamType
// The destination in Amazon ES. You can specify only one destination.
ElasticsearchDestinationConfiguration *types.ElasticsearchDestinationConfiguration
// The destination in Amazon S3. You can specify only one destination.
ExtendedS3DestinationConfiguration *types.ExtendedS3DestinationConfiguration
// Enables configuring Kinesis Firehose to deliver data to any HTTP endpoint
// destination. You can specify only one destination.
HttpEndpointDestinationConfiguration *types.HttpEndpointDestinationConfiguration
// When a Kinesis data stream is used as the source for the delivery stream, a
// KinesisStreamSourceConfiguration containing the Kinesis data stream Amazon
// Resource Name (ARN) and the role ARN for the source stream.
KinesisStreamSourceConfiguration *types.KinesisStreamSourceConfiguration
// The destination in Amazon Redshift. You can specify only one destination.
RedshiftDestinationConfiguration *types.RedshiftDestinationConfiguration
// [Deprecated] The destination in Amazon S3. You can specify only one destination.
//
// Deprecated: This member has been deprecated.
S3DestinationConfiguration *types.S3DestinationConfiguration
// The destination in Splunk. You can specify only one destination.
SplunkDestinationConfiguration *types.SplunkDestinationConfiguration
// A set of tags to assign to the delivery stream. A tag is a key-value pair that
// you can define and assign to Amazon Web Services resources. Tags are metadata.
// For example, you can add friendly names and descriptions or other types of
// information that can help you distinguish the delivery stream. For more
// information about tags, see Using Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the Amazon Web Services Billing and Cost Management User Guide. You can
// specify up to 50 tags when creating a delivery stream.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateDeliveryStreamOutput struct {
// The ARN of the delivery stream.
DeliveryStreamARN *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateDeliveryStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDeliveryStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDeliveryStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateDeliveryStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDeliveryStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateDeliveryStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "CreateDeliveryStream",
}
}
| 234 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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 delivery stream and its data. To check the state of a delivery
// stream, use DescribeDeliveryStream . You can delete a delivery stream only if it
// is in one of the following states: ACTIVE , DELETING , CREATING_FAILED , or
// DELETING_FAILED . You can't delete a delivery stream that is in the CREATING
// state. While the deletion request is in process, the delivery stream is in the
// DELETING state. While the delivery stream is in the DELETING state, the service
// might continue to accept records, but it doesn't make any guarantees with
// respect to delivering the data. Therefore, as a best practice, first stop any
// applications that are sending records before you delete a delivery stream.
func (c *Client) DeleteDeliveryStream(ctx context.Context, params *DeleteDeliveryStreamInput, optFns ...func(*Options)) (*DeleteDeliveryStreamOutput, error) {
if params == nil {
params = &DeleteDeliveryStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteDeliveryStream", params, optFns, c.addOperationDeleteDeliveryStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteDeliveryStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteDeliveryStreamInput struct {
// The name of the delivery stream.
//
// This member is required.
DeliveryStreamName *string
// Set this to true if you want to delete the delivery stream even if Kinesis Data
// Firehose is unable to retire the grant for the CMK. Kinesis Data Firehose might
// be unable to retire the grant due to a customer error, such as when the CMK or
// the grant are in an invalid state. If you force deletion, you can then use the
// RevokeGrant (https://docs.aws.amazon.com/kms/latest/APIReference/API_RevokeGrant.html)
// operation to revoke the grant you gave to Kinesis Data Firehose. If a failure to
// retire the grant happens due to an Amazon Web Services KMS issue, Kinesis Data
// Firehose keeps retrying the delete operation. The default value is false.
AllowForceDelete *bool
noSmithyDocumentSerde
}
type DeleteDeliveryStreamOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteDeliveryStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDeliveryStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDeliveryStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteDeliveryStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDeliveryStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteDeliveryStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "DeleteDeliveryStream",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Describes the specified delivery stream and its status. For example, after your
// delivery stream is created, call DescribeDeliveryStream to see whether the
// delivery stream is ACTIVE and therefore ready for data to be sent to it. If the
// status of a delivery stream is CREATING_FAILED , this status doesn't change, and
// you can't invoke CreateDeliveryStream again on it. However, you can invoke the
// DeleteDeliveryStream operation to delete it. If the status is DELETING_FAILED ,
// you can force deletion by invoking DeleteDeliveryStream again but with
// DeleteDeliveryStreamInput$AllowForceDelete set to true.
func (c *Client) DescribeDeliveryStream(ctx context.Context, params *DescribeDeliveryStreamInput, optFns ...func(*Options)) (*DescribeDeliveryStreamOutput, error) {
if params == nil {
params = &DescribeDeliveryStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeDeliveryStream", params, optFns, c.addOperationDescribeDeliveryStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeDeliveryStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeDeliveryStreamInput struct {
// The name of the delivery stream.
//
// This member is required.
DeliveryStreamName *string
// The ID of the destination to start returning the destination information.
// Kinesis Data Firehose supports one destination per delivery stream.
ExclusiveStartDestinationId *string
// The limit on the number of destinations to return. You can have one destination
// per delivery stream.
Limit *int32
noSmithyDocumentSerde
}
type DescribeDeliveryStreamOutput struct {
// Information about the delivery stream.
//
// This member is required.
DeliveryStreamDescription *types.DeliveryStreamDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeDeliveryStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDeliveryStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDeliveryStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeDeliveryStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDeliveryStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeDeliveryStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "DescribeDeliveryStream",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists your delivery streams in alphabetical order of their names. The number of
// delivery streams might be too large to return using a single call to
// ListDeliveryStreams . You can limit the number of delivery streams returned,
// using the Limit parameter. To determine whether there are more delivery streams
// to list, check the value of HasMoreDeliveryStreams in the output. If there are
// more delivery streams to list, you can request them by calling this operation
// again and setting the ExclusiveStartDeliveryStreamName parameter to the name of
// the last delivery stream returned in the last call.
func (c *Client) ListDeliveryStreams(ctx context.Context, params *ListDeliveryStreamsInput, optFns ...func(*Options)) (*ListDeliveryStreamsOutput, error) {
if params == nil {
params = &ListDeliveryStreamsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDeliveryStreams", params, optFns, c.addOperationListDeliveryStreamsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDeliveryStreamsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListDeliveryStreamsInput struct {
// The delivery stream type. This can be one of the following values:
// - DirectPut : Provider applications access the delivery stream directly.
// - KinesisStreamAsSource : The delivery stream uses a Kinesis data stream as a
// source.
// This parameter is optional. If this parameter is omitted, delivery streams of
// all types are returned.
DeliveryStreamType types.DeliveryStreamType
// The list of delivery streams returned by this call to ListDeliveryStreams will
// start with the delivery stream whose name comes alphabetically immediately after
// the name you specify in ExclusiveStartDeliveryStreamName .
ExclusiveStartDeliveryStreamName *string
// The maximum number of delivery streams to list. The default value is 10.
Limit *int32
noSmithyDocumentSerde
}
type ListDeliveryStreamsOutput struct {
// The names of the delivery streams.
//
// This member is required.
DeliveryStreamNames []string
// Indicates whether there are more delivery streams available to list.
//
// This member is required.
HasMoreDeliveryStreams *bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDeliveryStreamsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDeliveryStreams{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDeliveryStreams{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListDeliveryStreams(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListDeliveryStreams(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "ListDeliveryStreams",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the tags for the specified delivery stream. This operation has a limit of
// five transactions per second per account.
func (c *Client) ListTagsForDeliveryStream(ctx context.Context, params *ListTagsForDeliveryStreamInput, optFns ...func(*Options)) (*ListTagsForDeliveryStreamOutput, error) {
if params == nil {
params = &ListTagsForDeliveryStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForDeliveryStream", params, optFns, c.addOperationListTagsForDeliveryStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForDeliveryStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForDeliveryStreamInput struct {
// The name of the delivery stream whose tags you want to list.
//
// This member is required.
DeliveryStreamName *string
// The key to use as the starting point for the list of tags. If you set this
// parameter, ListTagsForDeliveryStream gets all tags that occur after
// ExclusiveStartTagKey .
ExclusiveStartTagKey *string
// The number of tags to return. If this number is less than the total number of
// tags associated with the delivery stream, HasMoreTags is set to true in the
// response. To list additional tags, set ExclusiveStartTagKey to the last key in
// the response.
Limit *int32
noSmithyDocumentSerde
}
type ListTagsForDeliveryStreamOutput struct {
// If this is true in the response, more tags are available. To list the remaining
// tags, set ExclusiveStartTagKey to the key of the last tag returned and call
// ListTagsForDeliveryStream again.
//
// This member is required.
HasMoreTags *bool
// A list of tags associated with DeliveryStreamName , starting with the first tag
// after ExclusiveStartTagKey and up to the specified Limit .
//
// This member is required.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForDeliveryStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForDeliveryStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForDeliveryStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForDeliveryStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForDeliveryStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListTagsForDeliveryStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "ListTagsForDeliveryStream",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Writes a single data record into an Amazon Kinesis Data Firehose delivery
// stream. To write multiple data records into a delivery stream, use
// PutRecordBatch . Applications using these operations are referred to as
// producers. By default, each delivery stream can take in up to 2,000 transactions
// per second, 5,000 records per second, or 5 MB per second. If you use PutRecord
// and PutRecordBatch , the limits are an aggregate across these two operations for
// each delivery stream. For more information about limits and how to request an
// increase, see Amazon Kinesis Data Firehose Limits (https://docs.aws.amazon.com/firehose/latest/dev/limits.html)
// . You must specify the name of the delivery stream and the data record when
// using PutRecord . The data record consists of a data blob that can be up to
// 1,000 KiB in size, and any kind of data. For example, it can be a segment from a
// log file, geographic location data, website clickstream data, and so on. Kinesis
// Data Firehose buffers records before delivering them to the destination. To
// disambiguate the data blobs at the destination, a common solution is to use
// delimiters in the data, such as a newline ( \n ) or some other character unique
// within the data. This allows the consumer application to parse individual data
// items when reading the data from the destination. The PutRecord operation
// returns a RecordId , which is a unique string assigned to each record. Producer
// applications can use this ID for purposes such as auditability and
// investigation. If the PutRecord operation throws a ServiceUnavailableException ,
// back off and retry. If the exception persists, it is possible that the
// throughput limits have been exceeded for the delivery stream. Data records sent
// to Kinesis Data Firehose are stored for 24 hours from the time they are added to
// a delivery stream as it tries to send the records to the destination. If the
// destination is unreachable for more than 24 hours, the data is no longer
// available. Don't concatenate two or more base64 strings to form the data fields
// of your records. Instead, concatenate the raw data, then perform base64
// encoding.
func (c *Client) PutRecord(ctx context.Context, params *PutRecordInput, optFns ...func(*Options)) (*PutRecordOutput, error) {
if params == nil {
params = &PutRecordInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutRecord", params, optFns, c.addOperationPutRecordMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutRecordOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutRecordInput struct {
// The name of the delivery stream.
//
// This member is required.
DeliveryStreamName *string
// The record.
//
// This member is required.
Record *types.Record
noSmithyDocumentSerde
}
type PutRecordOutput struct {
// The ID of the record.
//
// This member is required.
RecordId *string
// Indicates whether server-side encryption (SSE) was enabled during this
// operation.
Encrypted *bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutRecordMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRecord{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutRecord{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutRecordValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRecord(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutRecord(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "PutRecord",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Writes multiple data records into a delivery stream in a single call, which can
// achieve higher throughput per producer than when writing single records. To
// write single data records into a delivery stream, use PutRecord . Applications
// using these operations are referred to as producers. For information about
// service quota, see Amazon Kinesis Data Firehose Quota (https://docs.aws.amazon.com/firehose/latest/dev/limits.html)
// . Each PutRecordBatch request supports up to 500 records. Each record in the
// request can be as large as 1,000 KB (before base64 encoding), up to a limit of 4
// MB for the entire request. These limits cannot be changed. You must specify the
// name of the delivery stream and the data record when using PutRecord . The data
// record consists of a data blob that can be up to 1,000 KB in size, and any kind
// of data. For example, it could be a segment from a log file, geographic location
// data, website clickstream data, and so on. Kinesis Data Firehose buffers records
// before delivering them to the destination. To disambiguate the data blobs at the
// destination, a common solution is to use delimiters in the data, such as a
// newline ( \n ) or some other character unique within the data. This allows the
// consumer application to parse individual data items when reading the data from
// the destination. The PutRecordBatch response includes a count of failed
// records, FailedPutCount , and an array of responses, RequestResponses . Even if
// the PutRecordBatch call succeeds, the value of FailedPutCount may be greater
// than 0, indicating that there are records for which the operation didn't
// succeed. Each entry in the RequestResponses array provides additional
// information about the processed record. It directly correlates with a record in
// the request array using the same ordering, from the top to the bottom. The
// response array always includes the same number of records as the request array.
// RequestResponses includes both successfully and unsuccessfully processed
// records. Kinesis Data Firehose tries to process all records in each
// PutRecordBatch request. A single record failure does not stop the processing of
// subsequent records. A successfully processed record includes a RecordId value,
// which is unique for the record. An unsuccessfully processed record includes
// ErrorCode and ErrorMessage values. ErrorCode reflects the type of error, and is
// one of the following values: ServiceUnavailableException or InternalFailure .
// ErrorMessage provides more detailed information about the error. If there is an
// internal server error or a timeout, the write might have completed or it might
// have failed. If FailedPutCount is greater than 0, retry the request, resending
// only those records that might have failed processing. This minimizes the
// possible duplicate records and also reduces the total bytes sent (and
// corresponding charges). We recommend that you handle any duplicates at the
// destination. If PutRecordBatch throws ServiceUnavailableException , back off and
// retry. If the exception persists, it is possible that the throughput limits have
// been exceeded for the delivery stream. Data records sent to Kinesis Data
// Firehose are stored for 24 hours from the time they are added to a delivery
// stream as it attempts to send the records to the destination. If the destination
// is unreachable for more than 24 hours, the data is no longer available. Don't
// concatenate two or more base64 strings to form the data fields of your records.
// Instead, concatenate the raw data, then perform base64 encoding.
func (c *Client) PutRecordBatch(ctx context.Context, params *PutRecordBatchInput, optFns ...func(*Options)) (*PutRecordBatchOutput, error) {
if params == nil {
params = &PutRecordBatchInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutRecordBatch", params, optFns, c.addOperationPutRecordBatchMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutRecordBatchOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutRecordBatchInput struct {
// The name of the delivery stream.
//
// This member is required.
DeliveryStreamName *string
// One or more records.
//
// This member is required.
Records []types.Record
noSmithyDocumentSerde
}
type PutRecordBatchOutput struct {
// The number of records that might have failed processing. This number might be
// greater than 0 even if the PutRecordBatch call succeeds. Check FailedPutCount
// to determine whether there are records that you need to resend.
//
// This member is required.
FailedPutCount *int32
// The results array. For each record, the index of the response element is the
// same as the index used in the request array.
//
// This member is required.
RequestResponses []types.PutRecordBatchResponseEntry
// Indicates whether server-side encryption (SSE) was enabled during this
// operation.
Encrypted *bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutRecordBatchMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRecordBatch{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutRecordBatch{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutRecordBatchValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRecordBatch(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutRecordBatch(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "PutRecordBatch",
}
}
| 188 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Enables server-side encryption (SSE) for the delivery stream. This operation is
// asynchronous. It returns immediately. When you invoke it, Kinesis Data Firehose
// first sets the encryption status of the stream to ENABLING , and then to ENABLED
// . The encryption status of a delivery stream is the Status property in
// DeliveryStreamEncryptionConfiguration . If the operation fails, the encryption
// status changes to ENABLING_FAILED . You can continue to read and write data to
// your delivery stream while the encryption status is ENABLING , but the data is
// not encrypted. It can take up to 5 seconds after the encryption status changes
// to ENABLED before all records written to the delivery stream are encrypted. To
// find out whether a record or a batch of records was encrypted, check the
// response elements PutRecordOutput$Encrypted and PutRecordBatchOutput$Encrypted ,
// respectively. To check the encryption status of a delivery stream, use
// DescribeDeliveryStream . Even if encryption is currently enabled for a delivery
// stream, you can still invoke this operation on it to change the ARN of the CMK
// or both its type and ARN. If you invoke this method to change the CMK, and the
// old CMK is of type CUSTOMER_MANAGED_CMK , Kinesis Data Firehose schedules the
// grant it had on the old CMK for retirement. If the new CMK is of type
// CUSTOMER_MANAGED_CMK , Kinesis Data Firehose creates a grant that enables it to
// use the new CMK to encrypt and decrypt data and to manage the grant. If a
// delivery stream already has encryption enabled and then you invoke this
// operation to change the ARN of the CMK or both its type and ARN and you get
// ENABLING_FAILED , this only means that the attempt to change the CMK failed. In
// this case, encryption remains enabled with the old CMK. If the encryption status
// of your delivery stream is ENABLING_FAILED , you can invoke this operation again
// with a valid CMK. The CMK must be enabled and the key policy mustn't explicitly
// deny the permission for Kinesis Data Firehose to invoke KMS encrypt and decrypt
// operations. You can enable SSE for a delivery stream only if it's a delivery
// stream that uses DirectPut as its source. The StartDeliveryStreamEncryption and
// StopDeliveryStreamEncryption operations have a combined limit of 25 calls per
// delivery stream per 24 hours. For example, you reach the limit if you call
// StartDeliveryStreamEncryption 13 times and StopDeliveryStreamEncryption 12
// times for the same delivery stream in a 24-hour period.
func (c *Client) StartDeliveryStreamEncryption(ctx context.Context, params *StartDeliveryStreamEncryptionInput, optFns ...func(*Options)) (*StartDeliveryStreamEncryptionOutput, error) {
if params == nil {
params = &StartDeliveryStreamEncryptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartDeliveryStreamEncryption", params, optFns, c.addOperationStartDeliveryStreamEncryptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartDeliveryStreamEncryptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartDeliveryStreamEncryptionInput struct {
// The name of the delivery stream for which you want to enable server-side
// encryption (SSE).
//
// This member is required.
DeliveryStreamName *string
// Used to specify the type and Amazon Resource Name (ARN) of the KMS key needed
// for Server-Side Encryption (SSE).
DeliveryStreamEncryptionConfigurationInput *types.DeliveryStreamEncryptionConfigurationInput
noSmithyDocumentSerde
}
type StartDeliveryStreamEncryptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartDeliveryStreamEncryptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartDeliveryStreamEncryption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartDeliveryStreamEncryption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartDeliveryStreamEncryptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDeliveryStreamEncryption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStartDeliveryStreamEncryption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "StartDeliveryStreamEncryption",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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"
)
// Disables server-side encryption (SSE) for the delivery stream. This operation
// is asynchronous. It returns immediately. When you invoke it, Kinesis Data
// Firehose first sets the encryption status of the stream to DISABLING , and then
// to DISABLED . You can continue to read and write data to your stream while its
// status is DISABLING . It can take up to 5 seconds after the encryption status
// changes to DISABLED before all records written to the delivery stream are no
// longer subject to encryption. To find out whether a record or a batch of records
// was encrypted, check the response elements PutRecordOutput$Encrypted and
// PutRecordBatchOutput$Encrypted , respectively. To check the encryption state of
// a delivery stream, use DescribeDeliveryStream . If SSE is enabled using a
// customer managed CMK and then you invoke StopDeliveryStreamEncryption , Kinesis
// Data Firehose schedules the related KMS grant for retirement and then retires it
// after it ensures that it is finished delivering records to the destination. The
// StartDeliveryStreamEncryption and StopDeliveryStreamEncryption operations have
// a combined limit of 25 calls per delivery stream per 24 hours. For example, you
// reach the limit if you call StartDeliveryStreamEncryption 13 times and
// StopDeliveryStreamEncryption 12 times for the same delivery stream in a 24-hour
// period.
func (c *Client) StopDeliveryStreamEncryption(ctx context.Context, params *StopDeliveryStreamEncryptionInput, optFns ...func(*Options)) (*StopDeliveryStreamEncryptionOutput, error) {
if params == nil {
params = &StopDeliveryStreamEncryptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopDeliveryStreamEncryption", params, optFns, c.addOperationStopDeliveryStreamEncryptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopDeliveryStreamEncryptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopDeliveryStreamEncryptionInput struct {
// The name of the delivery stream for which you want to disable server-side
// encryption (SSE).
//
// This member is required.
DeliveryStreamName *string
noSmithyDocumentSerde
}
type StopDeliveryStreamEncryptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopDeliveryStreamEncryptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopDeliveryStreamEncryption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopDeliveryStreamEncryption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopDeliveryStreamEncryptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopDeliveryStreamEncryption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStopDeliveryStreamEncryption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "StopDeliveryStreamEncryption",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds or updates tags for the specified delivery stream. A tag is a key-value
// pair that you can define and assign to Amazon Web Services resources. If you
// specify a tag that already exists, the tag value is replaced with the value that
// you specify in the request. Tags are metadata. For example, you can add friendly
// names and descriptions or other types of information that can help you
// distinguish the delivery stream. For more information about tags, see Using
// Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the Amazon Web Services Billing and Cost Management User Guide. Each delivery
// stream can have up to 50 tags. This operation has a limit of five transactions
// per second per account.
func (c *Client) TagDeliveryStream(ctx context.Context, params *TagDeliveryStreamInput, optFns ...func(*Options)) (*TagDeliveryStreamOutput, error) {
if params == nil {
params = &TagDeliveryStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagDeliveryStream", params, optFns, c.addOperationTagDeliveryStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagDeliveryStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagDeliveryStreamInput struct {
// The name of the delivery stream to which you want to add the tags.
//
// This member is required.
DeliveryStreamName *string
// A set of key-value pairs to use to create the tags.
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type TagDeliveryStreamOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagDeliveryStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagDeliveryStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagDeliveryStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagDeliveryStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagDeliveryStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opTagDeliveryStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "TagDeliveryStream",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes tags from the specified delivery stream. Removed tags are deleted, and
// you can't recover them after this operation successfully completes. If you
// specify a tag that doesn't exist, the operation ignores it. This operation has a
// limit of five transactions per second per account.
func (c *Client) UntagDeliveryStream(ctx context.Context, params *UntagDeliveryStreamInput, optFns ...func(*Options)) (*UntagDeliveryStreamOutput, error) {
if params == nil {
params = &UntagDeliveryStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagDeliveryStream", params, optFns, c.addOperationUntagDeliveryStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagDeliveryStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagDeliveryStreamInput struct {
// The name of the delivery stream.
//
// This member is required.
DeliveryStreamName *string
// A list of tag keys. Each corresponding tag is removed from the delivery stream.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagDeliveryStreamOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagDeliveryStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagDeliveryStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagDeliveryStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagDeliveryStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagDeliveryStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUntagDeliveryStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "UntagDeliveryStream",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified destination of the specified delivery stream. Use this
// operation to change the destination type (for example, to replace the Amazon S3
// destination with Amazon Redshift) or change the parameters associated with a
// destination (for example, to change the bucket name of the Amazon S3
// destination). The update might not occur immediately. The target delivery stream
// remains active while the configurations are updated, so data writes to the
// delivery stream can continue during this process. The updated configurations are
// usually effective within a few minutes. Switching between Amazon ES and other
// services is not supported. For an Amazon ES destination, you can only update to
// another Amazon ES destination. If the destination type is the same, Kinesis Data
// Firehose merges the configuration parameters specified with the destination
// configuration that already exists on the delivery stream. If any of the
// parameters are not specified in the call, the existing values are retained. For
// example, in the Amazon S3 destination, if EncryptionConfiguration is not
// specified, then the existing EncryptionConfiguration is maintained on the
// destination. If the destination type is not the same, for example, changing the
// destination from Amazon S3 to Amazon Redshift, Kinesis Data Firehose does not
// merge any parameters. In this case, all parameters must be specified. Kinesis
// Data Firehose uses CurrentDeliveryStreamVersionId to avoid race conditions and
// conflicting merges. This is a required field, and the service updates the
// configuration only if the existing configuration has a version ID that matches.
// After the update is applied successfully, the version ID is updated, and can be
// retrieved using DescribeDeliveryStream . Use the new version ID to set
// CurrentDeliveryStreamVersionId in the next call.
func (c *Client) UpdateDestination(ctx context.Context, params *UpdateDestinationInput, optFns ...func(*Options)) (*UpdateDestinationOutput, error) {
if params == nil {
params = &UpdateDestinationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateDestination", params, optFns, c.addOperationUpdateDestinationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateDestinationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateDestinationInput struct {
// Obtain this value from the VersionId result of DeliveryStreamDescription . This
// value is required, and helps the service perform conditional operations. For
// example, if there is an interleaving update and this value is null, then the
// update destination fails. After the update is successful, the VersionId value
// is updated. The service then performs a merge of the old configuration with the
// new configuration.
//
// This member is required.
CurrentDeliveryStreamVersionId *string
// The name of the delivery stream.
//
// This member is required.
DeliveryStreamName *string
// The ID of the destination.
//
// This member is required.
DestinationId *string
// Describes an update for a destination in the Serverless offering for Amazon
// OpenSearch Service.
AmazonOpenSearchServerlessDestinationUpdate *types.AmazonOpenSearchServerlessDestinationUpdate
// Describes an update for a destination in Amazon OpenSearch Service.
AmazonopensearchserviceDestinationUpdate *types.AmazonopensearchserviceDestinationUpdate
// Describes an update for a destination in Amazon ES.
ElasticsearchDestinationUpdate *types.ElasticsearchDestinationUpdate
// Describes an update for a destination in Amazon S3.
ExtendedS3DestinationUpdate *types.ExtendedS3DestinationUpdate
// Describes an update to the specified HTTP endpoint destination.
HttpEndpointDestinationUpdate *types.HttpEndpointDestinationUpdate
// Describes an update for a destination in Amazon Redshift.
RedshiftDestinationUpdate *types.RedshiftDestinationUpdate
// [Deprecated] Describes an update for a destination in Amazon S3.
//
// Deprecated: This member has been deprecated.
S3DestinationUpdate *types.S3DestinationUpdate
// Describes an update for a destination in Splunk.
SplunkDestinationUpdate *types.SplunkDestinationUpdate
noSmithyDocumentSerde
}
type UpdateDestinationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDestination{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDestination{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateDestinationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDestination(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateDestination(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "firehose",
OperationName: "UpdateDestination",
}
}
| 186 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/firehose/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"math"
"strings"
)
type awsAwsjson11_deserializeOpCreateDeliveryStream struct {
}
func (*awsAwsjson11_deserializeOpCreateDeliveryStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateDeliveryStream(response, &metadata)
}
output := &CreateDeliveryStreamOutput{}
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_deserializeOpDocumentCreateDeliveryStreamOutput(&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_deserializeOpErrorCreateDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("InvalidKMSResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidKMSResourceException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteDeliveryStream struct {
}
func (*awsAwsjson11_deserializeOpDeleteDeliveryStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteDeliveryStream(response, &metadata)
}
output := &DeleteDeliveryStreamOutput{}
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_deserializeOpDocumentDeleteDeliveryStreamOutput(&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_deserializeOpErrorDeleteDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeDeliveryStream struct {
}
func (*awsAwsjson11_deserializeOpDescribeDeliveryStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeDeliveryStream(response, &metadata)
}
output := &DescribeDeliveryStreamOutput{}
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_deserializeOpDocumentDescribeDeliveryStreamOutput(&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_deserializeOpErrorDescribeDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListDeliveryStreams struct {
}
func (*awsAwsjson11_deserializeOpListDeliveryStreams) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListDeliveryStreams) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListDeliveryStreams(response, &metadata)
}
output := &ListDeliveryStreamsOutput{}
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_deserializeOpDocumentListDeliveryStreamsOutput(&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_deserializeOpErrorListDeliveryStreams(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForDeliveryStream struct {
}
func (*awsAwsjson11_deserializeOpListTagsForDeliveryStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListTagsForDeliveryStream(response, &metadata)
}
output := &ListTagsForDeliveryStreamOutput{}
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_deserializeOpDocumentListTagsForDeliveryStreamOutput(&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_deserializeOpErrorListTagsForDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutRecord struct {
}
func (*awsAwsjson11_deserializeOpPutRecord) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutRecord) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutRecord(response, &metadata)
}
output := &PutRecordOutput{}
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_deserializeOpDocumentPutRecordOutput(&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_deserializeOpErrorPutRecord(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("InvalidKMSResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidKMSResourceException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutRecordBatch struct {
}
func (*awsAwsjson11_deserializeOpPutRecordBatch) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutRecordBatch) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutRecordBatch(response, &metadata)
}
output := &PutRecordBatchOutput{}
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_deserializeOpDocumentPutRecordBatchOutput(&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_deserializeOpErrorPutRecordBatch(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("InvalidKMSResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidKMSResourceException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStartDeliveryStreamEncryption struct {
}
func (*awsAwsjson11_deserializeOpStartDeliveryStreamEncryption) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStartDeliveryStreamEncryption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorStartDeliveryStreamEncryption(response, &metadata)
}
output := &StartDeliveryStreamEncryptionOutput{}
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_deserializeOpDocumentStartDeliveryStreamEncryptionOutput(&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_deserializeOpErrorStartDeliveryStreamEncryption(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("InvalidKMSResourceException", errorCode):
return awsAwsjson11_deserializeErrorInvalidKMSResourceException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStopDeliveryStreamEncryption struct {
}
func (*awsAwsjson11_deserializeOpStopDeliveryStreamEncryption) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStopDeliveryStreamEncryption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorStopDeliveryStreamEncryption(response, &metadata)
}
output := &StopDeliveryStreamEncryptionOutput{}
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_deserializeOpDocumentStopDeliveryStreamEncryptionOutput(&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_deserializeOpErrorStopDeliveryStreamEncryption(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTagDeliveryStream struct {
}
func (*awsAwsjson11_deserializeOpTagDeliveryStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpTagDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorTagDeliveryStream(response, &metadata)
}
output := &TagDeliveryStreamOutput{}
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_deserializeOpDocumentTagDeliveryStreamOutput(&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_deserializeOpErrorTagDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUntagDeliveryStream struct {
}
func (*awsAwsjson11_deserializeOpUntagDeliveryStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUntagDeliveryStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUntagDeliveryStream(response, &metadata)
}
output := &UntagDeliveryStreamOutput{}
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_deserializeOpDocumentUntagDeliveryStreamOutput(&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_deserializeOpErrorUntagDeliveryStream(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateDestination struct {
}
func (*awsAwsjson11_deserializeOpUpdateDestination) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorUpdateDestination(response, &metadata)
}
output := &UpdateDestinationOutput{}
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_deserializeOpDocumentUpdateDestinationOutput(&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_deserializeOpErrorUpdateDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ConcurrentModificationException", errorCode):
return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorConcurrentModificationException(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.ConcurrentModificationException{}
err := awsAwsjson11_deserializeDocumentConcurrentModificationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorInvalidArgumentException(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.InvalidArgumentException{}
err := awsAwsjson11_deserializeDocumentInvalidArgumentException(&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_deserializeErrorInvalidKMSResourceException(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.InvalidKMSResourceException{}
err := awsAwsjson11_deserializeDocumentInvalidKMSResourceException(&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_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_deserializeErrorServiceUnavailableException(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.ServiceUnavailableException{}
err := awsAwsjson11_deserializeDocumentServiceUnavailableException(&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_deserializeDocumentAmazonOpenSearchServerlessBufferingHints(v **types.AmazonOpenSearchServerlessBufferingHints, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AmazonOpenSearchServerlessBufferingHints
if *v == nil {
sv = &types.AmazonOpenSearchServerlessBufferingHints{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IntervalInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected AmazonOpenSearchServerlessBufferingIntervalInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.IntervalInSeconds = ptr.Int32(int32(i64))
}
case "SizeInMBs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected AmazonOpenSearchServerlessBufferingSizeInMBs to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SizeInMBs = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessDestinationDescription(v **types.AmazonOpenSearchServerlessDestinationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AmazonOpenSearchServerlessDestinationDescription
if *v == nil {
sv = &types.AmazonOpenSearchServerlessDestinationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BufferingHints":
if err := awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessBufferingHints(&sv.BufferingHints, value); err != nil {
return err
}
case "CloudWatchLoggingOptions":
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil {
return err
}
case "CollectionEndpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonOpenSearchServerlessCollectionEndpoint to be of type string, got %T instead", value)
}
sv.CollectionEndpoint = ptr.String(jtv)
}
case "IndexName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonOpenSearchServerlessIndexName to be of type string, got %T instead", value)
}
sv.IndexName = ptr.String(jtv)
}
case "ProcessingConfiguration":
if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil {
return err
}
case "RetryOptions":
if err := awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessRetryOptions(&sv.RetryOptions, value); err != nil {
return err
}
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
case "S3BackupMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonOpenSearchServerlessS3BackupMode to be of type string, got %T instead", value)
}
sv.S3BackupMode = types.AmazonOpenSearchServerlessS3BackupMode(jtv)
}
case "S3DestinationDescription":
if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil {
return err
}
case "VpcConfigurationDescription":
if err := awsAwsjson11_deserializeDocumentVpcConfigurationDescription(&sv.VpcConfigurationDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessRetryOptions(v **types.AmazonOpenSearchServerlessRetryOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AmazonOpenSearchServerlessRetryOptions
if *v == nil {
sv = &types.AmazonOpenSearchServerlessRetryOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DurationInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected AmazonOpenSearchServerlessRetryDurationInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInSeconds = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAmazonopensearchserviceBufferingHints(v **types.AmazonopensearchserviceBufferingHints, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AmazonopensearchserviceBufferingHints
if *v == nil {
sv = &types.AmazonopensearchserviceBufferingHints{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IntervalInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected AmazonopensearchserviceBufferingIntervalInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.IntervalInSeconds = ptr.Int32(int32(i64))
}
case "SizeInMBs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected AmazonopensearchserviceBufferingSizeInMBs to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SizeInMBs = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAmazonopensearchserviceDestinationDescription(v **types.AmazonopensearchserviceDestinationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AmazonopensearchserviceDestinationDescription
if *v == nil {
sv = &types.AmazonopensearchserviceDestinationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BufferingHints":
if err := awsAwsjson11_deserializeDocumentAmazonopensearchserviceBufferingHints(&sv.BufferingHints, value); err != nil {
return err
}
case "CloudWatchLoggingOptions":
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil {
return err
}
case "ClusterEndpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonopensearchserviceClusterEndpoint to be of type string, got %T instead", value)
}
sv.ClusterEndpoint = ptr.String(jtv)
}
case "DomainARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonopensearchserviceDomainARN to be of type string, got %T instead", value)
}
sv.DomainARN = ptr.String(jtv)
}
case "IndexName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonopensearchserviceIndexName to be of type string, got %T instead", value)
}
sv.IndexName = ptr.String(jtv)
}
case "IndexRotationPeriod":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonopensearchserviceIndexRotationPeriod to be of type string, got %T instead", value)
}
sv.IndexRotationPeriod = types.AmazonopensearchserviceIndexRotationPeriod(jtv)
}
case "ProcessingConfiguration":
if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil {
return err
}
case "RetryOptions":
if err := awsAwsjson11_deserializeDocumentAmazonopensearchserviceRetryOptions(&sv.RetryOptions, value); err != nil {
return err
}
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
case "S3BackupMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonopensearchserviceS3BackupMode to be of type string, got %T instead", value)
}
sv.S3BackupMode = types.AmazonopensearchserviceS3BackupMode(jtv)
}
case "S3DestinationDescription":
if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil {
return err
}
case "TypeName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonopensearchserviceTypeName to be of type string, got %T instead", value)
}
sv.TypeName = ptr.String(jtv)
}
case "VpcConfigurationDescription":
if err := awsAwsjson11_deserializeDocumentVpcConfigurationDescription(&sv.VpcConfigurationDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAmazonopensearchserviceRetryOptions(v **types.AmazonopensearchserviceRetryOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AmazonopensearchserviceRetryOptions
if *v == nil {
sv = &types.AmazonopensearchserviceRetryOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DurationInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected AmazonopensearchserviceRetryDurationInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInSeconds = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBufferingHints(v **types.BufferingHints, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.BufferingHints
if *v == nil {
sv = &types.BufferingHints{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IntervalInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected IntervalInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.IntervalInSeconds = ptr.Int32(int32(i64))
}
case "SizeInMBs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SizeInMBs to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SizeInMBs = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(v **types.CloudWatchLoggingOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.CloudWatchLoggingOptions
if *v == nil {
sv = &types.CloudWatchLoggingOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Enabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.Enabled = ptr.Bool(jtv)
}
case "LogGroupName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value)
}
sv.LogGroupName = ptr.String(jtv)
}
case "LogStreamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LogStreamName to be of type string, got %T instead", value)
}
sv.LogStreamName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentColumnToJsonKeyMappings(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentConcurrentModificationException(v **types.ConcurrentModificationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConcurrentModificationException
if *v == nil {
sv = &types.ConcurrentModificationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCopyCommand(v **types.CopyCommand, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.CopyCommand
if *v == nil {
sv = &types.CopyCommand{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CopyOptions":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CopyOptions to be of type string, got %T instead", value)
}
sv.CopyOptions = ptr.String(jtv)
}
case "DataTableColumns":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataTableColumns to be of type string, got %T instead", value)
}
sv.DataTableColumns = ptr.String(jtv)
}
case "DataTableName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataTableName to be of type string, got %T instead", value)
}
sv.DataTableName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDataFormatConversionConfiguration(v **types.DataFormatConversionConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DataFormatConversionConfiguration
if *v == nil {
sv = &types.DataFormatConversionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Enabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.Enabled = ptr.Bool(jtv)
}
case "InputFormatConfiguration":
if err := awsAwsjson11_deserializeDocumentInputFormatConfiguration(&sv.InputFormatConfiguration, value); err != nil {
return err
}
case "OutputFormatConfiguration":
if err := awsAwsjson11_deserializeDocumentOutputFormatConfiguration(&sv.OutputFormatConfiguration, value); err != nil {
return err
}
case "SchemaConfiguration":
if err := awsAwsjson11_deserializeDocumentSchemaConfiguration(&sv.SchemaConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDeliveryStreamDescription(v **types.DeliveryStreamDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DeliveryStreamDescription
if *v == nil {
sv = &types.DeliveryStreamDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreateTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "DeliveryStreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliveryStreamARN to be of type string, got %T instead", value)
}
sv.DeliveryStreamARN = ptr.String(jtv)
}
case "DeliveryStreamEncryptionConfiguration":
if err := awsAwsjson11_deserializeDocumentDeliveryStreamEncryptionConfiguration(&sv.DeliveryStreamEncryptionConfiguration, value); err != nil {
return err
}
case "DeliveryStreamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliveryStreamName to be of type string, got %T instead", value)
}
sv.DeliveryStreamName = ptr.String(jtv)
}
case "DeliveryStreamStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliveryStreamStatus to be of type string, got %T instead", value)
}
sv.DeliveryStreamStatus = types.DeliveryStreamStatus(jtv)
}
case "DeliveryStreamType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliveryStreamType to be of type string, got %T instead", value)
}
sv.DeliveryStreamType = types.DeliveryStreamType(jtv)
}
case "Destinations":
if err := awsAwsjson11_deserializeDocumentDestinationDescriptionList(&sv.Destinations, value); err != nil {
return err
}
case "FailureDescription":
if err := awsAwsjson11_deserializeDocumentFailureDescription(&sv.FailureDescription, value); err != nil {
return err
}
case "HasMoreDestinations":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.HasMoreDestinations = ptr.Bool(jtv)
}
case "LastUpdateTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdateTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "Source":
if err := awsAwsjson11_deserializeDocumentSourceDescription(&sv.Source, value); err != nil {
return err
}
case "VersionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliveryStreamVersionId to be of type string, got %T instead", value)
}
sv.VersionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDeliveryStreamEncryptionConfiguration(v **types.DeliveryStreamEncryptionConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DeliveryStreamEncryptionConfiguration
if *v == nil {
sv = &types.DeliveryStreamEncryptionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureDescription":
if err := awsAwsjson11_deserializeDocumentFailureDescription(&sv.FailureDescription, value); err != nil {
return err
}
case "KeyARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AWSKMSKeyARN to be of type string, got %T instead", value)
}
sv.KeyARN = ptr.String(jtv)
}
case "KeyType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KeyType to be of type string, got %T instead", value)
}
sv.KeyType = types.KeyType(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliveryStreamEncryptionStatus to be of type string, got %T instead", value)
}
sv.Status = types.DeliveryStreamEncryptionStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDeliveryStreamNameList(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 DeliveryStreamName to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentDeserializer(v **types.Deserializer, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Deserializer
if *v == nil {
sv = &types.Deserializer{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "HiveJsonSerDe":
if err := awsAwsjson11_deserializeDocumentHiveJsonSerDe(&sv.HiveJsonSerDe, value); err != nil {
return err
}
case "OpenXJsonSerDe":
if err := awsAwsjson11_deserializeDocumentOpenXJsonSerDe(&sv.OpenXJsonSerDe, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDestinationDescription(v **types.DestinationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DestinationDescription
if *v == nil {
sv = &types.DestinationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AmazonOpenSearchServerlessDestinationDescription":
if err := awsAwsjson11_deserializeDocumentAmazonOpenSearchServerlessDestinationDescription(&sv.AmazonOpenSearchServerlessDestinationDescription, value); err != nil {
return err
}
case "AmazonopensearchserviceDestinationDescription":
if err := awsAwsjson11_deserializeDocumentAmazonopensearchserviceDestinationDescription(&sv.AmazonopensearchserviceDestinationDescription, value); err != nil {
return err
}
case "DestinationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value)
}
sv.DestinationId = ptr.String(jtv)
}
case "ElasticsearchDestinationDescription":
if err := awsAwsjson11_deserializeDocumentElasticsearchDestinationDescription(&sv.ElasticsearchDestinationDescription, value); err != nil {
return err
}
case "ExtendedS3DestinationDescription":
if err := awsAwsjson11_deserializeDocumentExtendedS3DestinationDescription(&sv.ExtendedS3DestinationDescription, value); err != nil {
return err
}
case "HttpEndpointDestinationDescription":
if err := awsAwsjson11_deserializeDocumentHttpEndpointDestinationDescription(&sv.HttpEndpointDestinationDescription, value); err != nil {
return err
}
case "RedshiftDestinationDescription":
if err := awsAwsjson11_deserializeDocumentRedshiftDestinationDescription(&sv.RedshiftDestinationDescription, value); err != nil {
return err
}
case "S3DestinationDescription":
if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil {
return err
}
case "SplunkDestinationDescription":
if err := awsAwsjson11_deserializeDocumentSplunkDestinationDescription(&sv.SplunkDestinationDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDestinationDescriptionList(v *[]types.DestinationDescription, 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.DestinationDescription
if *v == nil {
cv = []types.DestinationDescription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DestinationDescription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentDestinationDescription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentDynamicPartitioningConfiguration(v **types.DynamicPartitioningConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DynamicPartitioningConfiguration
if *v == nil {
sv = &types.DynamicPartitioningConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Enabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.Enabled = ptr.Bool(jtv)
}
case "RetryOptions":
if err := awsAwsjson11_deserializeDocumentRetryOptions(&sv.RetryOptions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentElasticsearchBufferingHints(v **types.ElasticsearchBufferingHints, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ElasticsearchBufferingHints
if *v == nil {
sv = &types.ElasticsearchBufferingHints{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IntervalInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ElasticsearchBufferingIntervalInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.IntervalInSeconds = ptr.Int32(int32(i64))
}
case "SizeInMBs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ElasticsearchBufferingSizeInMBs to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SizeInMBs = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentElasticsearchDestinationDescription(v **types.ElasticsearchDestinationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ElasticsearchDestinationDescription
if *v == nil {
sv = &types.ElasticsearchDestinationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BufferingHints":
if err := awsAwsjson11_deserializeDocumentElasticsearchBufferingHints(&sv.BufferingHints, value); err != nil {
return err
}
case "CloudWatchLoggingOptions":
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil {
return err
}
case "ClusterEndpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ElasticsearchClusterEndpoint to be of type string, got %T instead", value)
}
sv.ClusterEndpoint = ptr.String(jtv)
}
case "DomainARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ElasticsearchDomainARN to be of type string, got %T instead", value)
}
sv.DomainARN = ptr.String(jtv)
}
case "IndexName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ElasticsearchIndexName to be of type string, got %T instead", value)
}
sv.IndexName = ptr.String(jtv)
}
case "IndexRotationPeriod":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ElasticsearchIndexRotationPeriod to be of type string, got %T instead", value)
}
sv.IndexRotationPeriod = types.ElasticsearchIndexRotationPeriod(jtv)
}
case "ProcessingConfiguration":
if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil {
return err
}
case "RetryOptions":
if err := awsAwsjson11_deserializeDocumentElasticsearchRetryOptions(&sv.RetryOptions, value); err != nil {
return err
}
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
case "S3BackupMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ElasticsearchS3BackupMode to be of type string, got %T instead", value)
}
sv.S3BackupMode = types.ElasticsearchS3BackupMode(jtv)
}
case "S3DestinationDescription":
if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil {
return err
}
case "TypeName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ElasticsearchTypeName to be of type string, got %T instead", value)
}
sv.TypeName = ptr.String(jtv)
}
case "VpcConfigurationDescription":
if err := awsAwsjson11_deserializeDocumentVpcConfigurationDescription(&sv.VpcConfigurationDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentElasticsearchRetryOptions(v **types.ElasticsearchRetryOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ElasticsearchRetryOptions
if *v == nil {
sv = &types.ElasticsearchRetryOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DurationInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ElasticsearchRetryDurationInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInSeconds = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEncryptionConfiguration(v **types.EncryptionConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.EncryptionConfiguration
if *v == nil {
sv = &types.EncryptionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "KMSEncryptionConfig":
if err := awsAwsjson11_deserializeDocumentKMSEncryptionConfig(&sv.KMSEncryptionConfig, value); err != nil {
return err
}
case "NoEncryptionConfig":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NoEncryptionConfig to be of type string, got %T instead", value)
}
sv.NoEncryptionConfig = types.NoEncryptionConfig(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentExtendedS3DestinationDescription(v **types.ExtendedS3DestinationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExtendedS3DestinationDescription
if *v == nil {
sv = &types.ExtendedS3DestinationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BucketARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BucketARN to be of type string, got %T instead", value)
}
sv.BucketARN = ptr.String(jtv)
}
case "BufferingHints":
if err := awsAwsjson11_deserializeDocumentBufferingHints(&sv.BufferingHints, value); err != nil {
return err
}
case "CloudWatchLoggingOptions":
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil {
return err
}
case "CompressionFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CompressionFormat to be of type string, got %T instead", value)
}
sv.CompressionFormat = types.CompressionFormat(jtv)
}
case "DataFormatConversionConfiguration":
if err := awsAwsjson11_deserializeDocumentDataFormatConversionConfiguration(&sv.DataFormatConversionConfiguration, value); err != nil {
return err
}
case "DynamicPartitioningConfiguration":
if err := awsAwsjson11_deserializeDocumentDynamicPartitioningConfiguration(&sv.DynamicPartitioningConfiguration, value); err != nil {
return err
}
case "EncryptionConfiguration":
if err := awsAwsjson11_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil {
return err
}
case "ErrorOutputPrefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorOutputPrefix to be of type string, got %T instead", value)
}
sv.ErrorOutputPrefix = ptr.String(jtv)
}
case "Prefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Prefix to be of type string, got %T instead", value)
}
sv.Prefix = ptr.String(jtv)
}
case "ProcessingConfiguration":
if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil {
return err
}
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
case "S3BackupDescription":
if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3BackupDescription, value); err != nil {
return err
}
case "S3BackupMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3BackupMode to be of type string, got %T instead", value)
}
sv.S3BackupMode = types.S3BackupMode(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFailureDescription(v **types.FailureDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.FailureDescription
if *v == nil {
sv = &types.FailureDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Details":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
sv.Details = ptr.String(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliveryStreamFailureType to be of type string, got %T instead", value)
}
sv.Type = types.DeliveryStreamFailureType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHiveJsonSerDe(v **types.HiveJsonSerDe, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.HiveJsonSerDe
if *v == nil {
sv = &types.HiveJsonSerDe{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TimestampFormats":
if err := awsAwsjson11_deserializeDocumentListOfNonEmptyStrings(&sv.TimestampFormats, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHttpEndpointBufferingHints(v **types.HttpEndpointBufferingHints, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.HttpEndpointBufferingHints
if *v == nil {
sv = &types.HttpEndpointBufferingHints{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IntervalInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected HttpEndpointBufferingIntervalInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.IntervalInSeconds = ptr.Int32(int32(i64))
}
case "SizeInMBs":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected HttpEndpointBufferingSizeInMBs to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SizeInMBs = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHttpEndpointCommonAttribute(v **types.HttpEndpointCommonAttribute, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.HttpEndpointCommonAttribute
if *v == nil {
sv = &types.HttpEndpointCommonAttribute{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AttributeName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HttpEndpointAttributeName to be of type string, got %T instead", value)
}
sv.AttributeName = ptr.String(jtv)
}
case "AttributeValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HttpEndpointAttributeValue to be of type string, got %T instead", value)
}
sv.AttributeValue = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHttpEndpointCommonAttributesList(v *[]types.HttpEndpointCommonAttribute, 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.HttpEndpointCommonAttribute
if *v == nil {
cv = []types.HttpEndpointCommonAttribute{}
} else {
cv = *v
}
for _, value := range shape {
var col types.HttpEndpointCommonAttribute
destAddr := &col
if err := awsAwsjson11_deserializeDocumentHttpEndpointCommonAttribute(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentHttpEndpointDescription(v **types.HttpEndpointDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.HttpEndpointDescription
if *v == nil {
sv = &types.HttpEndpointDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HttpEndpointName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HttpEndpointUrl to be of type string, got %T instead", value)
}
sv.Url = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHttpEndpointDestinationDescription(v **types.HttpEndpointDestinationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.HttpEndpointDestinationDescription
if *v == nil {
sv = &types.HttpEndpointDestinationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BufferingHints":
if err := awsAwsjson11_deserializeDocumentHttpEndpointBufferingHints(&sv.BufferingHints, value); err != nil {
return err
}
case "CloudWatchLoggingOptions":
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil {
return err
}
case "EndpointConfiguration":
if err := awsAwsjson11_deserializeDocumentHttpEndpointDescription(&sv.EndpointConfiguration, value); err != nil {
return err
}
case "ProcessingConfiguration":
if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil {
return err
}
case "RequestConfiguration":
if err := awsAwsjson11_deserializeDocumentHttpEndpointRequestConfiguration(&sv.RequestConfiguration, value); err != nil {
return err
}
case "RetryOptions":
if err := awsAwsjson11_deserializeDocumentHttpEndpointRetryOptions(&sv.RetryOptions, value); err != nil {
return err
}
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
case "S3BackupMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HttpEndpointS3BackupMode to be of type string, got %T instead", value)
}
sv.S3BackupMode = types.HttpEndpointS3BackupMode(jtv)
}
case "S3DestinationDescription":
if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHttpEndpointRequestConfiguration(v **types.HttpEndpointRequestConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.HttpEndpointRequestConfiguration
if *v == nil {
sv = &types.HttpEndpointRequestConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CommonAttributes":
if err := awsAwsjson11_deserializeDocumentHttpEndpointCommonAttributesList(&sv.CommonAttributes, value); err != nil {
return err
}
case "ContentEncoding":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContentEncoding to be of type string, got %T instead", value)
}
sv.ContentEncoding = types.ContentEncoding(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHttpEndpointRetryOptions(v **types.HttpEndpointRetryOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.HttpEndpointRetryOptions
if *v == nil {
sv = &types.HttpEndpointRetryOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DurationInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected HttpEndpointRetryDurationInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInSeconds = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInputFormatConfiguration(v **types.InputFormatConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.InputFormatConfiguration
if *v == nil {
sv = &types.InputFormatConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Deserializer":
if err := awsAwsjson11_deserializeDocumentDeserializer(&sv.Deserializer, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidArgumentException(v **types.InvalidArgumentException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.InvalidArgumentException
if *v == nil {
sv = &types.InvalidArgumentException{}
} 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_deserializeDocumentInvalidKMSResourceException(v **types.InvalidKMSResourceException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.InvalidKMSResourceException
if *v == nil {
sv = &types.InvalidKMSResourceException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value)
}
sv.Code = ptr.String(jtv)
}
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_deserializeDocumentKinesisStreamSourceDescription(v **types.KinesisStreamSourceDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.KinesisStreamSourceDescription
if *v == nil {
sv = &types.KinesisStreamSourceDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeliveryStartTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.DeliveryStartTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected DeliveryStartTimestamp to be a JSON Number, got %T instead", value)
}
}
case "KinesisStreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KinesisStreamARN to be of type string, got %T instead", value)
}
sv.KinesisStreamARN = ptr.String(jtv)
}
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentKMSEncryptionConfig(v **types.KMSEncryptionConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.KMSEncryptionConfig
if *v == nil {
sv = &types.KMSEncryptionConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AWSKMSKeyARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AWSKMSKeyARN to be of type string, got %T instead", value)
}
sv.AWSKMSKeyARN = 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_deserializeDocumentListOfNonEmptyStrings(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentListOfNonEmptyStringsWithoutWhitespace(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 NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentListTagsForDeliveryStreamOutputTagList(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_deserializeDocumentOpenXJsonSerDe(v **types.OpenXJsonSerDe, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.OpenXJsonSerDe
if *v == nil {
sv = &types.OpenXJsonSerDe{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CaseInsensitive":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.CaseInsensitive = ptr.Bool(jtv)
}
case "ColumnToJsonKeyMappings":
if err := awsAwsjson11_deserializeDocumentColumnToJsonKeyMappings(&sv.ColumnToJsonKeyMappings, value); err != nil {
return err
}
case "ConvertDotsInJsonKeysToUnderscores":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.ConvertDotsInJsonKeysToUnderscores = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOrcSerDe(v **types.OrcSerDe, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.OrcSerDe
if *v == nil {
sv = &types.OrcSerDe{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BlockSizeBytes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BlockSizeBytes to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.BlockSizeBytes = ptr.Int32(int32(i64))
}
case "BloomFilterColumns":
if err := awsAwsjson11_deserializeDocumentListOfNonEmptyStringsWithoutWhitespace(&sv.BloomFilterColumns, value); err != nil {
return err
}
case "BloomFilterFalsePositiveProbability":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.BloomFilterFalsePositiveProbability = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.BloomFilterFalsePositiveProbability = ptr.Float64(f64)
default:
return fmt.Errorf("expected Proportion to be a JSON Number, got %T instead", value)
}
}
case "Compression":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OrcCompression to be of type string, got %T instead", value)
}
sv.Compression = types.OrcCompression(jtv)
}
case "DictionaryKeyThreshold":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.DictionaryKeyThreshold = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.DictionaryKeyThreshold = ptr.Float64(f64)
default:
return fmt.Errorf("expected Proportion to be a JSON Number, got %T instead", value)
}
}
case "EnablePadding":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.EnablePadding = ptr.Bool(jtv)
}
case "FormatVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OrcFormatVersion to be of type string, got %T instead", value)
}
sv.FormatVersion = types.OrcFormatVersion(jtv)
}
case "PaddingTolerance":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.PaddingTolerance = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.PaddingTolerance = ptr.Float64(f64)
default:
return fmt.Errorf("expected Proportion to be a JSON Number, got %T instead", value)
}
}
case "RowIndexStride":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected OrcRowIndexStride to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RowIndexStride = ptr.Int32(int32(i64))
}
case "StripeSizeBytes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected OrcStripeSizeBytes to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.StripeSizeBytes = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOutputFormatConfiguration(v **types.OutputFormatConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.OutputFormatConfiguration
if *v == nil {
sv = &types.OutputFormatConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Serializer":
if err := awsAwsjson11_deserializeDocumentSerializer(&sv.Serializer, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentParquetSerDe(v **types.ParquetSerDe, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ParquetSerDe
if *v == nil {
sv = &types.ParquetSerDe{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BlockSizeBytes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected BlockSizeBytes to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.BlockSizeBytes = ptr.Int32(int32(i64))
}
case "Compression":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ParquetCompression to be of type string, got %T instead", value)
}
sv.Compression = types.ParquetCompression(jtv)
}
case "EnableDictionaryCompression":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.EnableDictionaryCompression = ptr.Bool(jtv)
}
case "MaxPaddingBytes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected NonNegativeIntegerObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxPaddingBytes = ptr.Int32(int32(i64))
}
case "PageSizeBytes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ParquetPageSizeBytes to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.PageSizeBytes = ptr.Int32(int32(i64))
}
case "WriterVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ParquetWriterVersion to be of type string, got %T instead", value)
}
sv.WriterVersion = types.ParquetWriterVersion(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProcessingConfiguration(v **types.ProcessingConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ProcessingConfiguration
if *v == nil {
sv = &types.ProcessingConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Enabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.Enabled = ptr.Bool(jtv)
}
case "Processors":
if err := awsAwsjson11_deserializeDocumentProcessorList(&sv.Processors, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProcessor(v **types.Processor, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Processor
if *v == nil {
sv = &types.Processor{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Parameters":
if err := awsAwsjson11_deserializeDocumentProcessorParameterList(&sv.Parameters, value); err != nil {
return err
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProcessorType to be of type string, got %T instead", value)
}
sv.Type = types.ProcessorType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProcessorList(v *[]types.Processor, 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.Processor
if *v == nil {
cv = []types.Processor{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Processor
destAddr := &col
if err := awsAwsjson11_deserializeDocumentProcessor(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentProcessorParameter(v **types.ProcessorParameter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ProcessorParameter
if *v == nil {
sv = &types.ProcessorParameter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ParameterName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProcessorParameterName to be of type string, got %T instead", value)
}
sv.ParameterName = types.ProcessorParameterName(jtv)
}
case "ParameterValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ProcessorParameterValue to be of type string, got %T instead", value)
}
sv.ParameterValue = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentProcessorParameterList(v *[]types.ProcessorParameter, 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.ProcessorParameter
if *v == nil {
cv = []types.ProcessorParameter{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ProcessorParameter
destAddr := &col
if err := awsAwsjson11_deserializeDocumentProcessorParameter(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentPutRecordBatchResponseEntry(v **types.PutRecordBatchResponseEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.PutRecordBatchResponseEntry
if *v == nil {
sv = &types.PutRecordBatchResponseEntry{}
} 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 ErrorCode to be of type string, got %T instead", value)
}
sv.ErrorCode = ptr.String(jtv)
}
case "ErrorMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.ErrorMessage = ptr.String(jtv)
}
case "RecordId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PutResponseRecordId to be of type string, got %T instead", value)
}
sv.RecordId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPutRecordBatchResponseEntryList(v *[]types.PutRecordBatchResponseEntry, 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.PutRecordBatchResponseEntry
if *v == nil {
cv = []types.PutRecordBatchResponseEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PutRecordBatchResponseEntry
destAddr := &col
if err := awsAwsjson11_deserializeDocumentPutRecordBatchResponseEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRedshiftDestinationDescription(v **types.RedshiftDestinationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.RedshiftDestinationDescription
if *v == nil {
sv = &types.RedshiftDestinationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CloudWatchLoggingOptions":
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil {
return err
}
case "ClusterJDBCURL":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClusterJDBCURL to be of type string, got %T instead", value)
}
sv.ClusterJDBCURL = ptr.String(jtv)
}
case "CopyCommand":
if err := awsAwsjson11_deserializeDocumentCopyCommand(&sv.CopyCommand, value); err != nil {
return err
}
case "ProcessingConfiguration":
if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil {
return err
}
case "RetryOptions":
if err := awsAwsjson11_deserializeDocumentRedshiftRetryOptions(&sv.RetryOptions, value); err != nil {
return err
}
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
case "S3BackupDescription":
if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3BackupDescription, value); err != nil {
return err
}
case "S3BackupMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RedshiftS3BackupMode to be of type string, got %T instead", value)
}
sv.S3BackupMode = types.RedshiftS3BackupMode(jtv)
}
case "S3DestinationDescription":
if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil {
return err
}
case "Username":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Username to be of type string, got %T instead", value)
}
sv.Username = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRedshiftRetryOptions(v **types.RedshiftRetryOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.RedshiftRetryOptions
if *v == nil {
sv = &types.RedshiftRetryOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DurationInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RedshiftRetryDurationInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInSeconds = ptr.Int32(int32(i64))
}
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_deserializeDocumentRetryOptions(v **types.RetryOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.RetryOptions
if *v == nil {
sv = &types.RetryOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DurationInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RetryDurationInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInSeconds = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentS3DestinationDescription(v **types.S3DestinationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.S3DestinationDescription
if *v == nil {
sv = &types.S3DestinationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BucketARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BucketARN to be of type string, got %T instead", value)
}
sv.BucketARN = ptr.String(jtv)
}
case "BufferingHints":
if err := awsAwsjson11_deserializeDocumentBufferingHints(&sv.BufferingHints, value); err != nil {
return err
}
case "CloudWatchLoggingOptions":
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil {
return err
}
case "CompressionFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CompressionFormat to be of type string, got %T instead", value)
}
sv.CompressionFormat = types.CompressionFormat(jtv)
}
case "EncryptionConfiguration":
if err := awsAwsjson11_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil {
return err
}
case "ErrorOutputPrefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorOutputPrefix to be of type string, got %T instead", value)
}
sv.ErrorOutputPrefix = ptr.String(jtv)
}
case "Prefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Prefix to be of type string, got %T instead", value)
}
sv.Prefix = ptr.String(jtv)
}
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSchemaConfiguration(v **types.SchemaConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SchemaConfiguration
if *v == nil {
sv = &types.SchemaConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CatalogId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
sv.CatalogId = ptr.String(jtv)
}
case "DatabaseName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
sv.DatabaseName = ptr.String(jtv)
}
case "Region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
case "TableName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
sv.TableName = ptr.String(jtv)
}
case "VersionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
sv.VersionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSecurityGroupIdList(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 NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSerializer(v **types.Serializer, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Serializer
if *v == nil {
sv = &types.Serializer{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "OrcSerDe":
if err := awsAwsjson11_deserializeDocumentOrcSerDe(&sv.OrcSerDe, value); err != nil {
return err
}
case "ParquetSerDe":
if err := awsAwsjson11_deserializeDocumentParquetSerDe(&sv.ParquetSerDe, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ServiceUnavailableException
if *v == nil {
sv = &types.ServiceUnavailableException{}
} 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_deserializeDocumentSourceDescription(v **types.SourceDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SourceDescription
if *v == nil {
sv = &types.SourceDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "KinesisStreamSourceDescription":
if err := awsAwsjson11_deserializeDocumentKinesisStreamSourceDescription(&sv.KinesisStreamSourceDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSplunkDestinationDescription(v **types.SplunkDestinationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SplunkDestinationDescription
if *v == nil {
sv = &types.SplunkDestinationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CloudWatchLoggingOptions":
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptions(&sv.CloudWatchLoggingOptions, value); err != nil {
return err
}
case "HECAcknowledgmentTimeoutInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected HECAcknowledgmentTimeoutInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.HECAcknowledgmentTimeoutInSeconds = ptr.Int32(int32(i64))
}
case "HECEndpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HECEndpoint to be of type string, got %T instead", value)
}
sv.HECEndpoint = ptr.String(jtv)
}
case "HECEndpointType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HECEndpointType to be of type string, got %T instead", value)
}
sv.HECEndpointType = types.HECEndpointType(jtv)
}
case "HECToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HECToken to be of type string, got %T instead", value)
}
sv.HECToken = ptr.String(jtv)
}
case "ProcessingConfiguration":
if err := awsAwsjson11_deserializeDocumentProcessingConfiguration(&sv.ProcessingConfiguration, value); err != nil {
return err
}
case "RetryOptions":
if err := awsAwsjson11_deserializeDocumentSplunkRetryOptions(&sv.RetryOptions, value); err != nil {
return err
}
case "S3BackupMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SplunkS3BackupMode to be of type string, got %T instead", value)
}
sv.S3BackupMode = types.SplunkS3BackupMode(jtv)
}
case "S3DestinationDescription":
if err := awsAwsjson11_deserializeDocumentS3DestinationDescription(&sv.S3DestinationDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSplunkRetryOptions(v **types.SplunkRetryOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SplunkRetryOptions
if *v == nil {
sv = &types.SplunkRetryOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DurationInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SplunkRetryDurationInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DurationInSeconds = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSubnetIdList(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 NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
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_deserializeDocumentVpcConfigurationDescription(v **types.VpcConfigurationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.VpcConfigurationDescription
if *v == nil {
sv = &types.VpcConfigurationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.RoleARN = ptr.String(jtv)
}
case "SecurityGroupIds":
if err := awsAwsjson11_deserializeDocumentSecurityGroupIdList(&sv.SecurityGroupIds, value); err != nil {
return err
}
case "SubnetIds":
if err := awsAwsjson11_deserializeDocumentSubnetIdList(&sv.SubnetIds, value); err != nil {
return err
}
case "VpcId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NonEmptyStringWithoutWhitespace to be of type string, got %T instead", value)
}
sv.VpcId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateDeliveryStreamOutput(v **CreateDeliveryStreamOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateDeliveryStreamOutput
if *v == nil {
sv = &CreateDeliveryStreamOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeliveryStreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliveryStreamARN to be of type string, got %T instead", value)
}
sv.DeliveryStreamARN = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteDeliveryStreamOutput(v **DeleteDeliveryStreamOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteDeliveryStreamOutput
if *v == nil {
sv = &DeleteDeliveryStreamOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeDeliveryStreamOutput(v **DescribeDeliveryStreamOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeDeliveryStreamOutput
if *v == nil {
sv = &DescribeDeliveryStreamOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeliveryStreamDescription":
if err := awsAwsjson11_deserializeDocumentDeliveryStreamDescription(&sv.DeliveryStreamDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListDeliveryStreamsOutput(v **ListDeliveryStreamsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDeliveryStreamsOutput
if *v == nil {
sv = &ListDeliveryStreamsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeliveryStreamNames":
if err := awsAwsjson11_deserializeDocumentDeliveryStreamNameList(&sv.DeliveryStreamNames, value); err != nil {
return err
}
case "HasMoreDeliveryStreams":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.HasMoreDeliveryStreams = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForDeliveryStreamOutput(v **ListTagsForDeliveryStreamOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForDeliveryStreamOutput
if *v == nil {
sv = &ListTagsForDeliveryStreamOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "HasMoreTags":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.HasMoreTags = ptr.Bool(jtv)
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentListTagsForDeliveryStreamOutputTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutRecordBatchOutput(v **PutRecordBatchOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutRecordBatchOutput
if *v == nil {
sv = &PutRecordBatchOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Encrypted":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.Encrypted = ptr.Bool(jtv)
}
case "FailedPutCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected NonNegativeIntegerObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.FailedPutCount = ptr.Int32(int32(i64))
}
case "RequestResponses":
if err := awsAwsjson11_deserializeDocumentPutRecordBatchResponseEntryList(&sv.RequestResponses, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutRecordOutput(v **PutRecordOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutRecordOutput
if *v == nil {
sv = &PutRecordOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Encrypted":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.Encrypted = ptr.Bool(jtv)
}
case "RecordId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PutResponseRecordId to be of type string, got %T instead", value)
}
sv.RecordId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStartDeliveryStreamEncryptionOutput(v **StartDeliveryStreamEncryptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartDeliveryStreamEncryptionOutput
if *v == nil {
sv = &StartDeliveryStreamEncryptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStopDeliveryStreamEncryptionOutput(v **StopDeliveryStreamEncryptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StopDeliveryStreamEncryptionOutput
if *v == nil {
sv = &StopDeliveryStreamEncryptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentTagDeliveryStreamOutput(v **TagDeliveryStreamOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagDeliveryStreamOutput
if *v == nil {
sv = &TagDeliveryStreamOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUntagDeliveryStreamOutput(v **UntagDeliveryStreamOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagDeliveryStreamOutput
if *v == nil {
sv = &UntagDeliveryStreamOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateDestinationOutput(v **UpdateDestinationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateDestinationOutput
if *v == nil {
sv = &UpdateDestinationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 6,087 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package firehose provides the API client, operations, and parameter types for
// Amazon Kinesis Firehose.
//
// Amazon Kinesis Data Firehose API Reference Amazon Kinesis Data Firehose is a
// fully managed service that delivers real-time streaming data to destinations
// such as Amazon Simple Storage Service (Amazon S3), Amazon OpenSearch Service,
// Amazon Redshift, Splunk, and various other supportd destinations.
package firehose
| 11 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
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/firehose/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 = "firehose"
}
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 firehose
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.16.14"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/firehose/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"math"
"path"
)
type awsAwsjson11_serializeOpCreateDeliveryStream struct {
}
func (*awsAwsjson11_serializeOpCreateDeliveryStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateDeliveryStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDeliveryStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.CreateDeliveryStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateDeliveryStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteDeliveryStream struct {
}
func (*awsAwsjson11_serializeOpDeleteDeliveryStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteDeliveryStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDeliveryStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.DeleteDeliveryStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteDeliveryStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeDeliveryStream struct {
}
func (*awsAwsjson11_serializeOpDescribeDeliveryStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeDeliveryStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeDeliveryStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.DescribeDeliveryStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeDeliveryStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListDeliveryStreams struct {
}
func (*awsAwsjson11_serializeOpListDeliveryStreams) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListDeliveryStreams) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListDeliveryStreamsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.ListDeliveryStreams")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListDeliveryStreamsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForDeliveryStream struct {
}
func (*awsAwsjson11_serializeOpListTagsForDeliveryStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForDeliveryStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForDeliveryStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.ListTagsForDeliveryStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForDeliveryStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutRecord struct {
}
func (*awsAwsjson11_serializeOpPutRecord) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutRecord) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutRecordInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.PutRecord")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutRecordInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutRecordBatch struct {
}
func (*awsAwsjson11_serializeOpPutRecordBatch) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutRecordBatch) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutRecordBatchInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.PutRecordBatch")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutRecordBatchInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStartDeliveryStreamEncryption struct {
}
func (*awsAwsjson11_serializeOpStartDeliveryStreamEncryption) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartDeliveryStreamEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartDeliveryStreamEncryptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.StartDeliveryStreamEncryption")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartDeliveryStreamEncryptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStopDeliveryStreamEncryption struct {
}
func (*awsAwsjson11_serializeOpStopDeliveryStreamEncryption) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopDeliveryStreamEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopDeliveryStreamEncryptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.StopDeliveryStreamEncryption")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopDeliveryStreamEncryptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTagDeliveryStream struct {
}
func (*awsAwsjson11_serializeOpTagDeliveryStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTagDeliveryStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagDeliveryStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.TagDeliveryStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTagDeliveryStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUntagDeliveryStream struct {
}
func (*awsAwsjson11_serializeOpUntagDeliveryStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUntagDeliveryStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagDeliveryStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.UntagDeliveryStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUntagDeliveryStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateDestination struct {
}
func (*awsAwsjson11_serializeOpUpdateDestination) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateDestinationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Firehose_20150804.UpdateDestination")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateDestinationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if 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_serializeDocumentAmazonOpenSearchServerlessBufferingHints(v *types.AmazonOpenSearchServerlessBufferingHints, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IntervalInSeconds != nil {
ok := object.Key("IntervalInSeconds")
ok.Integer(*v.IntervalInSeconds)
}
if v.SizeInMBs != nil {
ok := object.Key("SizeInMBs")
ok.Integer(*v.SizeInMBs)
}
return nil
}
func awsAwsjson11_serializeDocumentAmazonOpenSearchServerlessDestinationConfiguration(v *types.AmazonOpenSearchServerlessDestinationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentAmazonOpenSearchServerlessBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.CollectionEndpoint != nil {
ok := object.Key("CollectionEndpoint")
ok.String(*v.CollectionEndpoint)
}
if v.IndexName != nil {
ok := object.Key("IndexName")
ok.String(*v.IndexName)
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentAmazonOpenSearchServerlessRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3Configuration != nil {
ok := object.Key("S3Configuration")
if err := awsAwsjson11_serializeDocumentS3DestinationConfiguration(v.S3Configuration, ok); err != nil {
return err
}
}
if v.VpcConfiguration != nil {
ok := object.Key("VpcConfiguration")
if err := awsAwsjson11_serializeDocumentVpcConfiguration(v.VpcConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAmazonOpenSearchServerlessDestinationUpdate(v *types.AmazonOpenSearchServerlessDestinationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentAmazonOpenSearchServerlessBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.CollectionEndpoint != nil {
ok := object.Key("CollectionEndpoint")
ok.String(*v.CollectionEndpoint)
}
if v.IndexName != nil {
ok := object.Key("IndexName")
ok.String(*v.IndexName)
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentAmazonOpenSearchServerlessRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if v.S3Update != nil {
ok := object.Key("S3Update")
if err := awsAwsjson11_serializeDocumentS3DestinationUpdate(v.S3Update, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAmazonOpenSearchServerlessRetryOptions(v *types.AmazonOpenSearchServerlessRetryOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DurationInSeconds != nil {
ok := object.Key("DurationInSeconds")
ok.Integer(*v.DurationInSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentAmazonopensearchserviceBufferingHints(v *types.AmazonopensearchserviceBufferingHints, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IntervalInSeconds != nil {
ok := object.Key("IntervalInSeconds")
ok.Integer(*v.IntervalInSeconds)
}
if v.SizeInMBs != nil {
ok := object.Key("SizeInMBs")
ok.Integer(*v.SizeInMBs)
}
return nil
}
func awsAwsjson11_serializeDocumentAmazonopensearchserviceDestinationConfiguration(v *types.AmazonopensearchserviceDestinationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentAmazonopensearchserviceBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.ClusterEndpoint != nil {
ok := object.Key("ClusterEndpoint")
ok.String(*v.ClusterEndpoint)
}
if v.DomainARN != nil {
ok := object.Key("DomainARN")
ok.String(*v.DomainARN)
}
if v.IndexName != nil {
ok := object.Key("IndexName")
ok.String(*v.IndexName)
}
if len(v.IndexRotationPeriod) > 0 {
ok := object.Key("IndexRotationPeriod")
ok.String(string(v.IndexRotationPeriod))
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentAmazonopensearchserviceRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3Configuration != nil {
ok := object.Key("S3Configuration")
if err := awsAwsjson11_serializeDocumentS3DestinationConfiguration(v.S3Configuration, ok); err != nil {
return err
}
}
if v.TypeName != nil {
ok := object.Key("TypeName")
ok.String(*v.TypeName)
}
if v.VpcConfiguration != nil {
ok := object.Key("VpcConfiguration")
if err := awsAwsjson11_serializeDocumentVpcConfiguration(v.VpcConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAmazonopensearchserviceDestinationUpdate(v *types.AmazonopensearchserviceDestinationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentAmazonopensearchserviceBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.ClusterEndpoint != nil {
ok := object.Key("ClusterEndpoint")
ok.String(*v.ClusterEndpoint)
}
if v.DomainARN != nil {
ok := object.Key("DomainARN")
ok.String(*v.DomainARN)
}
if v.IndexName != nil {
ok := object.Key("IndexName")
ok.String(*v.IndexName)
}
if len(v.IndexRotationPeriod) > 0 {
ok := object.Key("IndexRotationPeriod")
ok.String(string(v.IndexRotationPeriod))
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentAmazonopensearchserviceRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if v.S3Update != nil {
ok := object.Key("S3Update")
if err := awsAwsjson11_serializeDocumentS3DestinationUpdate(v.S3Update, ok); err != nil {
return err
}
}
if v.TypeName != nil {
ok := object.Key("TypeName")
ok.String(*v.TypeName)
}
return nil
}
func awsAwsjson11_serializeDocumentAmazonopensearchserviceRetryOptions(v *types.AmazonopensearchserviceRetryOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DurationInSeconds != nil {
ok := object.Key("DurationInSeconds")
ok.Integer(*v.DurationInSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentBufferingHints(v *types.BufferingHints, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IntervalInSeconds != nil {
ok := object.Key("IntervalInSeconds")
ok.Integer(*v.IntervalInSeconds)
}
if v.SizeInMBs != nil {
ok := object.Key("SizeInMBs")
ok.Integer(*v.SizeInMBs)
}
return nil
}
func awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v *types.CloudWatchLoggingOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Enabled != nil {
ok := object.Key("Enabled")
ok.Boolean(*v.Enabled)
}
if v.LogGroupName != nil {
ok := object.Key("LogGroupName")
ok.String(*v.LogGroupName)
}
if v.LogStreamName != nil {
ok := object.Key("LogStreamName")
ok.String(*v.LogStreamName)
}
return nil
}
func awsAwsjson11_serializeDocumentColumnToJsonKeyMappings(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsAwsjson11_serializeDocumentCopyCommand(v *types.CopyCommand, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CopyOptions != nil {
ok := object.Key("CopyOptions")
ok.String(*v.CopyOptions)
}
if v.DataTableColumns != nil {
ok := object.Key("DataTableColumns")
ok.String(*v.DataTableColumns)
}
if v.DataTableName != nil {
ok := object.Key("DataTableName")
ok.String(*v.DataTableName)
}
return nil
}
func awsAwsjson11_serializeDocumentDataFormatConversionConfiguration(v *types.DataFormatConversionConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Enabled != nil {
ok := object.Key("Enabled")
ok.Boolean(*v.Enabled)
}
if v.InputFormatConfiguration != nil {
ok := object.Key("InputFormatConfiguration")
if err := awsAwsjson11_serializeDocumentInputFormatConfiguration(v.InputFormatConfiguration, ok); err != nil {
return err
}
}
if v.OutputFormatConfiguration != nil {
ok := object.Key("OutputFormatConfiguration")
if err := awsAwsjson11_serializeDocumentOutputFormatConfiguration(v.OutputFormatConfiguration, ok); err != nil {
return err
}
}
if v.SchemaConfiguration != nil {
ok := object.Key("SchemaConfiguration")
if err := awsAwsjson11_serializeDocumentSchemaConfiguration(v.SchemaConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentDeliveryStreamEncryptionConfigurationInput(v *types.DeliveryStreamEncryptionConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KeyARN != nil {
ok := object.Key("KeyARN")
ok.String(*v.KeyARN)
}
if len(v.KeyType) > 0 {
ok := object.Key("KeyType")
ok.String(string(v.KeyType))
}
return nil
}
func awsAwsjson11_serializeDocumentDeserializer(v *types.Deserializer, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.HiveJsonSerDe != nil {
ok := object.Key("HiveJsonSerDe")
if err := awsAwsjson11_serializeDocumentHiveJsonSerDe(v.HiveJsonSerDe, ok); err != nil {
return err
}
}
if v.OpenXJsonSerDe != nil {
ok := object.Key("OpenXJsonSerDe")
if err := awsAwsjson11_serializeDocumentOpenXJsonSerDe(v.OpenXJsonSerDe, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentDynamicPartitioningConfiguration(v *types.DynamicPartitioningConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Enabled != nil {
ok := object.Key("Enabled")
ok.Boolean(*v.Enabled)
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentElasticsearchBufferingHints(v *types.ElasticsearchBufferingHints, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IntervalInSeconds != nil {
ok := object.Key("IntervalInSeconds")
ok.Integer(*v.IntervalInSeconds)
}
if v.SizeInMBs != nil {
ok := object.Key("SizeInMBs")
ok.Integer(*v.SizeInMBs)
}
return nil
}
func awsAwsjson11_serializeDocumentElasticsearchDestinationConfiguration(v *types.ElasticsearchDestinationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentElasticsearchBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.ClusterEndpoint != nil {
ok := object.Key("ClusterEndpoint")
ok.String(*v.ClusterEndpoint)
}
if v.DomainARN != nil {
ok := object.Key("DomainARN")
ok.String(*v.DomainARN)
}
if v.IndexName != nil {
ok := object.Key("IndexName")
ok.String(*v.IndexName)
}
if len(v.IndexRotationPeriod) > 0 {
ok := object.Key("IndexRotationPeriod")
ok.String(string(v.IndexRotationPeriod))
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentElasticsearchRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3Configuration != nil {
ok := object.Key("S3Configuration")
if err := awsAwsjson11_serializeDocumentS3DestinationConfiguration(v.S3Configuration, ok); err != nil {
return err
}
}
if v.TypeName != nil {
ok := object.Key("TypeName")
ok.String(*v.TypeName)
}
if v.VpcConfiguration != nil {
ok := object.Key("VpcConfiguration")
if err := awsAwsjson11_serializeDocumentVpcConfiguration(v.VpcConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentElasticsearchDestinationUpdate(v *types.ElasticsearchDestinationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentElasticsearchBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.ClusterEndpoint != nil {
ok := object.Key("ClusterEndpoint")
ok.String(*v.ClusterEndpoint)
}
if v.DomainARN != nil {
ok := object.Key("DomainARN")
ok.String(*v.DomainARN)
}
if v.IndexName != nil {
ok := object.Key("IndexName")
ok.String(*v.IndexName)
}
if len(v.IndexRotationPeriod) > 0 {
ok := object.Key("IndexRotationPeriod")
ok.String(string(v.IndexRotationPeriod))
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentElasticsearchRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if v.S3Update != nil {
ok := object.Key("S3Update")
if err := awsAwsjson11_serializeDocumentS3DestinationUpdate(v.S3Update, ok); err != nil {
return err
}
}
if v.TypeName != nil {
ok := object.Key("TypeName")
ok.String(*v.TypeName)
}
return nil
}
func awsAwsjson11_serializeDocumentElasticsearchRetryOptions(v *types.ElasticsearchRetryOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DurationInSeconds != nil {
ok := object.Key("DurationInSeconds")
ok.Integer(*v.DurationInSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentEncryptionConfiguration(v *types.EncryptionConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KMSEncryptionConfig != nil {
ok := object.Key("KMSEncryptionConfig")
if err := awsAwsjson11_serializeDocumentKMSEncryptionConfig(v.KMSEncryptionConfig, ok); err != nil {
return err
}
}
if len(v.NoEncryptionConfig) > 0 {
ok := object.Key("NoEncryptionConfig")
ok.String(string(v.NoEncryptionConfig))
}
return nil
}
func awsAwsjson11_serializeDocumentExtendedS3DestinationConfiguration(v *types.ExtendedS3DestinationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketARN != nil {
ok := object.Key("BucketARN")
ok.String(*v.BucketARN)
}
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if len(v.CompressionFormat) > 0 {
ok := object.Key("CompressionFormat")
ok.String(string(v.CompressionFormat))
}
if v.DataFormatConversionConfiguration != nil {
ok := object.Key("DataFormatConversionConfiguration")
if err := awsAwsjson11_serializeDocumentDataFormatConversionConfiguration(v.DataFormatConversionConfiguration, ok); err != nil {
return err
}
}
if v.DynamicPartitioningConfiguration != nil {
ok := object.Key("DynamicPartitioningConfiguration")
if err := awsAwsjson11_serializeDocumentDynamicPartitioningConfiguration(v.DynamicPartitioningConfiguration, ok); err != nil {
return err
}
}
if v.EncryptionConfiguration != nil {
ok := object.Key("EncryptionConfiguration")
if err := awsAwsjson11_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil {
return err
}
}
if v.ErrorOutputPrefix != nil {
ok := object.Key("ErrorOutputPrefix")
ok.String(*v.ErrorOutputPrefix)
}
if v.Prefix != nil {
ok := object.Key("Prefix")
ok.String(*v.Prefix)
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if v.S3BackupConfiguration != nil {
ok := object.Key("S3BackupConfiguration")
if err := awsAwsjson11_serializeDocumentS3DestinationConfiguration(v.S3BackupConfiguration, ok); err != nil {
return err
}
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
return nil
}
func awsAwsjson11_serializeDocumentExtendedS3DestinationUpdate(v *types.ExtendedS3DestinationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketARN != nil {
ok := object.Key("BucketARN")
ok.String(*v.BucketARN)
}
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if len(v.CompressionFormat) > 0 {
ok := object.Key("CompressionFormat")
ok.String(string(v.CompressionFormat))
}
if v.DataFormatConversionConfiguration != nil {
ok := object.Key("DataFormatConversionConfiguration")
if err := awsAwsjson11_serializeDocumentDataFormatConversionConfiguration(v.DataFormatConversionConfiguration, ok); err != nil {
return err
}
}
if v.DynamicPartitioningConfiguration != nil {
ok := object.Key("DynamicPartitioningConfiguration")
if err := awsAwsjson11_serializeDocumentDynamicPartitioningConfiguration(v.DynamicPartitioningConfiguration, ok); err != nil {
return err
}
}
if v.EncryptionConfiguration != nil {
ok := object.Key("EncryptionConfiguration")
if err := awsAwsjson11_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil {
return err
}
}
if v.ErrorOutputPrefix != nil {
ok := object.Key("ErrorOutputPrefix")
ok.String(*v.ErrorOutputPrefix)
}
if v.Prefix != nil {
ok := object.Key("Prefix")
ok.String(*v.Prefix)
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3BackupUpdate != nil {
ok := object.Key("S3BackupUpdate")
if err := awsAwsjson11_serializeDocumentS3DestinationUpdate(v.S3BackupUpdate, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentHiveJsonSerDe(v *types.HiveJsonSerDe, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TimestampFormats != nil {
ok := object.Key("TimestampFormats")
if err := awsAwsjson11_serializeDocumentListOfNonEmptyStrings(v.TimestampFormats, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentHttpEndpointBufferingHints(v *types.HttpEndpointBufferingHints, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IntervalInSeconds != nil {
ok := object.Key("IntervalInSeconds")
ok.Integer(*v.IntervalInSeconds)
}
if v.SizeInMBs != nil {
ok := object.Key("SizeInMBs")
ok.Integer(*v.SizeInMBs)
}
return nil
}
func awsAwsjson11_serializeDocumentHttpEndpointCommonAttribute(v *types.HttpEndpointCommonAttribute, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AttributeName != nil {
ok := object.Key("AttributeName")
ok.String(*v.AttributeName)
}
if v.AttributeValue != nil {
ok := object.Key("AttributeValue")
ok.String(*v.AttributeValue)
}
return nil
}
func awsAwsjson11_serializeDocumentHttpEndpointCommonAttributesList(v []types.HttpEndpointCommonAttribute, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentHttpEndpointCommonAttribute(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentHttpEndpointConfiguration(v *types.HttpEndpointConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessKey != nil {
ok := object.Key("AccessKey")
ok.String(*v.AccessKey)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Url != nil {
ok := object.Key("Url")
ok.String(*v.Url)
}
return nil
}
func awsAwsjson11_serializeDocumentHttpEndpointDestinationConfiguration(v *types.HttpEndpointDestinationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentHttpEndpointBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.EndpointConfiguration != nil {
ok := object.Key("EndpointConfiguration")
if err := awsAwsjson11_serializeDocumentHttpEndpointConfiguration(v.EndpointConfiguration, ok); err != nil {
return err
}
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RequestConfiguration != nil {
ok := object.Key("RequestConfiguration")
if err := awsAwsjson11_serializeDocumentHttpEndpointRequestConfiguration(v.RequestConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentHttpEndpointRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3Configuration != nil {
ok := object.Key("S3Configuration")
if err := awsAwsjson11_serializeDocumentS3DestinationConfiguration(v.S3Configuration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentHttpEndpointDestinationUpdate(v *types.HttpEndpointDestinationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentHttpEndpointBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.EndpointConfiguration != nil {
ok := object.Key("EndpointConfiguration")
if err := awsAwsjson11_serializeDocumentHttpEndpointConfiguration(v.EndpointConfiguration, ok); err != nil {
return err
}
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RequestConfiguration != nil {
ok := object.Key("RequestConfiguration")
if err := awsAwsjson11_serializeDocumentHttpEndpointRequestConfiguration(v.RequestConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentHttpEndpointRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3Update != nil {
ok := object.Key("S3Update")
if err := awsAwsjson11_serializeDocumentS3DestinationUpdate(v.S3Update, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentHttpEndpointRequestConfiguration(v *types.HttpEndpointRequestConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CommonAttributes != nil {
ok := object.Key("CommonAttributes")
if err := awsAwsjson11_serializeDocumentHttpEndpointCommonAttributesList(v.CommonAttributes, ok); err != nil {
return err
}
}
if len(v.ContentEncoding) > 0 {
ok := object.Key("ContentEncoding")
ok.String(string(v.ContentEncoding))
}
return nil
}
func awsAwsjson11_serializeDocumentHttpEndpointRetryOptions(v *types.HttpEndpointRetryOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DurationInSeconds != nil {
ok := object.Key("DurationInSeconds")
ok.Integer(*v.DurationInSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentInputFormatConfiguration(v *types.InputFormatConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Deserializer != nil {
ok := object.Key("Deserializer")
if err := awsAwsjson11_serializeDocumentDeserializer(v.Deserializer, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisStreamSourceConfiguration(v *types.KinesisStreamSourceConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KinesisStreamARN != nil {
ok := object.Key("KinesisStreamARN")
ok.String(*v.KinesisStreamARN)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentKMSEncryptionConfig(v *types.KMSEncryptionConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AWSKMSKeyARN != nil {
ok := object.Key("AWSKMSKeyARN")
ok.String(*v.AWSKMSKeyARN)
}
return nil
}
func awsAwsjson11_serializeDocumentListOfNonEmptyStrings(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_serializeDocumentListOfNonEmptyStringsWithoutWhitespace(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_serializeDocumentOpenXJsonSerDe(v *types.OpenXJsonSerDe, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CaseInsensitive != nil {
ok := object.Key("CaseInsensitive")
ok.Boolean(*v.CaseInsensitive)
}
if v.ColumnToJsonKeyMappings != nil {
ok := object.Key("ColumnToJsonKeyMappings")
if err := awsAwsjson11_serializeDocumentColumnToJsonKeyMappings(v.ColumnToJsonKeyMappings, ok); err != nil {
return err
}
}
if v.ConvertDotsInJsonKeysToUnderscores != nil {
ok := object.Key("ConvertDotsInJsonKeysToUnderscores")
ok.Boolean(*v.ConvertDotsInJsonKeysToUnderscores)
}
return nil
}
func awsAwsjson11_serializeDocumentOrcSerDe(v *types.OrcSerDe, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BlockSizeBytes != nil {
ok := object.Key("BlockSizeBytes")
ok.Integer(*v.BlockSizeBytes)
}
if v.BloomFilterColumns != nil {
ok := object.Key("BloomFilterColumns")
if err := awsAwsjson11_serializeDocumentListOfNonEmptyStringsWithoutWhitespace(v.BloomFilterColumns, ok); err != nil {
return err
}
}
if v.BloomFilterFalsePositiveProbability != nil {
ok := object.Key("BloomFilterFalsePositiveProbability")
switch {
case math.IsNaN(*v.BloomFilterFalsePositiveProbability):
ok.String("NaN")
case math.IsInf(*v.BloomFilterFalsePositiveProbability, 1):
ok.String("Infinity")
case math.IsInf(*v.BloomFilterFalsePositiveProbability, -1):
ok.String("-Infinity")
default:
ok.Double(*v.BloomFilterFalsePositiveProbability)
}
}
if len(v.Compression) > 0 {
ok := object.Key("Compression")
ok.String(string(v.Compression))
}
if v.DictionaryKeyThreshold != nil {
ok := object.Key("DictionaryKeyThreshold")
switch {
case math.IsNaN(*v.DictionaryKeyThreshold):
ok.String("NaN")
case math.IsInf(*v.DictionaryKeyThreshold, 1):
ok.String("Infinity")
case math.IsInf(*v.DictionaryKeyThreshold, -1):
ok.String("-Infinity")
default:
ok.Double(*v.DictionaryKeyThreshold)
}
}
if v.EnablePadding != nil {
ok := object.Key("EnablePadding")
ok.Boolean(*v.EnablePadding)
}
if len(v.FormatVersion) > 0 {
ok := object.Key("FormatVersion")
ok.String(string(v.FormatVersion))
}
if v.PaddingTolerance != nil {
ok := object.Key("PaddingTolerance")
switch {
case math.IsNaN(*v.PaddingTolerance):
ok.String("NaN")
case math.IsInf(*v.PaddingTolerance, 1):
ok.String("Infinity")
case math.IsInf(*v.PaddingTolerance, -1):
ok.String("-Infinity")
default:
ok.Double(*v.PaddingTolerance)
}
}
if v.RowIndexStride != nil {
ok := object.Key("RowIndexStride")
ok.Integer(*v.RowIndexStride)
}
if v.StripeSizeBytes != nil {
ok := object.Key("StripeSizeBytes")
ok.Integer(*v.StripeSizeBytes)
}
return nil
}
func awsAwsjson11_serializeDocumentOutputFormatConfiguration(v *types.OutputFormatConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Serializer != nil {
ok := object.Key("Serializer")
if err := awsAwsjson11_serializeDocumentSerializer(v.Serializer, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentParquetSerDe(v *types.ParquetSerDe, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BlockSizeBytes != nil {
ok := object.Key("BlockSizeBytes")
ok.Integer(*v.BlockSizeBytes)
}
if len(v.Compression) > 0 {
ok := object.Key("Compression")
ok.String(string(v.Compression))
}
if v.EnableDictionaryCompression != nil {
ok := object.Key("EnableDictionaryCompression")
ok.Boolean(*v.EnableDictionaryCompression)
}
if v.MaxPaddingBytes != nil {
ok := object.Key("MaxPaddingBytes")
ok.Integer(*v.MaxPaddingBytes)
}
if v.PageSizeBytes != nil {
ok := object.Key("PageSizeBytes")
ok.Integer(*v.PageSizeBytes)
}
if len(v.WriterVersion) > 0 {
ok := object.Key("WriterVersion")
ok.String(string(v.WriterVersion))
}
return nil
}
func awsAwsjson11_serializeDocumentProcessingConfiguration(v *types.ProcessingConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Enabled != nil {
ok := object.Key("Enabled")
ok.Boolean(*v.Enabled)
}
if v.Processors != nil {
ok := object.Key("Processors")
if err := awsAwsjson11_serializeDocumentProcessorList(v.Processors, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentProcessor(v *types.Processor, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Parameters != nil {
ok := object.Key("Parameters")
if err := awsAwsjson11_serializeDocumentProcessorParameterList(v.Parameters, ok); err != nil {
return err
}
}
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentProcessorList(v []types.Processor, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentProcessor(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentProcessorParameter(v *types.ProcessorParameter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ParameterName) > 0 {
ok := object.Key("ParameterName")
ok.String(string(v.ParameterName))
}
if v.ParameterValue != nil {
ok := object.Key("ParameterValue")
ok.String(*v.ParameterValue)
}
return nil
}
func awsAwsjson11_serializeDocumentProcessorParameterList(v []types.ProcessorParameter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentProcessorParameter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentPutRecordBatchRequestEntryList(v []types.Record, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRecord(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRecord(v *types.Record, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("Data")
ok.Base64EncodeBytes(v.Data)
}
return nil
}
func awsAwsjson11_serializeDocumentRedshiftDestinationConfiguration(v *types.RedshiftDestinationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.ClusterJDBCURL != nil {
ok := object.Key("ClusterJDBCURL")
ok.String(*v.ClusterJDBCURL)
}
if v.CopyCommand != nil {
ok := object.Key("CopyCommand")
if err := awsAwsjson11_serializeDocumentCopyCommand(v.CopyCommand, ok); err != nil {
return err
}
}
if v.Password != nil {
ok := object.Key("Password")
ok.String(*v.Password)
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentRedshiftRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if v.S3BackupConfiguration != nil {
ok := object.Key("S3BackupConfiguration")
if err := awsAwsjson11_serializeDocumentS3DestinationConfiguration(v.S3BackupConfiguration, ok); err != nil {
return err
}
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3Configuration != nil {
ok := object.Key("S3Configuration")
if err := awsAwsjson11_serializeDocumentS3DestinationConfiguration(v.S3Configuration, ok); err != nil {
return err
}
}
if v.Username != nil {
ok := object.Key("Username")
ok.String(*v.Username)
}
return nil
}
func awsAwsjson11_serializeDocumentRedshiftDestinationUpdate(v *types.RedshiftDestinationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.ClusterJDBCURL != nil {
ok := object.Key("ClusterJDBCURL")
ok.String(*v.ClusterJDBCURL)
}
if v.CopyCommand != nil {
ok := object.Key("CopyCommand")
if err := awsAwsjson11_serializeDocumentCopyCommand(v.CopyCommand, ok); err != nil {
return err
}
}
if v.Password != nil {
ok := object.Key("Password")
ok.String(*v.Password)
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentRedshiftRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3BackupUpdate != nil {
ok := object.Key("S3BackupUpdate")
if err := awsAwsjson11_serializeDocumentS3DestinationUpdate(v.S3BackupUpdate, ok); err != nil {
return err
}
}
if v.S3Update != nil {
ok := object.Key("S3Update")
if err := awsAwsjson11_serializeDocumentS3DestinationUpdate(v.S3Update, ok); err != nil {
return err
}
}
if v.Username != nil {
ok := object.Key("Username")
ok.String(*v.Username)
}
return nil
}
func awsAwsjson11_serializeDocumentRedshiftRetryOptions(v *types.RedshiftRetryOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DurationInSeconds != nil {
ok := object.Key("DurationInSeconds")
ok.Integer(*v.DurationInSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentRetryOptions(v *types.RetryOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DurationInSeconds != nil {
ok := object.Key("DurationInSeconds")
ok.Integer(*v.DurationInSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentS3DestinationConfiguration(v *types.S3DestinationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketARN != nil {
ok := object.Key("BucketARN")
ok.String(*v.BucketARN)
}
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if len(v.CompressionFormat) > 0 {
ok := object.Key("CompressionFormat")
ok.String(string(v.CompressionFormat))
}
if v.EncryptionConfiguration != nil {
ok := object.Key("EncryptionConfiguration")
if err := awsAwsjson11_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil {
return err
}
}
if v.ErrorOutputPrefix != nil {
ok := object.Key("ErrorOutputPrefix")
ok.String(*v.ErrorOutputPrefix)
}
if v.Prefix != nil {
ok := object.Key("Prefix")
ok.String(*v.Prefix)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentS3DestinationUpdate(v *types.S3DestinationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketARN != nil {
ok := object.Key("BucketARN")
ok.String(*v.BucketARN)
}
if v.BufferingHints != nil {
ok := object.Key("BufferingHints")
if err := awsAwsjson11_serializeDocumentBufferingHints(v.BufferingHints, ok); err != nil {
return err
}
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if len(v.CompressionFormat) > 0 {
ok := object.Key("CompressionFormat")
ok.String(string(v.CompressionFormat))
}
if v.EncryptionConfiguration != nil {
ok := object.Key("EncryptionConfiguration")
if err := awsAwsjson11_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil {
return err
}
}
if v.ErrorOutputPrefix != nil {
ok := object.Key("ErrorOutputPrefix")
ok.String(*v.ErrorOutputPrefix)
}
if v.Prefix != nil {
ok := object.Key("Prefix")
ok.String(*v.Prefix)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentSchemaConfiguration(v *types.SchemaConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CatalogId != nil {
ok := object.Key("CatalogId")
ok.String(*v.CatalogId)
}
if v.DatabaseName != nil {
ok := object.Key("DatabaseName")
ok.String(*v.DatabaseName)
}
if v.Region != nil {
ok := object.Key("Region")
ok.String(*v.Region)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if v.TableName != nil {
ok := object.Key("TableName")
ok.String(*v.TableName)
}
if v.VersionId != nil {
ok := object.Key("VersionId")
ok.String(*v.VersionId)
}
return nil
}
func awsAwsjson11_serializeDocumentSecurityGroupIdList(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_serializeDocumentSerializer(v *types.Serializer, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.OrcSerDe != nil {
ok := object.Key("OrcSerDe")
if err := awsAwsjson11_serializeDocumentOrcSerDe(v.OrcSerDe, ok); err != nil {
return err
}
}
if v.ParquetSerDe != nil {
ok := object.Key("ParquetSerDe")
if err := awsAwsjson11_serializeDocumentParquetSerDe(v.ParquetSerDe, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSplunkDestinationConfiguration(v *types.SplunkDestinationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.HECAcknowledgmentTimeoutInSeconds != nil {
ok := object.Key("HECAcknowledgmentTimeoutInSeconds")
ok.Integer(*v.HECAcknowledgmentTimeoutInSeconds)
}
if v.HECEndpoint != nil {
ok := object.Key("HECEndpoint")
ok.String(*v.HECEndpoint)
}
if len(v.HECEndpointType) > 0 {
ok := object.Key("HECEndpointType")
ok.String(string(v.HECEndpointType))
}
if v.HECToken != nil {
ok := object.Key("HECToken")
ok.String(*v.HECToken)
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentSplunkRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3Configuration != nil {
ok := object.Key("S3Configuration")
if err := awsAwsjson11_serializeDocumentS3DestinationConfiguration(v.S3Configuration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSplunkDestinationUpdate(v *types.SplunkDestinationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.HECAcknowledgmentTimeoutInSeconds != nil {
ok := object.Key("HECAcknowledgmentTimeoutInSeconds")
ok.Integer(*v.HECAcknowledgmentTimeoutInSeconds)
}
if v.HECEndpoint != nil {
ok := object.Key("HECEndpoint")
ok.String(*v.HECEndpoint)
}
if len(v.HECEndpointType) > 0 {
ok := object.Key("HECEndpointType")
ok.String(string(v.HECEndpointType))
}
if v.HECToken != nil {
ok := object.Key("HECToken")
ok.String(*v.HECToken)
}
if v.ProcessingConfiguration != nil {
ok := object.Key("ProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentProcessingConfiguration(v.ProcessingConfiguration, ok); err != nil {
return err
}
}
if v.RetryOptions != nil {
ok := object.Key("RetryOptions")
if err := awsAwsjson11_serializeDocumentSplunkRetryOptions(v.RetryOptions, ok); err != nil {
return err
}
}
if len(v.S3BackupMode) > 0 {
ok := object.Key("S3BackupMode")
ok.String(string(v.S3BackupMode))
}
if v.S3Update != nil {
ok := object.Key("S3Update")
if err := awsAwsjson11_serializeDocumentS3DestinationUpdate(v.S3Update, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSplunkRetryOptions(v *types.SplunkRetryOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DurationInSeconds != nil {
ok := object.Key("DurationInSeconds")
ok.Integer(*v.DurationInSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentSubnetIdList(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_serializeDocumentTagDeliveryStreamInputTagList(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_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_serializeDocumentVpcConfiguration(v *types.VpcConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if v.SecurityGroupIds != nil {
ok := object.Key("SecurityGroupIds")
if err := awsAwsjson11_serializeDocumentSecurityGroupIdList(v.SecurityGroupIds, ok); err != nil {
return err
}
}
if v.SubnetIds != nil {
ok := object.Key("SubnetIds")
if err := awsAwsjson11_serializeDocumentSubnetIdList(v.SubnetIds, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateDeliveryStreamInput(v *CreateDeliveryStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AmazonOpenSearchServerlessDestinationConfiguration != nil {
ok := object.Key("AmazonOpenSearchServerlessDestinationConfiguration")
if err := awsAwsjson11_serializeDocumentAmazonOpenSearchServerlessDestinationConfiguration(v.AmazonOpenSearchServerlessDestinationConfiguration, ok); err != nil {
return err
}
}
if v.AmazonopensearchserviceDestinationConfiguration != nil {
ok := object.Key("AmazonopensearchserviceDestinationConfiguration")
if err := awsAwsjson11_serializeDocumentAmazonopensearchserviceDestinationConfiguration(v.AmazonopensearchserviceDestinationConfiguration, ok); err != nil {
return err
}
}
if v.DeliveryStreamEncryptionConfigurationInput != nil {
ok := object.Key("DeliveryStreamEncryptionConfigurationInput")
if err := awsAwsjson11_serializeDocumentDeliveryStreamEncryptionConfigurationInput(v.DeliveryStreamEncryptionConfigurationInput, ok); err != nil {
return err
}
}
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
if len(v.DeliveryStreamType) > 0 {
ok := object.Key("DeliveryStreamType")
ok.String(string(v.DeliveryStreamType))
}
if v.ElasticsearchDestinationConfiguration != nil {
ok := object.Key("ElasticsearchDestinationConfiguration")
if err := awsAwsjson11_serializeDocumentElasticsearchDestinationConfiguration(v.ElasticsearchDestinationConfiguration, ok); err != nil {
return err
}
}
if v.ExtendedS3DestinationConfiguration != nil {
ok := object.Key("ExtendedS3DestinationConfiguration")
if err := awsAwsjson11_serializeDocumentExtendedS3DestinationConfiguration(v.ExtendedS3DestinationConfiguration, ok); err != nil {
return err
}
}
if v.HttpEndpointDestinationConfiguration != nil {
ok := object.Key("HttpEndpointDestinationConfiguration")
if err := awsAwsjson11_serializeDocumentHttpEndpointDestinationConfiguration(v.HttpEndpointDestinationConfiguration, ok); err != nil {
return err
}
}
if v.KinesisStreamSourceConfiguration != nil {
ok := object.Key("KinesisStreamSourceConfiguration")
if err := awsAwsjson11_serializeDocumentKinesisStreamSourceConfiguration(v.KinesisStreamSourceConfiguration, ok); err != nil {
return err
}
}
if v.RedshiftDestinationConfiguration != nil {
ok := object.Key("RedshiftDestinationConfiguration")
if err := awsAwsjson11_serializeDocumentRedshiftDestinationConfiguration(v.RedshiftDestinationConfiguration, ok); err != nil {
return err
}
}
if v.S3DestinationConfiguration != nil {
ok := object.Key("S3DestinationConfiguration")
if err := awsAwsjson11_serializeDocumentS3DestinationConfiguration(v.S3DestinationConfiguration, ok); err != nil {
return err
}
}
if v.SplunkDestinationConfiguration != nil {
ok := object.Key("SplunkDestinationConfiguration")
if err := awsAwsjson11_serializeDocumentSplunkDestinationConfiguration(v.SplunkDestinationConfiguration, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagDeliveryStreamInputTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteDeliveryStreamInput(v *DeleteDeliveryStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowForceDelete != nil {
ok := object.Key("AllowForceDelete")
ok.Boolean(*v.AllowForceDelete)
}
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeDeliveryStreamInput(v *DescribeDeliveryStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
if v.ExclusiveStartDestinationId != nil {
ok := object.Key("ExclusiveStartDestinationId")
ok.String(*v.ExclusiveStartDestinationId)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListDeliveryStreamsInput(v *ListDeliveryStreamsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DeliveryStreamType) > 0 {
ok := object.Key("DeliveryStreamType")
ok.String(string(v.DeliveryStreamType))
}
if v.ExclusiveStartDeliveryStreamName != nil {
ok := object.Key("ExclusiveStartDeliveryStreamName")
ok.String(*v.ExclusiveStartDeliveryStreamName)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForDeliveryStreamInput(v *ListTagsForDeliveryStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
if v.ExclusiveStartTagKey != nil {
ok := object.Key("ExclusiveStartTagKey")
ok.String(*v.ExclusiveStartTagKey)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutRecordBatchInput(v *PutRecordBatchInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
if v.Records != nil {
ok := object.Key("Records")
if err := awsAwsjson11_serializeDocumentPutRecordBatchRequestEntryList(v.Records, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutRecordInput(v *PutRecordInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
if v.Record != nil {
ok := object.Key("Record")
if err := awsAwsjson11_serializeDocumentRecord(v.Record, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartDeliveryStreamEncryptionInput(v *StartDeliveryStreamEncryptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeliveryStreamEncryptionConfigurationInput != nil {
ok := object.Key("DeliveryStreamEncryptionConfigurationInput")
if err := awsAwsjson11_serializeDocumentDeliveryStreamEncryptionConfigurationInput(v.DeliveryStreamEncryptionConfigurationInput, ok); err != nil {
return err
}
}
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopDeliveryStreamEncryptionInput(v *StopDeliveryStreamEncryptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagDeliveryStreamInput(v *TagDeliveryStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagDeliveryStreamInputTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUntagDeliveryStreamInput(v *UntagDeliveryStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateDestinationInput(v *UpdateDestinationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AmazonOpenSearchServerlessDestinationUpdate != nil {
ok := object.Key("AmazonOpenSearchServerlessDestinationUpdate")
if err := awsAwsjson11_serializeDocumentAmazonOpenSearchServerlessDestinationUpdate(v.AmazonOpenSearchServerlessDestinationUpdate, ok); err != nil {
return err
}
}
if v.AmazonopensearchserviceDestinationUpdate != nil {
ok := object.Key("AmazonopensearchserviceDestinationUpdate")
if err := awsAwsjson11_serializeDocumentAmazonopensearchserviceDestinationUpdate(v.AmazonopensearchserviceDestinationUpdate, ok); err != nil {
return err
}
}
if v.CurrentDeliveryStreamVersionId != nil {
ok := object.Key("CurrentDeliveryStreamVersionId")
ok.String(*v.CurrentDeliveryStreamVersionId)
}
if v.DeliveryStreamName != nil {
ok := object.Key("DeliveryStreamName")
ok.String(*v.DeliveryStreamName)
}
if v.DestinationId != nil {
ok := object.Key("DestinationId")
ok.String(*v.DestinationId)
}
if v.ElasticsearchDestinationUpdate != nil {
ok := object.Key("ElasticsearchDestinationUpdate")
if err := awsAwsjson11_serializeDocumentElasticsearchDestinationUpdate(v.ElasticsearchDestinationUpdate, ok); err != nil {
return err
}
}
if v.ExtendedS3DestinationUpdate != nil {
ok := object.Key("ExtendedS3DestinationUpdate")
if err := awsAwsjson11_serializeDocumentExtendedS3DestinationUpdate(v.ExtendedS3DestinationUpdate, ok); err != nil {
return err
}
}
if v.HttpEndpointDestinationUpdate != nil {
ok := object.Key("HttpEndpointDestinationUpdate")
if err := awsAwsjson11_serializeDocumentHttpEndpointDestinationUpdate(v.HttpEndpointDestinationUpdate, ok); err != nil {
return err
}
}
if v.RedshiftDestinationUpdate != nil {
ok := object.Key("RedshiftDestinationUpdate")
if err := awsAwsjson11_serializeDocumentRedshiftDestinationUpdate(v.RedshiftDestinationUpdate, ok); err != nil {
return err
}
}
if v.S3DestinationUpdate != nil {
ok := object.Key("S3DestinationUpdate")
if err := awsAwsjson11_serializeDocumentS3DestinationUpdate(v.S3DestinationUpdate, ok); err != nil {
return err
}
}
if v.SplunkDestinationUpdate != nil {
ok := object.Key("SplunkDestinationUpdate")
if err := awsAwsjson11_serializeDocumentSplunkDestinationUpdate(v.SplunkDestinationUpdate, ok); err != nil {
return err
}
}
return nil
}
| 3,064 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package firehose
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/firehose/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateDeliveryStream struct {
}
func (*validateOpCreateDeliveryStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDeliveryStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDeliveryStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDeliveryStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDeliveryStream struct {
}
func (*validateOpDeleteDeliveryStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDeliveryStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDeliveryStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDeliveryStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeDeliveryStream struct {
}
func (*validateOpDescribeDeliveryStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeDeliveryStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeDeliveryStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeDeliveryStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTagsForDeliveryStream struct {
}
func (*validateOpListTagsForDeliveryStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTagsForDeliveryStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsForDeliveryStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsForDeliveryStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutRecordBatch struct {
}
func (*validateOpPutRecordBatch) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutRecordBatch) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutRecordBatchInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutRecordBatchInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutRecord struct {
}
func (*validateOpPutRecord) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutRecord) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutRecordInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutRecordInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartDeliveryStreamEncryption struct {
}
func (*validateOpStartDeliveryStreamEncryption) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartDeliveryStreamEncryption) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartDeliveryStreamEncryptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartDeliveryStreamEncryptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopDeliveryStreamEncryption struct {
}
func (*validateOpStopDeliveryStreamEncryption) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopDeliveryStreamEncryption) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopDeliveryStreamEncryptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopDeliveryStreamEncryptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagDeliveryStream struct {
}
func (*validateOpTagDeliveryStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagDeliveryStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagDeliveryStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagDeliveryStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagDeliveryStream struct {
}
func (*validateOpUntagDeliveryStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagDeliveryStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagDeliveryStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagDeliveryStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateDestination struct {
}
func (*validateOpUpdateDestination) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateDestinationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateDestinationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateDeliveryStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDeliveryStream{}, middleware.After)
}
func addOpDeleteDeliveryStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDeliveryStream{}, middleware.After)
}
func addOpDescribeDeliveryStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeDeliveryStream{}, middleware.After)
}
func addOpListTagsForDeliveryStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForDeliveryStream{}, middleware.After)
}
func addOpPutRecordBatchValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutRecordBatch{}, middleware.After)
}
func addOpPutRecordValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutRecord{}, middleware.After)
}
func addOpStartDeliveryStreamEncryptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartDeliveryStreamEncryption{}, middleware.After)
}
func addOpStopDeliveryStreamEncryptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopDeliveryStreamEncryption{}, middleware.After)
}
func addOpTagDeliveryStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagDeliveryStream{}, middleware.After)
}
func addOpUntagDeliveryStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagDeliveryStream{}, middleware.After)
}
func addOpUpdateDestinationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateDestination{}, middleware.After)
}
func validateAmazonOpenSearchServerlessDestinationConfiguration(v *types.AmazonOpenSearchServerlessDestinationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AmazonOpenSearchServerlessDestinationConfiguration"}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if v.S3Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Configuration"))
} else if v.S3Configuration != nil {
if err := validateS3DestinationConfiguration(v.S3Configuration); err != nil {
invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.VpcConfiguration != nil {
if err := validateVpcConfiguration(v.VpcConfiguration); err != nil {
invalidParams.AddNested("VpcConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAmazonOpenSearchServerlessDestinationUpdate(v *types.AmazonOpenSearchServerlessDestinationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AmazonOpenSearchServerlessDestinationUpdate"}
if v.S3Update != nil {
if err := validateS3DestinationUpdate(v.S3Update); err != nil {
invalidParams.AddNested("S3Update", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAmazonopensearchserviceDestinationConfiguration(v *types.AmazonopensearchserviceDestinationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AmazonopensearchserviceDestinationConfiguration"}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if v.S3Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Configuration"))
} else if v.S3Configuration != nil {
if err := validateS3DestinationConfiguration(v.S3Configuration); err != nil {
invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.VpcConfiguration != nil {
if err := validateVpcConfiguration(v.VpcConfiguration); err != nil {
invalidParams.AddNested("VpcConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAmazonopensearchserviceDestinationUpdate(v *types.AmazonopensearchserviceDestinationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AmazonopensearchserviceDestinationUpdate"}
if v.S3Update != nil {
if err := validateS3DestinationUpdate(v.S3Update); err != nil {
invalidParams.AddNested("S3Update", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCopyCommand(v *types.CopyCommand) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CopyCommand"}
if v.DataTableName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DataTableName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDeliveryStreamEncryptionConfigurationInput(v *types.DeliveryStreamEncryptionConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeliveryStreamEncryptionConfigurationInput"}
if len(v.KeyType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("KeyType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateElasticsearchDestinationConfiguration(v *types.ElasticsearchDestinationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ElasticsearchDestinationConfiguration"}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if v.IndexName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IndexName"))
}
if v.S3Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Configuration"))
} else if v.S3Configuration != nil {
if err := validateS3DestinationConfiguration(v.S3Configuration); err != nil {
invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.VpcConfiguration != nil {
if err := validateVpcConfiguration(v.VpcConfiguration); err != nil {
invalidParams.AddNested("VpcConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateElasticsearchDestinationUpdate(v *types.ElasticsearchDestinationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ElasticsearchDestinationUpdate"}
if v.S3Update != nil {
if err := validateS3DestinationUpdate(v.S3Update); err != nil {
invalidParams.AddNested("S3Update", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEncryptionConfiguration(v *types.EncryptionConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EncryptionConfiguration"}
if v.KMSEncryptionConfig != nil {
if err := validateKMSEncryptionConfig(v.KMSEncryptionConfig); err != nil {
invalidParams.AddNested("KMSEncryptionConfig", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExtendedS3DestinationConfiguration(v *types.ExtendedS3DestinationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExtendedS3DestinationConfiguration"}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if v.BucketARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketARN"))
}
if v.EncryptionConfiguration != nil {
if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil {
invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.S3BackupConfiguration != nil {
if err := validateS3DestinationConfiguration(v.S3BackupConfiguration); err != nil {
invalidParams.AddNested("S3BackupConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExtendedS3DestinationUpdate(v *types.ExtendedS3DestinationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExtendedS3DestinationUpdate"}
if v.EncryptionConfiguration != nil {
if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil {
invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.S3BackupUpdate != nil {
if err := validateS3DestinationUpdate(v.S3BackupUpdate); err != nil {
invalidParams.AddNested("S3BackupUpdate", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHttpEndpointCommonAttribute(v *types.HttpEndpointCommonAttribute) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HttpEndpointCommonAttribute"}
if v.AttributeName == nil {
invalidParams.Add(smithy.NewErrParamRequired("AttributeName"))
}
if v.AttributeValue == nil {
invalidParams.Add(smithy.NewErrParamRequired("AttributeValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHttpEndpointCommonAttributesList(v []types.HttpEndpointCommonAttribute) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HttpEndpointCommonAttributesList"}
for i := range v {
if err := validateHttpEndpointCommonAttribute(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHttpEndpointConfiguration(v *types.HttpEndpointConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HttpEndpointConfiguration"}
if v.Url == nil {
invalidParams.Add(smithy.NewErrParamRequired("Url"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHttpEndpointDestinationConfiguration(v *types.HttpEndpointDestinationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HttpEndpointDestinationConfiguration"}
if v.EndpointConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndpointConfiguration"))
} else if v.EndpointConfiguration != nil {
if err := validateHttpEndpointConfiguration(v.EndpointConfiguration); err != nil {
invalidParams.AddNested("EndpointConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.RequestConfiguration != nil {
if err := validateHttpEndpointRequestConfiguration(v.RequestConfiguration); err != nil {
invalidParams.AddNested("RequestConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.S3Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Configuration"))
} else if v.S3Configuration != nil {
if err := validateS3DestinationConfiguration(v.S3Configuration); err != nil {
invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHttpEndpointDestinationUpdate(v *types.HttpEndpointDestinationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HttpEndpointDestinationUpdate"}
if v.EndpointConfiguration != nil {
if err := validateHttpEndpointConfiguration(v.EndpointConfiguration); err != nil {
invalidParams.AddNested("EndpointConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.RequestConfiguration != nil {
if err := validateHttpEndpointRequestConfiguration(v.RequestConfiguration); err != nil {
invalidParams.AddNested("RequestConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.S3Update != nil {
if err := validateS3DestinationUpdate(v.S3Update); err != nil {
invalidParams.AddNested("S3Update", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHttpEndpointRequestConfiguration(v *types.HttpEndpointRequestConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HttpEndpointRequestConfiguration"}
if v.CommonAttributes != nil {
if err := validateHttpEndpointCommonAttributesList(v.CommonAttributes); err != nil {
invalidParams.AddNested("CommonAttributes", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKinesisStreamSourceConfiguration(v *types.KinesisStreamSourceConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KinesisStreamSourceConfiguration"}
if v.KinesisStreamARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("KinesisStreamARN"))
}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKMSEncryptionConfig(v *types.KMSEncryptionConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KMSEncryptionConfig"}
if v.AWSKMSKeyARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("AWSKMSKeyARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProcessingConfiguration(v *types.ProcessingConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProcessingConfiguration"}
if v.Processors != nil {
if err := validateProcessorList(v.Processors); err != nil {
invalidParams.AddNested("Processors", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProcessor(v *types.Processor) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Processor"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.Parameters != nil {
if err := validateProcessorParameterList(v.Parameters); err != nil {
invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProcessorList(v []types.Processor) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProcessorList"}
for i := range v {
if err := validateProcessor(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProcessorParameter(v *types.ProcessorParameter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProcessorParameter"}
if len(v.ParameterName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ParameterName"))
}
if v.ParameterValue == nil {
invalidParams.Add(smithy.NewErrParamRequired("ParameterValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateProcessorParameterList(v []types.ProcessorParameter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ProcessorParameterList"}
for i := range v {
if err := validateProcessorParameter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePutRecordBatchRequestEntryList(v []types.Record) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutRecordBatchRequestEntryList"}
for i := range v {
if err := validateRecord(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRecord(v *types.Record) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Record"}
if v.Data == nil {
invalidParams.Add(smithy.NewErrParamRequired("Data"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRedshiftDestinationConfiguration(v *types.RedshiftDestinationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RedshiftDestinationConfiguration"}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if v.ClusterJDBCURL == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterJDBCURL"))
}
if v.CopyCommand == nil {
invalidParams.Add(smithy.NewErrParamRequired("CopyCommand"))
} else if v.CopyCommand != nil {
if err := validateCopyCommand(v.CopyCommand); err != nil {
invalidParams.AddNested("CopyCommand", err.(smithy.InvalidParamsError))
}
}
if v.Username == nil {
invalidParams.Add(smithy.NewErrParamRequired("Username"))
}
if v.Password == nil {
invalidParams.Add(smithy.NewErrParamRequired("Password"))
}
if v.S3Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Configuration"))
} else if v.S3Configuration != nil {
if err := validateS3DestinationConfiguration(v.S3Configuration); err != nil {
invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.S3BackupConfiguration != nil {
if err := validateS3DestinationConfiguration(v.S3BackupConfiguration); err != nil {
invalidParams.AddNested("S3BackupConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRedshiftDestinationUpdate(v *types.RedshiftDestinationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RedshiftDestinationUpdate"}
if v.CopyCommand != nil {
if err := validateCopyCommand(v.CopyCommand); err != nil {
invalidParams.AddNested("CopyCommand", err.(smithy.InvalidParamsError))
}
}
if v.S3Update != nil {
if err := validateS3DestinationUpdate(v.S3Update); err != nil {
invalidParams.AddNested("S3Update", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.S3BackupUpdate != nil {
if err := validateS3DestinationUpdate(v.S3BackupUpdate); err != nil {
invalidParams.AddNested("S3BackupUpdate", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3DestinationConfiguration(v *types.S3DestinationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3DestinationConfiguration"}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if v.BucketARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketARN"))
}
if v.EncryptionConfiguration != nil {
if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil {
invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3DestinationUpdate(v *types.S3DestinationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3DestinationUpdate"}
if v.EncryptionConfiguration != nil {
if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil {
invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSplunkDestinationConfiguration(v *types.SplunkDestinationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SplunkDestinationConfiguration"}
if v.HECEndpoint == nil {
invalidParams.Add(smithy.NewErrParamRequired("HECEndpoint"))
}
if len(v.HECEndpointType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("HECEndpointType"))
}
if v.HECToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("HECToken"))
}
if v.S3Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Configuration"))
} else if v.S3Configuration != nil {
if err := validateS3DestinationConfiguration(v.S3Configuration); err != nil {
invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSplunkDestinationUpdate(v *types.SplunkDestinationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SplunkDestinationUpdate"}
if v.S3Update != nil {
if err := validateS3DestinationUpdate(v.S3Update); err != nil {
invalidParams.AddNested("S3Update", err.(smithy.InvalidParamsError))
}
}
if v.ProcessingConfiguration != nil {
if err := validateProcessingConfiguration(v.ProcessingConfiguration); err != nil {
invalidParams.AddNested("ProcessingConfiguration", 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 invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTagDeliveryStreamInputTagList(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagDeliveryStreamInputTagList"}
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 validateVpcConfiguration(v *types.VpcConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "VpcConfiguration"}
if v.SubnetIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubnetIds"))
}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if v.SecurityGroupIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("SecurityGroupIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDeliveryStreamInput(v *CreateDeliveryStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDeliveryStreamInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if v.KinesisStreamSourceConfiguration != nil {
if err := validateKinesisStreamSourceConfiguration(v.KinesisStreamSourceConfiguration); err != nil {
invalidParams.AddNested("KinesisStreamSourceConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.DeliveryStreamEncryptionConfigurationInput != nil {
if err := validateDeliveryStreamEncryptionConfigurationInput(v.DeliveryStreamEncryptionConfigurationInput); err != nil {
invalidParams.AddNested("DeliveryStreamEncryptionConfigurationInput", err.(smithy.InvalidParamsError))
}
}
if v.S3DestinationConfiguration != nil {
if err := validateS3DestinationConfiguration(v.S3DestinationConfiguration); err != nil {
invalidParams.AddNested("S3DestinationConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.ExtendedS3DestinationConfiguration != nil {
if err := validateExtendedS3DestinationConfiguration(v.ExtendedS3DestinationConfiguration); err != nil {
invalidParams.AddNested("ExtendedS3DestinationConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.RedshiftDestinationConfiguration != nil {
if err := validateRedshiftDestinationConfiguration(v.RedshiftDestinationConfiguration); err != nil {
invalidParams.AddNested("RedshiftDestinationConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.ElasticsearchDestinationConfiguration != nil {
if err := validateElasticsearchDestinationConfiguration(v.ElasticsearchDestinationConfiguration); err != nil {
invalidParams.AddNested("ElasticsearchDestinationConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.AmazonopensearchserviceDestinationConfiguration != nil {
if err := validateAmazonopensearchserviceDestinationConfiguration(v.AmazonopensearchserviceDestinationConfiguration); err != nil {
invalidParams.AddNested("AmazonopensearchserviceDestinationConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.SplunkDestinationConfiguration != nil {
if err := validateSplunkDestinationConfiguration(v.SplunkDestinationConfiguration); err != nil {
invalidParams.AddNested("SplunkDestinationConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.HttpEndpointDestinationConfiguration != nil {
if err := validateHttpEndpointDestinationConfiguration(v.HttpEndpointDestinationConfiguration); err != nil {
invalidParams.AddNested("HttpEndpointDestinationConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.Tags != nil {
if err := validateTagDeliveryStreamInputTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if v.AmazonOpenSearchServerlessDestinationConfiguration != nil {
if err := validateAmazonOpenSearchServerlessDestinationConfiguration(v.AmazonOpenSearchServerlessDestinationConfiguration); err != nil {
invalidParams.AddNested("AmazonOpenSearchServerlessDestinationConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDeliveryStreamInput(v *DeleteDeliveryStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDeliveryStreamInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeDeliveryStreamInput(v *DescribeDeliveryStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeDeliveryStreamInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsForDeliveryStreamInput(v *ListTagsForDeliveryStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsForDeliveryStreamInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutRecordBatchInput(v *PutRecordBatchInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutRecordBatchInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if v.Records == nil {
invalidParams.Add(smithy.NewErrParamRequired("Records"))
} else if v.Records != nil {
if err := validatePutRecordBatchRequestEntryList(v.Records); err != nil {
invalidParams.AddNested("Records", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutRecordInput(v *PutRecordInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutRecordInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if v.Record == nil {
invalidParams.Add(smithy.NewErrParamRequired("Record"))
} else if v.Record != nil {
if err := validateRecord(v.Record); err != nil {
invalidParams.AddNested("Record", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartDeliveryStreamEncryptionInput(v *StartDeliveryStreamEncryptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartDeliveryStreamEncryptionInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if v.DeliveryStreamEncryptionConfigurationInput != nil {
if err := validateDeliveryStreamEncryptionConfigurationInput(v.DeliveryStreamEncryptionConfigurationInput); err != nil {
invalidParams.AddNested("DeliveryStreamEncryptionConfigurationInput", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopDeliveryStreamEncryptionInput(v *StopDeliveryStreamEncryptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopDeliveryStreamEncryptionInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagDeliveryStreamInput(v *TagDeliveryStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagDeliveryStreamInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} else if v.Tags != nil {
if err := validateTagDeliveryStreamInputTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagDeliveryStreamInput(v *UntagDeliveryStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagDeliveryStreamInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateDestinationInput(v *UpdateDestinationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateDestinationInput"}
if v.DeliveryStreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamName"))
}
if v.CurrentDeliveryStreamVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentDeliveryStreamVersionId"))
}
if v.DestinationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("DestinationId"))
}
if v.S3DestinationUpdate != nil {
if err := validateS3DestinationUpdate(v.S3DestinationUpdate); err != nil {
invalidParams.AddNested("S3DestinationUpdate", err.(smithy.InvalidParamsError))
}
}
if v.ExtendedS3DestinationUpdate != nil {
if err := validateExtendedS3DestinationUpdate(v.ExtendedS3DestinationUpdate); err != nil {
invalidParams.AddNested("ExtendedS3DestinationUpdate", err.(smithy.InvalidParamsError))
}
}
if v.RedshiftDestinationUpdate != nil {
if err := validateRedshiftDestinationUpdate(v.RedshiftDestinationUpdate); err != nil {
invalidParams.AddNested("RedshiftDestinationUpdate", err.(smithy.InvalidParamsError))
}
}
if v.ElasticsearchDestinationUpdate != nil {
if err := validateElasticsearchDestinationUpdate(v.ElasticsearchDestinationUpdate); err != nil {
invalidParams.AddNested("ElasticsearchDestinationUpdate", err.(smithy.InvalidParamsError))
}
}
if v.AmazonopensearchserviceDestinationUpdate != nil {
if err := validateAmazonopensearchserviceDestinationUpdate(v.AmazonopensearchserviceDestinationUpdate); err != nil {
invalidParams.AddNested("AmazonopensearchserviceDestinationUpdate", err.(smithy.InvalidParamsError))
}
}
if v.SplunkDestinationUpdate != nil {
if err := validateSplunkDestinationUpdate(v.SplunkDestinationUpdate); err != nil {
invalidParams.AddNested("SplunkDestinationUpdate", err.(smithy.InvalidParamsError))
}
}
if v.HttpEndpointDestinationUpdate != nil {
if err := validateHttpEndpointDestinationUpdate(v.HttpEndpointDestinationUpdate); err != nil {
invalidParams.AddNested("HttpEndpointDestinationUpdate", err.(smithy.InvalidParamsError))
}
}
if v.AmazonOpenSearchServerlessDestinationUpdate != nil {
if err := validateAmazonOpenSearchServerlessDestinationUpdate(v.AmazonOpenSearchServerlessDestinationUpdate); err != nil {
invalidParams.AddNested("AmazonOpenSearchServerlessDestinationUpdate", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 1,366 |
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 Firehose 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: "firehose.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "firehose-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "firehose.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-4",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "firehose-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: "firehose-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-1",
}: endpoints.Endpoint{
Hostname: "firehose-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "firehose-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "me-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "firehose.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "firehose-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "firehose.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-north-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "firehose.cn-north-1.api.amazonwebservices.com.cn",
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-northwest-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "firehose.cn-northwest-1.api.amazonwebservices.com.cn",
},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "firehose.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-iso-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-iso-west-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "firehose.{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: "firehose-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "firehose.{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: "firehose-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "firehose.{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: "firehose.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "firehose-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "firehose.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "firehose-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "firehose-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.us-gov-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "firehose-fips.us-gov-west-1.amazonaws.com",
},
},
},
}
| 506 |
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 AmazonOpenSearchServerlessS3BackupMode string
// Enum values for AmazonOpenSearchServerlessS3BackupMode
const (
AmazonOpenSearchServerlessS3BackupModeFailedDocumentsOnly AmazonOpenSearchServerlessS3BackupMode = "FailedDocumentsOnly"
AmazonOpenSearchServerlessS3BackupModeAllDocuments AmazonOpenSearchServerlessS3BackupMode = "AllDocuments"
)
// Values returns all known values for AmazonOpenSearchServerlessS3BackupMode.
// 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 (AmazonOpenSearchServerlessS3BackupMode) Values() []AmazonOpenSearchServerlessS3BackupMode {
return []AmazonOpenSearchServerlessS3BackupMode{
"FailedDocumentsOnly",
"AllDocuments",
}
}
type AmazonopensearchserviceIndexRotationPeriod string
// Enum values for AmazonopensearchserviceIndexRotationPeriod
const (
AmazonopensearchserviceIndexRotationPeriodNoRotation AmazonopensearchserviceIndexRotationPeriod = "NoRotation"
AmazonopensearchserviceIndexRotationPeriodOneHour AmazonopensearchserviceIndexRotationPeriod = "OneHour"
AmazonopensearchserviceIndexRotationPeriodOneDay AmazonopensearchserviceIndexRotationPeriod = "OneDay"
AmazonopensearchserviceIndexRotationPeriodOneWeek AmazonopensearchserviceIndexRotationPeriod = "OneWeek"
AmazonopensearchserviceIndexRotationPeriodOneMonth AmazonopensearchserviceIndexRotationPeriod = "OneMonth"
)
// Values returns all known values for AmazonopensearchserviceIndexRotationPeriod.
// 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 (AmazonopensearchserviceIndexRotationPeriod) Values() []AmazonopensearchserviceIndexRotationPeriod {
return []AmazonopensearchserviceIndexRotationPeriod{
"NoRotation",
"OneHour",
"OneDay",
"OneWeek",
"OneMonth",
}
}
type AmazonopensearchserviceS3BackupMode string
// Enum values for AmazonopensearchserviceS3BackupMode
const (
AmazonopensearchserviceS3BackupModeFailedDocumentsOnly AmazonopensearchserviceS3BackupMode = "FailedDocumentsOnly"
AmazonopensearchserviceS3BackupModeAllDocuments AmazonopensearchserviceS3BackupMode = "AllDocuments"
)
// Values returns all known values for AmazonopensearchserviceS3BackupMode. 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 (AmazonopensearchserviceS3BackupMode) Values() []AmazonopensearchserviceS3BackupMode {
return []AmazonopensearchserviceS3BackupMode{
"FailedDocumentsOnly",
"AllDocuments",
}
}
type CompressionFormat string
// Enum values for CompressionFormat
const (
CompressionFormatUncompressed CompressionFormat = "UNCOMPRESSED"
CompressionFormatGzip CompressionFormat = "GZIP"
CompressionFormatZip CompressionFormat = "ZIP"
CompressionFormatSnappy CompressionFormat = "Snappy"
CompressionFormatHadoopSnappy CompressionFormat = "HADOOP_SNAPPY"
)
// Values returns all known values for CompressionFormat. 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 (CompressionFormat) Values() []CompressionFormat {
return []CompressionFormat{
"UNCOMPRESSED",
"GZIP",
"ZIP",
"Snappy",
"HADOOP_SNAPPY",
}
}
type ContentEncoding string
// Enum values for ContentEncoding
const (
ContentEncodingNone ContentEncoding = "NONE"
ContentEncodingGzip ContentEncoding = "GZIP"
)
// Values returns all known values for ContentEncoding. 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 (ContentEncoding) Values() []ContentEncoding {
return []ContentEncoding{
"NONE",
"GZIP",
}
}
type DeliveryStreamEncryptionStatus string
// Enum values for DeliveryStreamEncryptionStatus
const (
DeliveryStreamEncryptionStatusEnabled DeliveryStreamEncryptionStatus = "ENABLED"
DeliveryStreamEncryptionStatusEnabling DeliveryStreamEncryptionStatus = "ENABLING"
DeliveryStreamEncryptionStatusEnablingFailed DeliveryStreamEncryptionStatus = "ENABLING_FAILED"
DeliveryStreamEncryptionStatusDisabled DeliveryStreamEncryptionStatus = "DISABLED"
DeliveryStreamEncryptionStatusDisabling DeliveryStreamEncryptionStatus = "DISABLING"
DeliveryStreamEncryptionStatusDisablingFailed DeliveryStreamEncryptionStatus = "DISABLING_FAILED"
)
// Values returns all known values for DeliveryStreamEncryptionStatus. 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 (DeliveryStreamEncryptionStatus) Values() []DeliveryStreamEncryptionStatus {
return []DeliveryStreamEncryptionStatus{
"ENABLED",
"ENABLING",
"ENABLING_FAILED",
"DISABLED",
"DISABLING",
"DISABLING_FAILED",
}
}
type DeliveryStreamFailureType string
// Enum values for DeliveryStreamFailureType
const (
DeliveryStreamFailureTypeRetireKmsGrantFailed DeliveryStreamFailureType = "RETIRE_KMS_GRANT_FAILED"
DeliveryStreamFailureTypeCreateKmsGrantFailed DeliveryStreamFailureType = "CREATE_KMS_GRANT_FAILED"
DeliveryStreamFailureTypeKmsAccessDenied DeliveryStreamFailureType = "KMS_ACCESS_DENIED"
DeliveryStreamFailureTypeDisabledKmsKey DeliveryStreamFailureType = "DISABLED_KMS_KEY"
DeliveryStreamFailureTypeInvalidKmsKey DeliveryStreamFailureType = "INVALID_KMS_KEY"
DeliveryStreamFailureTypeKmsKeyNotFound DeliveryStreamFailureType = "KMS_KEY_NOT_FOUND"
DeliveryStreamFailureTypeKmsOptInRequired DeliveryStreamFailureType = "KMS_OPT_IN_REQUIRED"
DeliveryStreamFailureTypeCreateEniFailed DeliveryStreamFailureType = "CREATE_ENI_FAILED"
DeliveryStreamFailureTypeDeleteEniFailed DeliveryStreamFailureType = "DELETE_ENI_FAILED"
DeliveryStreamFailureTypeSubnetNotFound DeliveryStreamFailureType = "SUBNET_NOT_FOUND"
DeliveryStreamFailureTypeSecurityGroupNotFound DeliveryStreamFailureType = "SECURITY_GROUP_NOT_FOUND"
DeliveryStreamFailureTypeEniAccessDenied DeliveryStreamFailureType = "ENI_ACCESS_DENIED"
DeliveryStreamFailureTypeSubnetAccessDenied DeliveryStreamFailureType = "SUBNET_ACCESS_DENIED"
DeliveryStreamFailureTypeSecurityGroupAccessDenied DeliveryStreamFailureType = "SECURITY_GROUP_ACCESS_DENIED"
DeliveryStreamFailureTypeUnknownError DeliveryStreamFailureType = "UNKNOWN_ERROR"
)
// Values returns all known values for DeliveryStreamFailureType. 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 (DeliveryStreamFailureType) Values() []DeliveryStreamFailureType {
return []DeliveryStreamFailureType{
"RETIRE_KMS_GRANT_FAILED",
"CREATE_KMS_GRANT_FAILED",
"KMS_ACCESS_DENIED",
"DISABLED_KMS_KEY",
"INVALID_KMS_KEY",
"KMS_KEY_NOT_FOUND",
"KMS_OPT_IN_REQUIRED",
"CREATE_ENI_FAILED",
"DELETE_ENI_FAILED",
"SUBNET_NOT_FOUND",
"SECURITY_GROUP_NOT_FOUND",
"ENI_ACCESS_DENIED",
"SUBNET_ACCESS_DENIED",
"SECURITY_GROUP_ACCESS_DENIED",
"UNKNOWN_ERROR",
}
}
type DeliveryStreamStatus string
// Enum values for DeliveryStreamStatus
const (
DeliveryStreamStatusCreating DeliveryStreamStatus = "CREATING"
DeliveryStreamStatusCreatingFailed DeliveryStreamStatus = "CREATING_FAILED"
DeliveryStreamStatusDeleting DeliveryStreamStatus = "DELETING"
DeliveryStreamStatusDeletingFailed DeliveryStreamStatus = "DELETING_FAILED"
DeliveryStreamStatusActive DeliveryStreamStatus = "ACTIVE"
)
// Values returns all known values for DeliveryStreamStatus. 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 (DeliveryStreamStatus) Values() []DeliveryStreamStatus {
return []DeliveryStreamStatus{
"CREATING",
"CREATING_FAILED",
"DELETING",
"DELETING_FAILED",
"ACTIVE",
}
}
type DeliveryStreamType string
// Enum values for DeliveryStreamType
const (
DeliveryStreamTypeDirectPut DeliveryStreamType = "DirectPut"
DeliveryStreamTypeKinesisStreamAsSource DeliveryStreamType = "KinesisStreamAsSource"
)
// Values returns all known values for DeliveryStreamType. 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 (DeliveryStreamType) Values() []DeliveryStreamType {
return []DeliveryStreamType{
"DirectPut",
"KinesisStreamAsSource",
}
}
type ElasticsearchIndexRotationPeriod string
// Enum values for ElasticsearchIndexRotationPeriod
const (
ElasticsearchIndexRotationPeriodNoRotation ElasticsearchIndexRotationPeriod = "NoRotation"
ElasticsearchIndexRotationPeriodOneHour ElasticsearchIndexRotationPeriod = "OneHour"
ElasticsearchIndexRotationPeriodOneDay ElasticsearchIndexRotationPeriod = "OneDay"
ElasticsearchIndexRotationPeriodOneWeek ElasticsearchIndexRotationPeriod = "OneWeek"
ElasticsearchIndexRotationPeriodOneMonth ElasticsearchIndexRotationPeriod = "OneMonth"
)
// Values returns all known values for ElasticsearchIndexRotationPeriod. 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 (ElasticsearchIndexRotationPeriod) Values() []ElasticsearchIndexRotationPeriod {
return []ElasticsearchIndexRotationPeriod{
"NoRotation",
"OneHour",
"OneDay",
"OneWeek",
"OneMonth",
}
}
type ElasticsearchS3BackupMode string
// Enum values for ElasticsearchS3BackupMode
const (
ElasticsearchS3BackupModeFailedDocumentsOnly ElasticsearchS3BackupMode = "FailedDocumentsOnly"
ElasticsearchS3BackupModeAllDocuments ElasticsearchS3BackupMode = "AllDocuments"
)
// Values returns all known values for ElasticsearchS3BackupMode. 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 (ElasticsearchS3BackupMode) Values() []ElasticsearchS3BackupMode {
return []ElasticsearchS3BackupMode{
"FailedDocumentsOnly",
"AllDocuments",
}
}
type HECEndpointType string
// Enum values for HECEndpointType
const (
HECEndpointTypeRaw HECEndpointType = "Raw"
HECEndpointTypeEvent HECEndpointType = "Event"
)
// Values returns all known values for HECEndpointType. 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 (HECEndpointType) Values() []HECEndpointType {
return []HECEndpointType{
"Raw",
"Event",
}
}
type HttpEndpointS3BackupMode string
// Enum values for HttpEndpointS3BackupMode
const (
HttpEndpointS3BackupModeFailedDataOnly HttpEndpointS3BackupMode = "FailedDataOnly"
HttpEndpointS3BackupModeAllData HttpEndpointS3BackupMode = "AllData"
)
// Values returns all known values for HttpEndpointS3BackupMode. 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 (HttpEndpointS3BackupMode) Values() []HttpEndpointS3BackupMode {
return []HttpEndpointS3BackupMode{
"FailedDataOnly",
"AllData",
}
}
type KeyType string
// Enum values for KeyType
const (
KeyTypeAwsOwnedCmk KeyType = "AWS_OWNED_CMK"
KeyTypeCustomerManagedCmk KeyType = "CUSTOMER_MANAGED_CMK"
)
// Values returns all known values for KeyType. 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 (KeyType) Values() []KeyType {
return []KeyType{
"AWS_OWNED_CMK",
"CUSTOMER_MANAGED_CMK",
}
}
type NoEncryptionConfig string
// Enum values for NoEncryptionConfig
const (
NoEncryptionConfigNoEncryption NoEncryptionConfig = "NoEncryption"
)
// Values returns all known values for NoEncryptionConfig. 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 (NoEncryptionConfig) Values() []NoEncryptionConfig {
return []NoEncryptionConfig{
"NoEncryption",
}
}
type OrcCompression string
// Enum values for OrcCompression
const (
OrcCompressionNone OrcCompression = "NONE"
OrcCompressionZlib OrcCompression = "ZLIB"
OrcCompressionSnappy OrcCompression = "SNAPPY"
)
// Values returns all known values for OrcCompression. 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 (OrcCompression) Values() []OrcCompression {
return []OrcCompression{
"NONE",
"ZLIB",
"SNAPPY",
}
}
type OrcFormatVersion string
// Enum values for OrcFormatVersion
const (
OrcFormatVersionV011 OrcFormatVersion = "V0_11"
OrcFormatVersionV012 OrcFormatVersion = "V0_12"
)
// Values returns all known values for OrcFormatVersion. 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 (OrcFormatVersion) Values() []OrcFormatVersion {
return []OrcFormatVersion{
"V0_11",
"V0_12",
}
}
type ParquetCompression string
// Enum values for ParquetCompression
const (
ParquetCompressionUncompressed ParquetCompression = "UNCOMPRESSED"
ParquetCompressionGzip ParquetCompression = "GZIP"
ParquetCompressionSnappy ParquetCompression = "SNAPPY"
)
// Values returns all known values for ParquetCompression. 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 (ParquetCompression) Values() []ParquetCompression {
return []ParquetCompression{
"UNCOMPRESSED",
"GZIP",
"SNAPPY",
}
}
type ParquetWriterVersion string
// Enum values for ParquetWriterVersion
const (
ParquetWriterVersionV1 ParquetWriterVersion = "V1"
ParquetWriterVersionV2 ParquetWriterVersion = "V2"
)
// Values returns all known values for ParquetWriterVersion. 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 (ParquetWriterVersion) Values() []ParquetWriterVersion {
return []ParquetWriterVersion{
"V1",
"V2",
}
}
type ProcessorParameterName string
// Enum values for ProcessorParameterName
const (
ProcessorParameterNameLambdaArn ProcessorParameterName = "LambdaArn"
ProcessorParameterNameLambdaNumberOfRetries ProcessorParameterName = "NumberOfRetries"
ProcessorParameterNameMetadataExtractionQuery ProcessorParameterName = "MetadataExtractionQuery"
ProcessorParameterNameJsonParsingEngine ProcessorParameterName = "JsonParsingEngine"
ProcessorParameterNameRoleArn ProcessorParameterName = "RoleArn"
ProcessorParameterNameBufferSizeInMb ProcessorParameterName = "BufferSizeInMBs"
ProcessorParameterNameBufferIntervalInSeconds ProcessorParameterName = "BufferIntervalInSeconds"
ProcessorParameterNameSubRecordType ProcessorParameterName = "SubRecordType"
ProcessorParameterNameDelimiter ProcessorParameterName = "Delimiter"
)
// Values returns all known values for ProcessorParameterName. 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 (ProcessorParameterName) Values() []ProcessorParameterName {
return []ProcessorParameterName{
"LambdaArn",
"NumberOfRetries",
"MetadataExtractionQuery",
"JsonParsingEngine",
"RoleArn",
"BufferSizeInMBs",
"BufferIntervalInSeconds",
"SubRecordType",
"Delimiter",
}
}
type ProcessorType string
// Enum values for ProcessorType
const (
ProcessorTypeRecordDeAggregation ProcessorType = "RecordDeAggregation"
ProcessorTypeLambda ProcessorType = "Lambda"
ProcessorTypeMetadataExtraction ProcessorType = "MetadataExtraction"
ProcessorTypeAppendDelimiterToRecord ProcessorType = "AppendDelimiterToRecord"
)
// Values returns all known values for ProcessorType. 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 (ProcessorType) Values() []ProcessorType {
return []ProcessorType{
"RecordDeAggregation",
"Lambda",
"MetadataExtraction",
"AppendDelimiterToRecord",
}
}
type RedshiftS3BackupMode string
// Enum values for RedshiftS3BackupMode
const (
RedshiftS3BackupModeDisabled RedshiftS3BackupMode = "Disabled"
RedshiftS3BackupModeEnabled RedshiftS3BackupMode = "Enabled"
)
// Values returns all known values for RedshiftS3BackupMode. 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 (RedshiftS3BackupMode) Values() []RedshiftS3BackupMode {
return []RedshiftS3BackupMode{
"Disabled",
"Enabled",
}
}
type S3BackupMode string
// Enum values for S3BackupMode
const (
S3BackupModeDisabled S3BackupMode = "Disabled"
S3BackupModeEnabled S3BackupMode = "Enabled"
)
// Values returns all known values for S3BackupMode. 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 (S3BackupMode) Values() []S3BackupMode {
return []S3BackupMode{
"Disabled",
"Enabled",
}
}
type SplunkS3BackupMode string
// Enum values for SplunkS3BackupMode
const (
SplunkS3BackupModeFailedEventsOnly SplunkS3BackupMode = "FailedEventsOnly"
SplunkS3BackupModeAllEvents SplunkS3BackupMode = "AllEvents"
)
// Values returns all known values for SplunkS3BackupMode. 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 (SplunkS3BackupMode) Values() []SplunkS3BackupMode {
return []SplunkS3BackupMode{
"FailedEventsOnly",
"AllEvents",
}
}
| 519 |
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"
)
// Another modification has already happened. Fetch VersionId again and use it to
// update the destination.
type ConcurrentModificationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConcurrentModificationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConcurrentModificationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConcurrentModificationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConcurrentModificationException"
}
return *e.ErrorCodeOverride
}
func (e *ConcurrentModificationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified input parameter has a value that is not valid.
type InvalidArgumentException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidArgumentException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidArgumentException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidArgumentException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidArgumentException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidArgumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Kinesis Data Firehose throws this exception when an attempt to put records or
// to start or stop delivery stream encryption fails. This happens when the KMS
// service throws one of the following exception types: AccessDeniedException ,
// InvalidStateException , DisabledException , or NotFoundException .
type InvalidKMSResourceException struct {
Message *string
ErrorCodeOverride *string
Code *string
noSmithyDocumentSerde
}
func (e *InvalidKMSResourceException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidKMSResourceException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidKMSResourceException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidKMSResourceException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidKMSResourceException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// You have already reached the limit for a requested resource.
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 is already in use and not available for this operation.
type ResourceInUseException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceInUseException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceInUseException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceInUseException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceInUseException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified resource could not 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 service is unavailable. Back off and retry the operation. If you continue
// to see the exception, throughput limits for the delivery stream may have been
// exceeded. For more information about limits and how to request an increase, see
// Amazon Kinesis Data Firehose Limits (https://docs.aws.amazon.com/firehose/latest/dev/limits.html)
// .
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 }
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// Describes the buffering to perform before delivering data to the Serverless
// offering for Amazon OpenSearch Service destination.
type AmazonOpenSearchServerlessBufferingHints struct {
// Buffer incoming data for the specified period of time, in seconds, before
// delivering it to the destination. The default value is 300 (5 minutes).
IntervalInSeconds *int32
// Buffer incoming data to the specified size, in MBs, before delivering it to the
// destination. The default value is 5. We recommend setting this parameter to a
// value greater than the amount of data you typically ingest into the delivery
// stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec, the
// value should be 10 MB or higher.
SizeInMBs *int32
noSmithyDocumentSerde
}
// Describes the configuration of a destination in the Serverless offering for
// Amazon OpenSearch Service.
type AmazonOpenSearchServerlessDestinationConfiguration struct {
// The Serverless offering for Amazon OpenSearch Service index name.
//
// This member is required.
IndexName *string
// The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data
// Firehose for calling the Serverless offering for Amazon OpenSearch Service
// Configuration API and for indexing documents.
//
// This member is required.
RoleARN *string
// Describes the configuration of a destination in Amazon S3.
//
// This member is required.
S3Configuration *S3DestinationConfiguration
// The buffering options. If no value is specified, the default values for
// AmazonopensearchserviceBufferingHints are used.
BufferingHints *AmazonOpenSearchServerlessBufferingHints
// Describes the Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The endpoint to use when communicating with the collection in the Serverless
// offering for Amazon OpenSearch Service.
CollectionEndpoint *string
// Describes a data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver documents
// to the Serverless offering for Amazon OpenSearch Service. The default value is
// 300 (5 minutes).
RetryOptions *AmazonOpenSearchServerlessRetryOptions
// Defines how documents should be delivered to Amazon S3. When it is set to
// FailedDocumentsOnly, Kinesis Data Firehose writes any documents that could not
// be indexed to the configured Amazon S3 destination, with
// AmazonOpenSearchService-failed/ appended to the key prefix. When set to
// AllDocuments, Kinesis Data Firehose delivers all incoming records to Amazon S3,
// and also writes failed documents with AmazonOpenSearchService-failed/ appended
// to the prefix.
S3BackupMode AmazonOpenSearchServerlessS3BackupMode
// The details of the VPC of the Amazon ES destination.
VpcConfiguration *VpcConfiguration
noSmithyDocumentSerde
}
// The destination description in the Serverless offering for Amazon OpenSearch
// Service.
type AmazonOpenSearchServerlessDestinationDescription struct {
// The buffering options.
BufferingHints *AmazonOpenSearchServerlessBufferingHints
// Describes the Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The endpoint to use when communicating with the collection in the Serverless
// offering for Amazon OpenSearch Service.
CollectionEndpoint *string
// The Serverless offering for Amazon OpenSearch Service index name.
IndexName *string
// Describes a data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The Serverless offering for Amazon OpenSearch Service retry options.
RetryOptions *AmazonOpenSearchServerlessRetryOptions
// The Amazon Resource Name (ARN) of the AWS credentials.
RoleARN *string
// The Amazon S3 backup mode.
S3BackupMode AmazonOpenSearchServerlessS3BackupMode
// Describes a destination in Amazon S3.
S3DestinationDescription *S3DestinationDescription
// The details of the VPC of the Amazon ES destination.
VpcConfigurationDescription *VpcConfigurationDescription
noSmithyDocumentSerde
}
// Describes an update for a destination in the Serverless offering for Amazon
// OpenSearch Service.
type AmazonOpenSearchServerlessDestinationUpdate struct {
// The buffering options. If no value is specified, AmazonopensearchBufferingHints
// object default values are used.
BufferingHints *AmazonOpenSearchServerlessBufferingHints
// Describes the Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The endpoint to use when communicating with the collection in the Serverless
// offering for Amazon OpenSearch Service.
CollectionEndpoint *string
// The Serverless offering for Amazon OpenSearch Service index name.
IndexName *string
// Describes a data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver documents
// to the Serverless offering for Amazon OpenSearch Service. The default value is
// 300 (5 minutes).
RetryOptions *AmazonOpenSearchServerlessRetryOptions
// The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data
// Firehose for calling the Serverless offering for Amazon OpenSearch Service
// Configuration API and for indexing documents.
RoleARN *string
// Describes an update for a destination in Amazon S3.
S3Update *S3DestinationUpdate
noSmithyDocumentSerde
}
// Configures retry behavior in case Kinesis Data Firehose is unable to deliver
// documents to the Serverless offering for Amazon OpenSearch Service.
type AmazonOpenSearchServerlessRetryOptions struct {
// After an initial failure to deliver to the Serverless offering for Amazon
// OpenSearch Service, the total amount of time during which Kinesis Data Firehose
// retries delivery (including the first attempt). After this time has elapsed, the
// failed documents are written to Amazon S3. Default value is 300 seconds (5
// minutes). A value of 0 (zero) results in no retries.
DurationInSeconds *int32
noSmithyDocumentSerde
}
// Describes the buffering to perform before delivering data to the Amazon
// OpenSearch Service destination.
type AmazonopensearchserviceBufferingHints struct {
// Buffer incoming data for the specified period of time, in seconds, before
// delivering it to the destination. The default value is 300 (5 minutes).
IntervalInSeconds *int32
// Buffer incoming data to the specified size, in MBs, before delivering it to the
// destination. The default value is 5. We recommend setting this parameter to a
// value greater than the amount of data you typically ingest into the delivery
// stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec, the
// value should be 10 MB or higher.
SizeInMBs *int32
noSmithyDocumentSerde
}
// Describes the configuration of a destination in Amazon OpenSearch Service
type AmazonopensearchserviceDestinationConfiguration struct {
// The ElasticsearAmazon OpenSearch Service index name.
//
// This member is required.
IndexName *string
// The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data
// Firehose for calling the Amazon OpenSearch Service Configuration API and for
// indexing documents.
//
// This member is required.
RoleARN *string
// Describes the configuration of a destination in Amazon S3.
//
// This member is required.
S3Configuration *S3DestinationConfiguration
// The buffering options. If no value is specified, the default values for
// AmazonopensearchserviceBufferingHints are used.
BufferingHints *AmazonopensearchserviceBufferingHints
// Describes the Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The endpoint to use when communicating with the cluster. Specify either this
// ClusterEndpoint or the DomainARN field.
ClusterEndpoint *string
// The ARN of the Amazon OpenSearch Service domain. The IAM role must have
// permissions for DescribeElasticsearchDomain, DescribeElasticsearchDomains, and
// DescribeElasticsearchDomainConfig after assuming the role specified in RoleARN.
DomainARN *string
// The Amazon OpenSearch Service index rotation period. Index rotation appends a
// timestamp to the IndexName to facilitate the expiration of old data.
IndexRotationPeriod AmazonopensearchserviceIndexRotationPeriod
// Describes a data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver documents
// to Amazon OpenSearch Service. The default value is 300 (5 minutes).
RetryOptions *AmazonopensearchserviceRetryOptions
// Defines how documents should be delivered to Amazon S3. When it is set to
// FailedDocumentsOnly, Kinesis Data Firehose writes any documents that could not
// be indexed to the configured Amazon S3 destination, with
// AmazonOpenSearchService-failed/ appended to the key prefix. When set to
// AllDocuments, Kinesis Data Firehose delivers all incoming records to Amazon S3,
// and also writes failed documents with AmazonOpenSearchService-failed/ appended
// to the prefix.
S3BackupMode AmazonopensearchserviceS3BackupMode
// The Amazon OpenSearch Service type name. For Elasticsearch 6.x, there can be
// only one type per index. If you try to specify a new type for an existing index
// that already has another type, Kinesis Data Firehose returns an error during run
// time.
TypeName *string
// The details of the VPC of the Amazon ES destination.
VpcConfiguration *VpcConfiguration
noSmithyDocumentSerde
}
// The destination description in Amazon OpenSearch Service.
type AmazonopensearchserviceDestinationDescription struct {
// The buffering options.
BufferingHints *AmazonopensearchserviceBufferingHints
// Describes the Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The endpoint to use when communicating with the cluster. Kinesis Data Firehose
// uses either this ClusterEndpoint or the DomainARN field to send data to Amazon
// OpenSearch Service.
ClusterEndpoint *string
// The ARN of the Amazon OpenSearch Service domain.
DomainARN *string
// The Amazon OpenSearch Service index name.
IndexName *string
// The Amazon OpenSearch Service index rotation period
IndexRotationPeriod AmazonopensearchserviceIndexRotationPeriod
// Describes a data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The Amazon OpenSearch Service retry options.
RetryOptions *AmazonopensearchserviceRetryOptions
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials.
RoleARN *string
// The Amazon S3 backup mode.
S3BackupMode AmazonopensearchserviceS3BackupMode
// Describes a destination in Amazon S3.
S3DestinationDescription *S3DestinationDescription
// The Amazon OpenSearch Service type name. This applies to Elasticsearch 6.x and
// lower versions. For Elasticsearch 7.x and OpenSearch Service 1.x, there's no
// value for TypeName.
TypeName *string
// The details of the VPC of the Amazon ES destination.
VpcConfigurationDescription *VpcConfigurationDescription
noSmithyDocumentSerde
}
// Describes an update for a destination in Amazon OpenSearch Service.
type AmazonopensearchserviceDestinationUpdate struct {
// The buffering options. If no value is specified, AmazonopensearchBufferingHints
// object default values are used.
BufferingHints *AmazonopensearchserviceBufferingHints
// Describes the Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The endpoint to use when communicating with the cluster. Specify either this
// ClusterEndpoint or the DomainARN field.
ClusterEndpoint *string
// The ARN of the Amazon OpenSearch Service domain. The IAM role must have
// permissions for DescribeDomain, DescribeDomains, and DescribeDomainConfig after
// assuming the IAM role specified in RoleARN.
DomainARN *string
// The Amazon OpenSearch Service index name.
IndexName *string
// The Amazon OpenSearch Service index rotation period. Index rotation appends a
// timestamp to IndexName to facilitate the expiration of old data.
IndexRotationPeriod AmazonopensearchserviceIndexRotationPeriod
// Describes a data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver documents
// to Amazon OpenSearch Service. The default value is 300 (5 minutes).
RetryOptions *AmazonopensearchserviceRetryOptions
// The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data
// Firehose for calling the Amazon OpenSearch Service Configuration API and for
// indexing documents.
RoleARN *string
// Describes an update for a destination in Amazon S3.
S3Update *S3DestinationUpdate
// The Amazon OpenSearch Service type name. For Elasticsearch 6.x, there can be
// only one type per index. If you try to specify a new type for an existing index
// that already has another type, Kinesis Data Firehose returns an error during
// runtime. If you upgrade Elasticsearch from 6.x to 7.x and don’t update your
// delivery stream, Kinesis Data Firehose still delivers data to Elasticsearch with
// the old index name and type name. If you want to update your delivery stream
// with a new index name, provide an empty string for TypeName.
TypeName *string
noSmithyDocumentSerde
}
// Configures retry behavior in case Kinesis Data Firehose is unable to deliver
// documents to Amazon OpenSearch Service.
type AmazonopensearchserviceRetryOptions struct {
// After an initial failure to deliver to Amazon OpenSearch Service, the total
// amount of time during which Kinesis Data Firehose retries delivery (including
// the first attempt). After this time has elapsed, the failed documents are
// written to Amazon S3. Default value is 300 seconds (5 minutes). A value of 0
// (zero) results in no retries.
DurationInSeconds *int32
noSmithyDocumentSerde
}
// Describes hints for the buffering to perform before delivering data to the
// destination. These options are treated as hints, and therefore Kinesis Data
// Firehose might choose to use different values when it is optimal. The SizeInMBs
// and IntervalInSeconds parameters are optional. However, if specify a value for
// one of them, you must also provide a value for the other.
type BufferingHints struct {
// Buffer incoming data for the specified period of time, in seconds, before
// delivering it to the destination. The default value is 300. This parameter is
// optional but if you specify a value for it, you must also specify a value for
// SizeInMBs , and vice versa.
IntervalInSeconds *int32
// Buffer incoming data to the specified size, in MiBs, before delivering it to
// the destination. The default value is 5. This parameter is optional but if you
// specify a value for it, you must also specify a value for IntervalInSeconds ,
// and vice versa. We recommend setting this parameter to a value greater than the
// amount of data you typically ingest into the delivery stream in 10 seconds. For
// example, if you typically ingest data at 1 MiB/sec, the value should be 10 MiB
// or higher.
SizeInMBs *int32
noSmithyDocumentSerde
}
// Describes the Amazon CloudWatch logging options for your delivery stream.
type CloudWatchLoggingOptions struct {
// Enables or disables CloudWatch logging.
Enabled *bool
// The CloudWatch group name for logging. This value is required if CloudWatch
// logging is enabled.
LogGroupName *string
// The CloudWatch log stream name for logging. This value is required if
// CloudWatch logging is enabled.
LogStreamName *string
noSmithyDocumentSerde
}
// Describes a COPY command for Amazon Redshift.
type CopyCommand struct {
// The name of the target table. The table must already exist in the database.
//
// This member is required.
DataTableName *string
// Optional parameters to use with the Amazon Redshift COPY command. For more
// information, see the "Optional Parameters" section of Amazon Redshift COPY
// command (https://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html) . Some
// possible examples that would apply to Kinesis Data Firehose are as follows:
// delimiter '\t' lzop; - fields are delimited with "\t" (TAB character) and
// compressed using lzop. delimiter '|' - fields are delimited with "|" (this is
// the default delimiter). delimiter '|' escape - the delimiter should be escaped.
// fixedwidth 'venueid:3,venuename:25,venuecity:12,venuestate:2,venueseats:6' -
// fields are fixed width in the source, with each width specified after every
// column in the table. JSON 's3://mybucket/jsonpaths.txt' - data is in JSON
// format, and the path specified is the format of the data. For more examples, see
// Amazon Redshift COPY command examples (https://docs.aws.amazon.com/redshift/latest/dg/r_COPY_command_examples.html)
// .
CopyOptions *string
// A comma-separated list of column names.
DataTableColumns *string
noSmithyDocumentSerde
}
// Specifies that you want Kinesis Data Firehose to convert data from the JSON
// format to the Parquet or ORC format before writing it to Amazon S3. Kinesis Data
// Firehose uses the serializer and deserializer that you specify, in addition to
// the column information from the Amazon Web Services Glue table, to deserialize
// your input data from JSON and then serialize it to the Parquet or ORC format.
// For more information, see Kinesis Data Firehose Record Format Conversion (https://docs.aws.amazon.com/firehose/latest/dev/record-format-conversion.html)
// .
type DataFormatConversionConfiguration struct {
// Defaults to true . Set it to false if you want to disable format conversion
// while preserving the configuration details.
Enabled *bool
// Specifies the deserializer that you want Kinesis Data Firehose to use to
// convert the format of your data from JSON. This parameter is required if Enabled
// is set to true.
InputFormatConfiguration *InputFormatConfiguration
// Specifies the serializer that you want Kinesis Data Firehose to use to convert
// the format of your data to the Parquet or ORC format. This parameter is required
// if Enabled is set to true.
OutputFormatConfiguration *OutputFormatConfiguration
// Specifies the Amazon Web Services Glue Data Catalog table that contains the
// column information. This parameter is required if Enabled is set to true.
SchemaConfiguration *SchemaConfiguration
noSmithyDocumentSerde
}
// Contains information about a delivery stream.
type DeliveryStreamDescription struct {
// The Amazon Resource Name (ARN) of the delivery stream. For more information,
// see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
DeliveryStreamARN *string
// The name of the delivery stream.
//
// This member is required.
DeliveryStreamName *string
// The status of the delivery stream. If the status of a delivery stream is
// CREATING_FAILED , this status doesn't change, and you can't invoke
// CreateDeliveryStream again on it. However, you can invoke the
// DeleteDeliveryStream operation to delete it.
//
// This member is required.
DeliveryStreamStatus DeliveryStreamStatus
// The delivery stream type. This can be one of the following values:
// - DirectPut : Provider applications access the delivery stream directly.
// - KinesisStreamAsSource : The delivery stream uses a Kinesis data stream as a
// source.
//
// This member is required.
DeliveryStreamType DeliveryStreamType
// The destinations.
//
// This member is required.
Destinations []DestinationDescription
// Indicates whether there are more destinations available to list.
//
// This member is required.
HasMoreDestinations *bool
// Each time the destination is updated for a delivery stream, the version ID is
// changed, and the current version ID is required when updating the destination.
// This is so that the service knows it is applying the changes to the correct
// version of the delivery stream.
//
// This member is required.
VersionId *string
// The date and time that the delivery stream was created.
CreateTimestamp *time.Time
// Indicates the server-side encryption (SSE) status for the delivery stream.
DeliveryStreamEncryptionConfiguration *DeliveryStreamEncryptionConfiguration
// Provides details in case one of the following operations fails due to an error
// related to KMS: CreateDeliveryStream , DeleteDeliveryStream ,
// StartDeliveryStreamEncryption , StopDeliveryStreamEncryption .
FailureDescription *FailureDescription
// The date and time that the delivery stream was last updated.
LastUpdateTimestamp *time.Time
// If the DeliveryStreamType parameter is KinesisStreamAsSource , a
// SourceDescription object describing the source Kinesis data stream.
Source *SourceDescription
noSmithyDocumentSerde
}
// Contains information about the server-side encryption (SSE) status for the
// delivery stream, the type customer master key (CMK) in use, if any, and the ARN
// of the CMK. You can get DeliveryStreamEncryptionConfiguration by invoking the
// DescribeDeliveryStream operation.
type DeliveryStreamEncryptionConfiguration struct {
// Provides details in case one of the following operations fails due to an error
// related to KMS: CreateDeliveryStream , DeleteDeliveryStream ,
// StartDeliveryStreamEncryption , StopDeliveryStreamEncryption .
FailureDescription *FailureDescription
// If KeyType is CUSTOMER_MANAGED_CMK , this field contains the ARN of the customer
// managed CMK. If KeyType is Amazon Web Services_OWNED_CMK ,
// DeliveryStreamEncryptionConfiguration doesn't contain a value for KeyARN .
KeyARN *string
// Indicates the type of customer master key (CMK) that is used for encryption.
// The default setting is Amazon Web Services_OWNED_CMK . For more information
// about CMKs, see Customer Master Keys (CMKs) (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys)
// .
KeyType KeyType
// This is the server-side encryption (SSE) status for the delivery stream. For a
// full description of the different values of this status, see
// StartDeliveryStreamEncryption and StopDeliveryStreamEncryption . If this status
// is ENABLING_FAILED or DISABLING_FAILED , it is the status of the most recent
// attempt to enable or disable SSE, respectively.
Status DeliveryStreamEncryptionStatus
noSmithyDocumentSerde
}
// Specifies the type and Amazon Resource Name (ARN) of the CMK to use for
// Server-Side Encryption (SSE).
type DeliveryStreamEncryptionConfigurationInput struct {
// Indicates the type of customer master key (CMK) to use for encryption. The
// default setting is Amazon Web Services_OWNED_CMK . For more information about
// CMKs, see Customer Master Keys (CMKs) (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys)
// . When you invoke CreateDeliveryStream or StartDeliveryStreamEncryption with
// KeyType set to CUSTOMER_MANAGED_CMK, Kinesis Data Firehose invokes the Amazon
// KMS operation CreateGrant (https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateGrant.html)
// to create a grant that allows the Kinesis Data Firehose service to use the
// customer managed CMK to perform encryption and decryption. Kinesis Data Firehose
// manages that grant. When you invoke StartDeliveryStreamEncryption to change the
// CMK for a delivery stream that is encrypted with a customer managed CMK, Kinesis
// Data Firehose schedules the grant it had on the old CMK for retirement. You can
// use a CMK of type CUSTOMER_MANAGED_CMK to encrypt up to 500 delivery streams. If
// a CreateDeliveryStream or StartDeliveryStreamEncryption operation exceeds this
// limit, Kinesis Data Firehose throws a LimitExceededException . To encrypt your
// delivery stream, use symmetric CMKs. Kinesis Data Firehose doesn't support
// asymmetric CMKs. For information about symmetric and asymmetric CMKs, see About
// Symmetric and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html)
// in the Amazon Web Services Key Management Service developer guide.
//
// This member is required.
KeyType KeyType
// If you set KeyType to CUSTOMER_MANAGED_CMK , you must specify the Amazon
// Resource Name (ARN) of the CMK. If you set KeyType to Amazon Web
// Services_OWNED_CMK , Kinesis Data Firehose uses a service-account CMK.
KeyARN *string
noSmithyDocumentSerde
}
// The deserializer you want Kinesis Data Firehose to use for converting the input
// data from JSON. Kinesis Data Firehose then serializes the data to its final
// format using the Serializer . Kinesis Data Firehose supports two types of
// deserializers: the Apache Hive JSON SerDe (https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-JSON)
// and the OpenX JSON SerDe (https://github.com/rcongiu/Hive-JSON-Serde) .
type Deserializer struct {
// The native Hive / HCatalog JsonSerDe. Used by Kinesis Data Firehose for
// deserializing data, which means converting it from the JSON format in
// preparation for serializing it to the Parquet or ORC format. This is one of two
// deserializers you can choose, depending on which one offers the functionality
// you need. The other option is the OpenX SerDe.
HiveJsonSerDe *HiveJsonSerDe
// The OpenX SerDe. Used by Kinesis Data Firehose for deserializing data, which
// means converting it from the JSON format in preparation for serializing it to
// the Parquet or ORC format. This is one of two deserializers you can choose,
// depending on which one offers the functionality you need. The other option is
// the native Hive / HCatalog JsonSerDe.
OpenXJsonSerDe *OpenXJsonSerDe
noSmithyDocumentSerde
}
// Describes the destination for a delivery stream.
type DestinationDescription struct {
// The ID of the destination.
//
// This member is required.
DestinationId *string
// The destination in the Serverless offering for Amazon OpenSearch Service.
AmazonOpenSearchServerlessDestinationDescription *AmazonOpenSearchServerlessDestinationDescription
// The destination in Amazon OpenSearch Service.
AmazonopensearchserviceDestinationDescription *AmazonopensearchserviceDestinationDescription
// The destination in Amazon ES.
ElasticsearchDestinationDescription *ElasticsearchDestinationDescription
// The destination in Amazon S3.
ExtendedS3DestinationDescription *ExtendedS3DestinationDescription
// Describes the specified HTTP endpoint destination.
HttpEndpointDestinationDescription *HttpEndpointDestinationDescription
// The destination in Amazon Redshift.
RedshiftDestinationDescription *RedshiftDestinationDescription
// [Deprecated] The destination in Amazon S3.
S3DestinationDescription *S3DestinationDescription
// The destination in Splunk.
SplunkDestinationDescription *SplunkDestinationDescription
noSmithyDocumentSerde
}
// The configuration of the dynamic partitioning mechanism that creates smaller
// data sets from the streaming data by partitioning it based on partition keys.
// Currently, dynamic partitioning is only supported for Amazon S3 destinations.
type DynamicPartitioningConfiguration struct {
// Specifies that the dynamic partitioning is enabled for this Kinesis Data
// Firehose delivery stream.
Enabled *bool
// The retry behavior in case Kinesis Data Firehose is unable to deliver data to
// an Amazon S3 prefix.
RetryOptions *RetryOptions
noSmithyDocumentSerde
}
// Describes the buffering to perform before delivering data to the Amazon ES
// destination.
type ElasticsearchBufferingHints struct {
// Buffer incoming data for the specified period of time, in seconds, before
// delivering it to the destination. The default value is 300 (5 minutes).
IntervalInSeconds *int32
// Buffer incoming data to the specified size, in MBs, before delivering it to the
// destination. The default value is 5. We recommend setting this parameter to a
// value greater than the amount of data you typically ingest into the delivery
// stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec, the
// value should be 10 MB or higher.
SizeInMBs *int32
noSmithyDocumentSerde
}
// Describes the configuration of a destination in Amazon ES.
type ElasticsearchDestinationConfiguration struct {
// The Elasticsearch index name.
//
// This member is required.
IndexName *string
// The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data
// Firehose for calling the Amazon ES Configuration API and for indexing documents.
// For more information, see Grant Kinesis Data Firehose Access to an Amazon S3
// Destination (https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3)
// and Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
RoleARN *string
// The configuration for the backup Amazon S3 location.
//
// This member is required.
S3Configuration *S3DestinationConfiguration
// The buffering options. If no value is specified, the default values for
// ElasticsearchBufferingHints are used.
BufferingHints *ElasticsearchBufferingHints
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The endpoint to use when communicating with the cluster. Specify either this
// ClusterEndpoint or the DomainARN field.
ClusterEndpoint *string
// The ARN of the Amazon ES domain. The IAM role must have permissions for
// DescribeDomain , DescribeDomains , and DescribeDomainConfig after assuming the
// role specified in RoleARN. For more information, see Amazon Resource Names
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// . Specify either ClusterEndpoint or DomainARN .
DomainARN *string
// The Elasticsearch index rotation period. Index rotation appends a timestamp to
// the IndexName to facilitate the expiration of old data. For more information,
// see Index Rotation for the Amazon ES Destination (https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation)
// . The default value is OneDay .
IndexRotationPeriod ElasticsearchIndexRotationPeriod
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver documents
// to Amazon ES. The default value is 300 (5 minutes).
RetryOptions *ElasticsearchRetryOptions
// Defines how documents should be delivered to Amazon S3. When it is set to
// FailedDocumentsOnly , Kinesis Data Firehose writes any documents that could not
// be indexed to the configured Amazon S3 destination, with
// AmazonOpenSearchService-failed/ appended to the key prefix. When set to
// AllDocuments , Kinesis Data Firehose delivers all incoming records to Amazon S3,
// and also writes failed documents with AmazonOpenSearchService-failed/ appended
// to the prefix. For more information, see Amazon S3 Backup for the Amazon ES
// Destination (https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-s3-backup)
// . Default value is FailedDocumentsOnly . You can't change this backup mode after
// you create the delivery stream.
S3BackupMode ElasticsearchS3BackupMode
// The Elasticsearch type name. For Elasticsearch 6.x, there can be only one type
// per index. If you try to specify a new type for an existing index that already
// has another type, Kinesis Data Firehose returns an error during run time. For
// Elasticsearch 7.x, don't specify a TypeName .
TypeName *string
// The details of the VPC of the Amazon ES destination.
VpcConfiguration *VpcConfiguration
noSmithyDocumentSerde
}
// The destination description in Amazon ES.
type ElasticsearchDestinationDescription struct {
// The buffering options.
BufferingHints *ElasticsearchBufferingHints
// The Amazon CloudWatch logging options.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The endpoint to use when communicating with the cluster. Kinesis Data Firehose
// uses either this ClusterEndpoint or the DomainARN field to send data to Amazon
// ES.
ClusterEndpoint *string
// The ARN of the Amazon ES domain. For more information, see Amazon Resource
// Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// . Kinesis Data Firehose uses either ClusterEndpoint or DomainARN to send data
// to Amazon ES.
DomainARN *string
// The Elasticsearch index name.
IndexName *string
// The Elasticsearch index rotation period
IndexRotationPeriod ElasticsearchIndexRotationPeriod
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The Amazon ES retry options.
RetryOptions *ElasticsearchRetryOptions
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
RoleARN *string
// The Amazon S3 backup mode.
S3BackupMode ElasticsearchS3BackupMode
// The Amazon S3 destination.
S3DestinationDescription *S3DestinationDescription
// The Elasticsearch type name. This applies to Elasticsearch 6.x and lower
// versions. For Elasticsearch 7.x and OpenSearch Service 1.x, there's no value for
// TypeName .
TypeName *string
// The details of the VPC of the Amazon ES destination.
VpcConfigurationDescription *VpcConfigurationDescription
noSmithyDocumentSerde
}
// Describes an update for a destination in Amazon ES.
type ElasticsearchDestinationUpdate struct {
// The buffering options. If no value is specified, ElasticsearchBufferingHints
// object default values are used.
BufferingHints *ElasticsearchBufferingHints
// The CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The endpoint to use when communicating with the cluster. Specify either this
// ClusterEndpoint or the DomainARN field.
ClusterEndpoint *string
// The ARN of the Amazon ES domain. The IAM role must have permissions for
// DescribeDomain , DescribeDomains , and DescribeDomainConfig after assuming the
// IAM role specified in RoleARN . For more information, see Amazon Resource Names
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// . Specify either ClusterEndpoint or DomainARN .
DomainARN *string
// The Elasticsearch index name.
IndexName *string
// The Elasticsearch index rotation period. Index rotation appends a timestamp to
// IndexName to facilitate the expiration of old data. For more information, see
// Index Rotation for the Amazon ES Destination (https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation)
// . Default value is OneDay .
IndexRotationPeriod ElasticsearchIndexRotationPeriod
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver documents
// to Amazon ES. The default value is 300 (5 minutes).
RetryOptions *ElasticsearchRetryOptions
// The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data
// Firehose for calling the Amazon ES Configuration API and for indexing documents.
// For more information, see Grant Kinesis Data Firehose Access to an Amazon S3
// Destination (https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3)
// and Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
RoleARN *string
// The Amazon S3 destination.
S3Update *S3DestinationUpdate
// The Elasticsearch type name. For Elasticsearch 6.x, there can be only one type
// per index. If you try to specify a new type for an existing index that already
// has another type, Kinesis Data Firehose returns an error during runtime. If you
// upgrade Elasticsearch from 6.x to 7.x and don’t update your delivery stream,
// Kinesis Data Firehose still delivers data to Elasticsearch with the old index
// name and type name. If you want to update your delivery stream with a new index
// name, provide an empty string for TypeName .
TypeName *string
noSmithyDocumentSerde
}
// Configures retry behavior in case Kinesis Data Firehose is unable to deliver
// documents to Amazon ES.
type ElasticsearchRetryOptions struct {
// After an initial failure to deliver to Amazon ES, the total amount of time
// during which Kinesis Data Firehose retries delivery (including the first
// attempt). After this time has elapsed, the failed documents are written to
// Amazon S3. Default value is 300 seconds (5 minutes). A value of 0 (zero) results
// in no retries.
DurationInSeconds *int32
noSmithyDocumentSerde
}
// Describes the encryption for a destination in Amazon S3.
type EncryptionConfiguration struct {
// The encryption key.
KMSEncryptionConfig *KMSEncryptionConfig
// Specifically override existing encryption information to ensure that no
// encryption is used.
NoEncryptionConfig NoEncryptionConfig
noSmithyDocumentSerde
}
// Describes the configuration of a destination in Amazon S3.
type ExtendedS3DestinationConfiguration struct {
// The ARN of the S3 bucket. For more information, see Amazon Resource Names
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
BucketARN *string
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
RoleARN *string
// The buffering option.
BufferingHints *BufferingHints
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The compression format. If no value is specified, the default is UNCOMPRESSED.
CompressionFormat CompressionFormat
// The serializer, deserializer, and schema for converting data from the JSON
// format to the Parquet or ORC format before writing it to Amazon S3.
DataFormatConversionConfiguration *DataFormatConversionConfiguration
// The configuration of the dynamic partitioning mechanism that creates smaller
// data sets from the streaming data by partitioning it based on partition keys.
// Currently, dynamic partitioning is only supported for Amazon S3 destinations.
DynamicPartitioningConfiguration *DynamicPartitioningConfiguration
// The encryption configuration. If no value is specified, the default is no
// encryption.
EncryptionConfiguration *EncryptionConfiguration
// A prefix that Kinesis Data Firehose evaluates and adds to failed records before
// writing them to S3. This prefix appears immediately following the bucket name.
// For information about how to specify this prefix, see Custom Prefixes for
// Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
ErrorOutputPrefix *string
// The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered
// Amazon S3 files. You can also specify a custom prefix, as described in Custom
// Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
Prefix *string
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The configuration for backup in Amazon S3.
S3BackupConfiguration *S3DestinationConfiguration
// The Amazon S3 backup mode. After you create a delivery stream, you can update
// it to enable Amazon S3 backup if it is disabled. If backup is enabled, you can't
// update the delivery stream to disable it.
S3BackupMode S3BackupMode
noSmithyDocumentSerde
}
// Describes a destination in Amazon S3.
type ExtendedS3DestinationDescription struct {
// The ARN of the S3 bucket. For more information, see Amazon Resource Names
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
BucketARN *string
// The buffering option.
//
// This member is required.
BufferingHints *BufferingHints
// The compression format. If no value is specified, the default is UNCOMPRESSED .
//
// This member is required.
CompressionFormat CompressionFormat
// The encryption configuration. If no value is specified, the default is no
// encryption.
//
// This member is required.
EncryptionConfiguration *EncryptionConfiguration
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
RoleARN *string
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The serializer, deserializer, and schema for converting data from the JSON
// format to the Parquet or ORC format before writing it to Amazon S3.
DataFormatConversionConfiguration *DataFormatConversionConfiguration
// The configuration of the dynamic partitioning mechanism that creates smaller
// data sets from the streaming data by partitioning it based on partition keys.
// Currently, dynamic partitioning is only supported for Amazon S3 destinations.
DynamicPartitioningConfiguration *DynamicPartitioningConfiguration
// A prefix that Kinesis Data Firehose evaluates and adds to failed records before
// writing them to S3. This prefix appears immediately following the bucket name.
// For information about how to specify this prefix, see Custom Prefixes for
// Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
ErrorOutputPrefix *string
// The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered
// Amazon S3 files. You can also specify a custom prefix, as described in Custom
// Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
Prefix *string
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The configuration for backup in Amazon S3.
S3BackupDescription *S3DestinationDescription
// The Amazon S3 backup mode.
S3BackupMode S3BackupMode
noSmithyDocumentSerde
}
// Describes an update for a destination in Amazon S3.
type ExtendedS3DestinationUpdate struct {
// The ARN of the S3 bucket. For more information, see Amazon Resource Names
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
BucketARN *string
// The buffering option.
BufferingHints *BufferingHints
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The compression format. If no value is specified, the default is UNCOMPRESSED .
CompressionFormat CompressionFormat
// The serializer, deserializer, and schema for converting data from the JSON
// format to the Parquet or ORC format before writing it to Amazon S3.
DataFormatConversionConfiguration *DataFormatConversionConfiguration
// The configuration of the dynamic partitioning mechanism that creates smaller
// data sets from the streaming data by partitioning it based on partition keys.
// Currently, dynamic partitioning is only supported for Amazon S3 destinations.
DynamicPartitioningConfiguration *DynamicPartitioningConfiguration
// The encryption configuration. If no value is specified, the default is no
// encryption.
EncryptionConfiguration *EncryptionConfiguration
// A prefix that Kinesis Data Firehose evaluates and adds to failed records before
// writing them to S3. This prefix appears immediately following the bucket name.
// For information about how to specify this prefix, see Custom Prefixes for
// Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
ErrorOutputPrefix *string
// The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered
// Amazon S3 files. You can also specify a custom prefix, as described in Custom
// Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
Prefix *string
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
RoleARN *string
// You can update a delivery stream to enable Amazon S3 backup if it is disabled.
// If backup is enabled, you can't update the delivery stream to disable it.
S3BackupMode S3BackupMode
// The Amazon S3 destination for backup.
S3BackupUpdate *S3DestinationUpdate
noSmithyDocumentSerde
}
// Provides details in case one of the following operations fails due to an error
// related to KMS: CreateDeliveryStream , DeleteDeliveryStream ,
// StartDeliveryStreamEncryption , StopDeliveryStreamEncryption .
type FailureDescription struct {
// A message providing details about the error that caused the failure.
//
// This member is required.
Details *string
// The type of error that caused the failure.
//
// This member is required.
Type DeliveryStreamFailureType
noSmithyDocumentSerde
}
// The native Hive / HCatalog JsonSerDe. Used by Kinesis Data Firehose for
// deserializing data, which means converting it from the JSON format in
// preparation for serializing it to the Parquet or ORC format. This is one of two
// deserializers you can choose, depending on which one offers the functionality
// you need. The other option is the OpenX SerDe.
type HiveJsonSerDe struct {
// Indicates how you want Kinesis Data Firehose to parse the date and timestamps
// that may be present in your input data JSON. To specify these format strings,
// follow the pattern syntax of JodaTime's DateTimeFormat format strings. For more
// information, see Class DateTimeFormat (https://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html)
// . You can also use the special value millis to parse timestamps in epoch
// milliseconds. If you don't specify a format, Kinesis Data Firehose uses
// java.sql.Timestamp::valueOf by default.
TimestampFormats []string
noSmithyDocumentSerde
}
// Describes the buffering options that can be applied before data is delivered to
// the HTTP endpoint destination. Kinesis Data Firehose treats these options as
// hints, and it might choose to use more optimal values. The SizeInMBs and
// IntervalInSeconds parameters are optional. However, if specify a value for one
// of them, you must also provide a value for the other.
type HttpEndpointBufferingHints struct {
// Buffer incoming data for the specified period of time, in seconds, before
// delivering it to the destination. The default value is 300 (5 minutes).
IntervalInSeconds *int32
// Buffer incoming data to the specified size, in MBs, before delivering it to the
// destination. The default value is 5. We recommend setting this parameter to a
// value greater than the amount of data you typically ingest into the delivery
// stream in 10 seconds. For example, if you typically ingest data at 1 MB/sec, the
// value should be 10 MB or higher.
SizeInMBs *int32
noSmithyDocumentSerde
}
// Describes the metadata that's delivered to the specified HTTP endpoint
// destination.
type HttpEndpointCommonAttribute struct {
// The name of the HTTP endpoint common attribute.
//
// This member is required.
AttributeName *string
// The value of the HTTP endpoint common attribute.
//
// This member is required.
AttributeValue *string
noSmithyDocumentSerde
}
// Describes the configuration of the HTTP endpoint to which Kinesis Firehose
// delivers data.
type HttpEndpointConfiguration struct {
// The URL of the HTTP endpoint selected as the destination. If you choose an HTTP
// endpoint as your destination, review and follow the instructions in the
// Appendix - HTTP Endpoint Delivery Request and Response Specifications (https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html)
// .
//
// This member is required.
Url *string
// The access key required for Kinesis Firehose to authenticate with the HTTP
// endpoint selected as the destination.
AccessKey *string
// The name of the HTTP endpoint selected as the destination.
Name *string
noSmithyDocumentSerde
}
// Describes the HTTP endpoint selected as the destination.
type HttpEndpointDescription struct {
// The name of the HTTP endpoint selected as the destination.
Name *string
// The URL of the HTTP endpoint selected as the destination.
Url *string
noSmithyDocumentSerde
}
// Describes the configuration of the HTTP endpoint destination.
type HttpEndpointDestinationConfiguration struct {
// The configuration of the HTTP endpoint selected as the destination.
//
// This member is required.
EndpointConfiguration *HttpEndpointConfiguration
// Describes the configuration of a destination in Amazon S3.
//
// This member is required.
S3Configuration *S3DestinationConfiguration
// The buffering options that can be used before data is delivered to the
// specified destination. Kinesis Data Firehose treats these options as hints, and
// it might choose to use more optimal values. The SizeInMBs and IntervalInSeconds
// parameters are optional. However, if you specify a value for one of them, you
// must also provide a value for the other.
BufferingHints *HttpEndpointBufferingHints
// Describes the Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// Describes a data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The configuration of the requeste sent to the HTTP endpoint specified as the
// destination.
RequestConfiguration *HttpEndpointRequestConfiguration
// Describes the retry behavior in case Kinesis Data Firehose is unable to deliver
// data to the specified HTTP endpoint destination, or if it doesn't receive a
// valid acknowledgment of receipt from the specified HTTP endpoint destination.
RetryOptions *HttpEndpointRetryOptions
// Kinesis Data Firehose uses this IAM role for all the permissions that the
// delivery stream needs.
RoleARN *string
// Describes the S3 bucket backup options for the data that Kinesis Data Firehose
// delivers to the HTTP endpoint destination. You can back up all documents (
// AllData ) or only the documents that Kinesis Data Firehose could not deliver to
// the specified HTTP endpoint destination ( FailedDataOnly ).
S3BackupMode HttpEndpointS3BackupMode
noSmithyDocumentSerde
}
// Describes the HTTP endpoint destination.
type HttpEndpointDestinationDescription struct {
// Describes buffering options that can be applied to the data before it is
// delivered to the HTTPS endpoint destination. Kinesis Data Firehose teats these
// options as hints, and it might choose to use more optimal values. The SizeInMBs
// and IntervalInSeconds parameters are optional. However, if specify a value for
// one of them, you must also provide a value for the other.
BufferingHints *HttpEndpointBufferingHints
// Describes the Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The configuration of the specified HTTP endpoint destination.
EndpointConfiguration *HttpEndpointDescription
// Describes a data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The configuration of request sent to the HTTP endpoint specified as the
// destination.
RequestConfiguration *HttpEndpointRequestConfiguration
// Describes the retry behavior in case Kinesis Data Firehose is unable to deliver
// data to the specified HTTP endpoint destination, or if it doesn't receive a
// valid acknowledgment of receipt from the specified HTTP endpoint destination.
RetryOptions *HttpEndpointRetryOptions
// Kinesis Data Firehose uses this IAM role for all the permissions that the
// delivery stream needs.
RoleARN *string
// Describes the S3 bucket backup options for the data that Kinesis Firehose
// delivers to the HTTP endpoint destination. You can back up all documents (
// AllData ) or only the documents that Kinesis Data Firehose could not deliver to
// the specified HTTP endpoint destination ( FailedDataOnly ).
S3BackupMode HttpEndpointS3BackupMode
// Describes a destination in Amazon S3.
S3DestinationDescription *S3DestinationDescription
noSmithyDocumentSerde
}
// Updates the specified HTTP endpoint destination.
type HttpEndpointDestinationUpdate struct {
// Describes buffering options that can be applied to the data before it is
// delivered to the HTTPS endpoint destination. Kinesis Data Firehose teats these
// options as hints, and it might choose to use more optimal values. The SizeInMBs
// and IntervalInSeconds parameters are optional. However, if specify a value for
// one of them, you must also provide a value for the other.
BufferingHints *HttpEndpointBufferingHints
// Describes the Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// Describes the configuration of the HTTP endpoint destination.
EndpointConfiguration *HttpEndpointConfiguration
// Describes a data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The configuration of the request sent to the HTTP endpoint specified as the
// destination.
RequestConfiguration *HttpEndpointRequestConfiguration
// Describes the retry behavior in case Kinesis Data Firehose is unable to deliver
// data to the specified HTTP endpoint destination, or if it doesn't receive a
// valid acknowledgment of receipt from the specified HTTP endpoint destination.
RetryOptions *HttpEndpointRetryOptions
// Kinesis Data Firehose uses this IAM role for all the permissions that the
// delivery stream needs.
RoleARN *string
// Describes the S3 bucket backup options for the data that Kinesis Firehose
// delivers to the HTTP endpoint destination. You can back up all documents (
// AllData ) or only the documents that Kinesis Data Firehose could not deliver to
// the specified HTTP endpoint destination ( FailedDataOnly ).
S3BackupMode HttpEndpointS3BackupMode
// Describes an update for a destination in Amazon S3.
S3Update *S3DestinationUpdate
noSmithyDocumentSerde
}
// The configuration of the HTTP endpoint request.
type HttpEndpointRequestConfiguration struct {
// Describes the metadata sent to the HTTP endpoint destination.
CommonAttributes []HttpEndpointCommonAttribute
// Kinesis Data Firehose uses the content encoding to compress the body of a
// request before sending the request to the destination. For more information, see
// Content-Encoding (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding)
// in MDN Web Docs, the official Mozilla documentation.
ContentEncoding ContentEncoding
noSmithyDocumentSerde
}
// Describes the retry behavior in case Kinesis Data Firehose is unable to deliver
// data to the specified HTTP endpoint destination, or if it doesn't receive a
// valid acknowledgment of receipt from the specified HTTP endpoint destination.
type HttpEndpointRetryOptions struct {
// The total amount of time that Kinesis Data Firehose spends on retries. This
// duration starts after the initial attempt to send data to the custom destination
// via HTTPS endpoint fails. It doesn't include the periods during which Kinesis
// Data Firehose waits for acknowledgment from the specified destination after each
// attempt.
DurationInSeconds *int32
noSmithyDocumentSerde
}
// Specifies the deserializer you want to use to convert the format of the input
// data. This parameter is required if Enabled is set to true.
type InputFormatConfiguration struct {
// Specifies which deserializer to use. You can choose either the Apache Hive JSON
// SerDe or the OpenX JSON SerDe. If both are non-null, the server rejects the
// request.
Deserializer *Deserializer
noSmithyDocumentSerde
}
// The stream and role Amazon Resource Names (ARNs) for a Kinesis data stream used
// as the source for a delivery stream.
type KinesisStreamSourceConfiguration struct {
// The ARN of the source Kinesis data stream. For more information, see Amazon
// Kinesis Data Streams ARN Format (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams)
// .
//
// This member is required.
KinesisStreamARN *string
// The ARN of the role that provides access to the source Kinesis data stream. For
// more information, see Amazon Web Services Identity and Access Management (IAM)
// ARN Format (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
// .
//
// This member is required.
RoleARN *string
noSmithyDocumentSerde
}
// Details about a Kinesis data stream used as the source for a Kinesis Data
// Firehose delivery stream.
type KinesisStreamSourceDescription struct {
// Kinesis Data Firehose starts retrieving records from the Kinesis data stream
// starting with this timestamp.
DeliveryStartTimestamp *time.Time
// The Amazon Resource Name (ARN) of the source Kinesis data stream. For more
// information, see Amazon Kinesis Data Streams ARN Format (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams)
// .
KinesisStreamARN *string
// The ARN of the role used by the source Kinesis data stream. For more
// information, see Amazon Web Services Identity and Access Management (IAM) ARN
// Format (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
// .
RoleARN *string
noSmithyDocumentSerde
}
// Describes an encryption key for a destination in Amazon S3.
type KMSEncryptionConfig struct {
// The Amazon Resource Name (ARN) of the encryption key. Must belong to the same
// Amazon Web Services Region as the destination Amazon S3 bucket. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
AWSKMSKeyARN *string
noSmithyDocumentSerde
}
// The OpenX SerDe. Used by Kinesis Data Firehose for deserializing data, which
// means converting it from the JSON format in preparation for serializing it to
// the Parquet or ORC format. This is one of two deserializers you can choose,
// depending on which one offers the functionality you need. The other option is
// the native Hive / HCatalog JsonSerDe.
type OpenXJsonSerDe struct {
// When set to true , which is the default, Kinesis Data Firehose converts JSON
// keys to lowercase before deserializing them.
CaseInsensitive *bool
// Maps column names to JSON keys that aren't identical to the column names. This
// is useful when the JSON contains keys that are Hive keywords. For example,
// timestamp is a Hive keyword. If you have a JSON key named timestamp , set this
// parameter to {"ts": "timestamp"} to map this key to a column named ts .
ColumnToJsonKeyMappings map[string]string
// When set to true , specifies that the names of the keys include dots and that
// you want Kinesis Data Firehose to replace them with underscores. This is useful
// because Apache Hive does not allow dots in column names. For example, if the
// JSON contains a key whose name is "a.b", you can define the column name to be
// "a_b" when using this option. The default is false .
ConvertDotsInJsonKeysToUnderscores *bool
noSmithyDocumentSerde
}
// A serializer to use for converting data to the ORC format before storing it in
// Amazon S3. For more information, see Apache ORC (https://orc.apache.org/docs/) .
type OrcSerDe struct {
// The Hadoop Distributed File System (HDFS) block size. This is useful if you
// intend to copy the data from Amazon S3 to HDFS before querying. The default is
// 256 MiB and the minimum is 64 MiB. Kinesis Data Firehose uses this value for
// padding calculations.
BlockSizeBytes *int32
// The column names for which you want Kinesis Data Firehose to create bloom
// filters. The default is null .
BloomFilterColumns []string
// The Bloom filter false positive probability (FPP). The lower the FPP, the
// bigger the Bloom filter. The default value is 0.05, the minimum is 0, and the
// maximum is 1.
BloomFilterFalsePositiveProbability *float64
// The compression code to use over data blocks. The default is SNAPPY .
Compression OrcCompression
// Represents the fraction of the total number of non-null rows. To turn off
// dictionary encoding, set this fraction to a number that is less than the number
// of distinct keys in a dictionary. To always use dictionary encoding, set this
// threshold to 1.
DictionaryKeyThreshold *float64
// Set this to true to indicate that you want stripes to be padded to the HDFS
// block boundaries. This is useful if you intend to copy the data from Amazon S3
// to HDFS before querying. The default is false .
EnablePadding *bool
// The version of the file to write. The possible values are V0_11 and V0_12 . The
// default is V0_12 .
FormatVersion OrcFormatVersion
// A number between 0 and 1 that defines the tolerance for block padding as a
// decimal fraction of stripe size. The default value is 0.05, which means 5
// percent of stripe size. For the default values of 64 MiB ORC stripes and 256 MiB
// HDFS blocks, the default block padding tolerance of 5 percent reserves a maximum
// of 3.2 MiB for padding within the 256 MiB block. In such a case, if the
// available size within the block is more than 3.2 MiB, a new, smaller stripe is
// inserted to fit within that space. This ensures that no stripe crosses block
// boundaries and causes remote reads within a node-local task. Kinesis Data
// Firehose ignores this parameter when OrcSerDe$EnablePadding is false .
PaddingTolerance *float64
// The number of rows between index entries. The default is 10,000 and the minimum
// is 1,000.
RowIndexStride *int32
// The number of bytes in each stripe. The default is 64 MiB and the minimum is 8
// MiB.
StripeSizeBytes *int32
noSmithyDocumentSerde
}
// Specifies the serializer that you want Kinesis Data Firehose to use to convert
// the format of your data before it writes it to Amazon S3. This parameter is
// required if Enabled is set to true.
type OutputFormatConfiguration struct {
// Specifies which serializer to use. You can choose either the ORC SerDe or the
// Parquet SerDe. If both are non-null, the server rejects the request.
Serializer *Serializer
noSmithyDocumentSerde
}
// A serializer to use for converting data to the Parquet format before storing it
// in Amazon S3. For more information, see Apache Parquet (https://parquet.apache.org/documentation/latest/)
// .
type ParquetSerDe struct {
// The Hadoop Distributed File System (HDFS) block size. This is useful if you
// intend to copy the data from Amazon S3 to HDFS before querying. The default is
// 256 MiB and the minimum is 64 MiB. Kinesis Data Firehose uses this value for
// padding calculations.
BlockSizeBytes *int32
// The compression code to use over data blocks. The possible values are
// UNCOMPRESSED , SNAPPY , and GZIP , with the default being SNAPPY . Use SNAPPY
// for higher decompression speed. Use GZIP if the compression ratio is more
// important than speed.
Compression ParquetCompression
// Indicates whether to enable dictionary compression.
EnableDictionaryCompression *bool
// The maximum amount of padding to apply. This is useful if you intend to copy
// the data from Amazon S3 to HDFS before querying. The default is 0.
MaxPaddingBytes *int32
// The Parquet page size. Column chunks are divided into pages. A page is
// conceptually an indivisible unit (in terms of compression and encoding). The
// minimum value is 64 KiB and the default is 1 MiB.
PageSizeBytes *int32
// Indicates the version of row format to output. The possible values are V1 and V2
// . The default is V1 .
WriterVersion ParquetWriterVersion
noSmithyDocumentSerde
}
// Describes a data processing configuration.
type ProcessingConfiguration struct {
// Enables or disables data processing.
Enabled *bool
// The data processors.
Processors []Processor
noSmithyDocumentSerde
}
// Describes a data processor.
type Processor struct {
// The type of processor.
//
// This member is required.
Type ProcessorType
// The processor parameters.
Parameters []ProcessorParameter
noSmithyDocumentSerde
}
// Describes the processor parameter.
type ProcessorParameter struct {
// The name of the parameter. Currently the following default values are
// supported: 3 for NumberOfRetries and 60 for the BufferIntervalInSeconds . The
// BufferSizeInMBs ranges between 0.2 MB and up to 3MB. The default buffering hint
// is 1MB for all destinations, except Splunk. For Splunk, the default buffering
// hint is 256 KB.
//
// This member is required.
ParameterName ProcessorParameterName
// The parameter value.
//
// This member is required.
ParameterValue *string
noSmithyDocumentSerde
}
// Contains the result for an individual record from a PutRecordBatch request. If
// the record is successfully added to your delivery stream, it receives a record
// ID. If the record fails to be added to your delivery stream, the result includes
// an error code and an error message.
type PutRecordBatchResponseEntry struct {
// The error code for an individual record result.
ErrorCode *string
// The error message for an individual record result.
ErrorMessage *string
// The ID of the record.
RecordId *string
noSmithyDocumentSerde
}
// The unit of data in a delivery stream.
type Record struct {
// The data blob, which is base64-encoded when the blob is serialized. The maximum
// size of the data blob, before base64-encoding, is 1,000 KiB.
//
// This member is required.
Data []byte
noSmithyDocumentSerde
}
// Describes the configuration of a destination in Amazon Redshift.
type RedshiftDestinationConfiguration struct {
// The database connection string.
//
// This member is required.
ClusterJDBCURL *string
// The COPY command.
//
// This member is required.
CopyCommand *CopyCommand
// The user password.
//
// This member is required.
Password *string
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
RoleARN *string
// The configuration for the intermediate Amazon S3 location from which Amazon
// Redshift obtains data. Restrictions are described in the topic for
// CreateDeliveryStream . The compression formats SNAPPY or ZIP cannot be
// specified in RedshiftDestinationConfiguration.S3Configuration because the
// Amazon Redshift COPY operation that reads from the S3 bucket doesn't support
// these compression formats.
//
// This member is required.
S3Configuration *S3DestinationConfiguration
// The name of the user.
//
// This member is required.
Username *string
// The CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver documents
// to Amazon Redshift. Default value is 3600 (60 minutes).
RetryOptions *RedshiftRetryOptions
// The configuration for backup in Amazon S3.
S3BackupConfiguration *S3DestinationConfiguration
// The Amazon S3 backup mode. After you create a delivery stream, you can update
// it to enable Amazon S3 backup if it is disabled. If backup is enabled, you can't
// update the delivery stream to disable it.
S3BackupMode RedshiftS3BackupMode
noSmithyDocumentSerde
}
// Describes a destination in Amazon Redshift.
type RedshiftDestinationDescription struct {
// The database connection string.
//
// This member is required.
ClusterJDBCURL *string
// The COPY command.
//
// This member is required.
CopyCommand *CopyCommand
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
RoleARN *string
// The Amazon S3 destination.
//
// This member is required.
S3DestinationDescription *S3DestinationDescription
// The name of the user.
//
// This member is required.
Username *string
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver documents
// to Amazon Redshift. Default value is 3600 (60 minutes).
RetryOptions *RedshiftRetryOptions
// The configuration for backup in Amazon S3.
S3BackupDescription *S3DestinationDescription
// The Amazon S3 backup mode.
S3BackupMode RedshiftS3BackupMode
noSmithyDocumentSerde
}
// Describes an update for a destination in Amazon Redshift.
type RedshiftDestinationUpdate struct {
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The database connection string.
ClusterJDBCURL *string
// The COPY command.
CopyCommand *CopyCommand
// The user password.
Password *string
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver documents
// to Amazon Redshift. Default value is 3600 (60 minutes).
RetryOptions *RedshiftRetryOptions
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
RoleARN *string
// You can update a delivery stream to enable Amazon S3 backup if it is disabled.
// If backup is enabled, you can't update the delivery stream to disable it.
S3BackupMode RedshiftS3BackupMode
// The Amazon S3 destination for backup.
S3BackupUpdate *S3DestinationUpdate
// The Amazon S3 destination. The compression formats SNAPPY or ZIP cannot be
// specified in RedshiftDestinationUpdate.S3Update because the Amazon Redshift COPY
// operation that reads from the S3 bucket doesn't support these compression
// formats.
S3Update *S3DestinationUpdate
// The name of the user.
Username *string
noSmithyDocumentSerde
}
// Configures retry behavior in case Kinesis Data Firehose is unable to deliver
// documents to Amazon Redshift.
type RedshiftRetryOptions struct {
// The length of time during which Kinesis Data Firehose retries delivery after a
// failure, starting from the initial request and including the first attempt. The
// default value is 3600 seconds (60 minutes). Kinesis Data Firehose does not retry
// if the value of DurationInSeconds is 0 (zero) or if the first delivery attempt
// takes longer than the current value.
DurationInSeconds *int32
noSmithyDocumentSerde
}
// The retry behavior in case Kinesis Data Firehose is unable to deliver data to
// an Amazon S3 prefix.
type RetryOptions struct {
// The period of time during which Kinesis Data Firehose retries to deliver data
// to the specified Amazon S3 prefix.
DurationInSeconds *int32
noSmithyDocumentSerde
}
// Describes the configuration of a destination in Amazon S3.
type S3DestinationConfiguration struct {
// The ARN of the S3 bucket. For more information, see Amazon Resource Names
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
BucketARN *string
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
RoleARN *string
// The buffering option. If no value is specified, BufferingHints object default
// values are used.
BufferingHints *BufferingHints
// The CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The compression format. If no value is specified, the default is UNCOMPRESSED .
// The compression formats SNAPPY or ZIP cannot be specified for Amazon Redshift
// destinations because they are not supported by the Amazon Redshift COPY
// operation that reads from the S3 bucket.
CompressionFormat CompressionFormat
// The encryption configuration. If no value is specified, the default is no
// encryption.
EncryptionConfiguration *EncryptionConfiguration
// A prefix that Kinesis Data Firehose evaluates and adds to failed records before
// writing them to S3. This prefix appears immediately following the bucket name.
// For information about how to specify this prefix, see Custom Prefixes for
// Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
ErrorOutputPrefix *string
// The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered
// Amazon S3 files. You can also specify a custom prefix, as described in Custom
// Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
Prefix *string
noSmithyDocumentSerde
}
// Describes a destination in Amazon S3.
type S3DestinationDescription struct {
// The ARN of the S3 bucket. For more information, see Amazon Resource Names
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
BucketARN *string
// The buffering option. If no value is specified, BufferingHints object default
// values are used.
//
// This member is required.
BufferingHints *BufferingHints
// The compression format. If no value is specified, the default is UNCOMPRESSED .
//
// This member is required.
CompressionFormat CompressionFormat
// The encryption configuration. If no value is specified, the default is no
// encryption.
//
// This member is required.
EncryptionConfiguration *EncryptionConfiguration
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
//
// This member is required.
RoleARN *string
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// A prefix that Kinesis Data Firehose evaluates and adds to failed records before
// writing them to S3. This prefix appears immediately following the bucket name.
// For information about how to specify this prefix, see Custom Prefixes for
// Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
ErrorOutputPrefix *string
// The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered
// Amazon S3 files. You can also specify a custom prefix, as described in Custom
// Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
Prefix *string
noSmithyDocumentSerde
}
// Describes an update for a destination in Amazon S3.
type S3DestinationUpdate struct {
// The ARN of the S3 bucket. For more information, see Amazon Resource Names
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
BucketARN *string
// The buffering option. If no value is specified, BufferingHints object default
// values are used.
BufferingHints *BufferingHints
// The CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The compression format. If no value is specified, the default is UNCOMPRESSED .
// The compression formats SNAPPY or ZIP cannot be specified for Amazon Redshift
// destinations because they are not supported by the Amazon Redshift COPY
// operation that reads from the S3 bucket.
CompressionFormat CompressionFormat
// The encryption configuration. If no value is specified, the default is no
// encryption.
EncryptionConfiguration *EncryptionConfiguration
// A prefix that Kinesis Data Firehose evaluates and adds to failed records before
// writing them to S3. This prefix appears immediately following the bucket name.
// For information about how to specify this prefix, see Custom Prefixes for
// Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
ErrorOutputPrefix *string
// The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered
// Amazon S3 files. You can also specify a custom prefix, as described in Custom
// Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html)
// .
Prefix *string
// The Amazon Resource Name (ARN) of the Amazon Web Services credentials. For more
// information, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
// .
RoleARN *string
noSmithyDocumentSerde
}
// Specifies the schema to which you want Kinesis Data Firehose to configure your
// data before it writes it to Amazon S3. This parameter is required if Enabled is
// set to true.
type SchemaConfiguration struct {
// The ID of the Amazon Web Services Glue Data Catalog. If you don't supply this,
// the Amazon Web Services account ID is used by default.
CatalogId *string
// Specifies the name of the Amazon Web Services Glue database that contains the
// schema for the output data. If the SchemaConfiguration request parameter is
// used as part of invoking the CreateDeliveryStream API, then the DatabaseName
// property is required and its value must be specified.
DatabaseName *string
// If you don't specify an Amazon Web Services Region, the default is the current
// Region.
Region *string
// The role that Kinesis Data Firehose can use to access Amazon Web Services Glue.
// This role must be in the same account you use for Kinesis Data Firehose.
// Cross-account roles aren't allowed. If the SchemaConfiguration request
// parameter is used as part of invoking the CreateDeliveryStream API, then the
// RoleARN property is required and its value must be specified.
RoleARN *string
// Specifies the Amazon Web Services Glue table that contains the column
// information that constitutes your data schema. If the SchemaConfiguration
// request parameter is used as part of invoking the CreateDeliveryStream API,
// then the TableName property is required and its value must be specified.
TableName *string
// Specifies the table version for the output data schema. If you don't specify
// this version ID, or if you set it to LATEST , Kinesis Data Firehose uses the
// most recent version. This means that any updates to the table are automatically
// picked up.
VersionId *string
noSmithyDocumentSerde
}
// The serializer that you want Kinesis Data Firehose to use to convert data to
// the target format before writing it to Amazon S3. Kinesis Data Firehose supports
// two types of serializers: the ORC SerDe (https://hive.apache.org/javadocs/r1.2.2/api/org/apache/hadoop/hive/ql/io/orc/OrcSerde.html)
// and the Parquet SerDe (https://hive.apache.org/javadocs/r1.2.2/api/org/apache/hadoop/hive/ql/io/parquet/serde/ParquetHiveSerDe.html)
// .
type Serializer struct {
// A serializer to use for converting data to the ORC format before storing it in
// Amazon S3. For more information, see Apache ORC (https://orc.apache.org/docs/) .
OrcSerDe *OrcSerDe
// A serializer to use for converting data to the Parquet format before storing it
// in Amazon S3. For more information, see Apache Parquet (https://parquet.apache.org/documentation/latest/)
// .
ParquetSerDe *ParquetSerDe
noSmithyDocumentSerde
}
// Details about a Kinesis data stream used as the source for a Kinesis Data
// Firehose delivery stream.
type SourceDescription struct {
// The KinesisStreamSourceDescription value for the source Kinesis data stream.
KinesisStreamSourceDescription *KinesisStreamSourceDescription
noSmithyDocumentSerde
}
// Describes the configuration of a destination in Splunk.
type SplunkDestinationConfiguration struct {
// The HTTP Event Collector (HEC) endpoint to which Kinesis Data Firehose sends
// your data.
//
// This member is required.
HECEndpoint *string
// This type can be either "Raw" or "Event."
//
// This member is required.
HECEndpointType HECEndpointType
// This is a GUID that you obtain from your Splunk cluster when you create a new
// HEC endpoint.
//
// This member is required.
HECToken *string
// The configuration for the backup Amazon S3 location.
//
// This member is required.
S3Configuration *S3DestinationConfiguration
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The amount of time that Kinesis Data Firehose waits to receive an
// acknowledgment from Splunk after it sends it data. At the end of the timeout
// period, Kinesis Data Firehose either tries to send the data again or considers
// it an error, based on your retry settings.
HECAcknowledgmentTimeoutInSeconds *int32
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver data to
// Splunk, or if it doesn't receive an acknowledgment of receipt from Splunk.
RetryOptions *SplunkRetryOptions
// Defines how documents should be delivered to Amazon S3. When set to
// FailedEventsOnly , Kinesis Data Firehose writes any data that could not be
// indexed to the configured Amazon S3 destination. When set to AllEvents , Kinesis
// Data Firehose delivers all incoming records to Amazon S3, and also writes failed
// documents to Amazon S3. The default value is FailedEventsOnly . You can update
// this backup mode from FailedEventsOnly to AllEvents . You can't update it from
// AllEvents to FailedEventsOnly .
S3BackupMode SplunkS3BackupMode
noSmithyDocumentSerde
}
// Describes a destination in Splunk.
type SplunkDestinationDescription struct {
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The amount of time that Kinesis Data Firehose waits to receive an
// acknowledgment from Splunk after it sends it data. At the end of the timeout
// period, Kinesis Data Firehose either tries to send the data again or considers
// it an error, based on your retry settings.
HECAcknowledgmentTimeoutInSeconds *int32
// The HTTP Event Collector (HEC) endpoint to which Kinesis Data Firehose sends
// your data.
HECEndpoint *string
// This type can be either "Raw" or "Event."
HECEndpointType HECEndpointType
// A GUID you obtain from your Splunk cluster when you create a new HEC endpoint.
HECToken *string
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver data to
// Splunk or if it doesn't receive an acknowledgment of receipt from Splunk.
RetryOptions *SplunkRetryOptions
// Defines how documents should be delivered to Amazon S3. When set to
// FailedDocumentsOnly , Kinesis Data Firehose writes any data that could not be
// indexed to the configured Amazon S3 destination. When set to AllDocuments ,
// Kinesis Data Firehose delivers all incoming records to Amazon S3, and also
// writes failed documents to Amazon S3. Default value is FailedDocumentsOnly .
S3BackupMode SplunkS3BackupMode
// The Amazon S3 destination.>
S3DestinationDescription *S3DestinationDescription
noSmithyDocumentSerde
}
// Describes an update for a destination in Splunk.
type SplunkDestinationUpdate struct {
// The Amazon CloudWatch logging options for your delivery stream.
CloudWatchLoggingOptions *CloudWatchLoggingOptions
// The amount of time that Kinesis Data Firehose waits to receive an
// acknowledgment from Splunk after it sends data. At the end of the timeout
// period, Kinesis Data Firehose either tries to send the data again or considers
// it an error, based on your retry settings.
HECAcknowledgmentTimeoutInSeconds *int32
// The HTTP Event Collector (HEC) endpoint to which Kinesis Data Firehose sends
// your data.
HECEndpoint *string
// This type can be either "Raw" or "Event."
HECEndpointType HECEndpointType
// A GUID that you obtain from your Splunk cluster when you create a new HEC
// endpoint.
HECToken *string
// The data processing configuration.
ProcessingConfiguration *ProcessingConfiguration
// The retry behavior in case Kinesis Data Firehose is unable to deliver data to
// Splunk or if it doesn't receive an acknowledgment of receipt from Splunk.
RetryOptions *SplunkRetryOptions
// Specifies how you want Kinesis Data Firehose to back up documents to Amazon S3.
// When set to FailedDocumentsOnly , Kinesis Data Firehose writes any data that
// could not be indexed to the configured Amazon S3 destination. When set to
// AllEvents , Kinesis Data Firehose delivers all incoming records to Amazon S3,
// and also writes failed documents to Amazon S3. The default value is
// FailedEventsOnly . You can update this backup mode from FailedEventsOnly to
// AllEvents . You can't update it from AllEvents to FailedEventsOnly .
S3BackupMode SplunkS3BackupMode
// Your update to the configuration of the backup Amazon S3 location.
S3Update *S3DestinationUpdate
noSmithyDocumentSerde
}
// Configures retry behavior in case Kinesis Data Firehose is unable to deliver
// documents to Splunk, or if it doesn't receive an acknowledgment from Splunk.
type SplunkRetryOptions struct {
// The total amount of time that Kinesis Data Firehose spends on retries. This
// duration starts after the initial attempt to send data to Splunk fails. It
// doesn't include the periods during which Kinesis Data Firehose waits for
// acknowledgment from Splunk after each attempt.
DurationInSeconds *int32
noSmithyDocumentSerde
}
// Metadata that you can assign to a delivery stream, consisting of a key-value
// pair.
type Tag struct {
// A unique identifier for the tag. Maximum length: 128 characters. Valid
// characters: Unicode letters, digits, white space, _ . / = + - % @
//
// This member is required.
Key *string
// An optional string, which you can use to describe or define the tag. Maximum
// length: 256 characters. Valid characters: Unicode letters, digits, white space,
// _ . / = + - % @
Value *string
noSmithyDocumentSerde
}
// The details of the VPC of the Amazon ES destination.
type VpcConfiguration struct {
// The ARN of the IAM role that you want the delivery stream to use to create
// endpoints in the destination VPC. You can use your existing Kinesis Data
// Firehose delivery role or you can specify a new role. In either case, make sure
// that the role trusts the Kinesis Data Firehose service principal and that it
// grants the following permissions:
// - ec2:DescribeVpcs
// - ec2:DescribeVpcAttribute
// - ec2:DescribeSubnets
// - ec2:DescribeSecurityGroups
// - ec2:DescribeNetworkInterfaces
// - ec2:CreateNetworkInterface
// - ec2:CreateNetworkInterfacePermission
// - ec2:DeleteNetworkInterface
// If you revoke these permissions after you create the delivery stream, Kinesis
// Data Firehose can't scale out by creating more ENIs when necessary. You might
// therefore see a degradation in performance.
//
// This member is required.
RoleARN *string
// The IDs of the security groups that you want Kinesis Data Firehose to use when
// it creates ENIs in the VPC of the Amazon ES destination. You can use the same
// security group that the Amazon ES domain uses or different ones. If you specify
// different security groups here, ensure that they allow outbound HTTPS traffic to
// the Amazon ES domain's security group. Also ensure that the Amazon ES domain's
// security group allows HTTPS traffic from the security groups specified here. If
// you use the same security group for both your delivery stream and the Amazon ES
// domain, make sure the security group inbound rule allows HTTPS traffic. For more
// information about security group rules, see Security group rules (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html#SecurityGroupRules)
// in the Amazon VPC documentation.
//
// This member is required.
SecurityGroupIds []string
// The IDs of the subnets that you want Kinesis Data Firehose to use to create
// ENIs in the VPC of the Amazon ES destination. Make sure that the routing tables
// and inbound and outbound rules allow traffic to flow from the subnets whose IDs
// are specified here to the subnets that have the destination Amazon ES endpoints.
// Kinesis Data Firehose creates at least one ENI in each of the subnets that are
// specified here. Do not delete or modify these ENIs. The number of ENIs that
// Kinesis Data Firehose creates in the subnets specified here scales up and down
// automatically based on throughput. To enable Kinesis Data Firehose to scale up
// the number of ENIs to match throughput, ensure that you have sufficient quota.
// To help you calculate the quota you need, assume that Kinesis Data Firehose can
// create up to three ENIs for this delivery stream for each of the subnets
// specified here. For more information about ENI quota, see Network Interfaces (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-enis)
// in the Amazon VPC Quotas topic.
//
// This member is required.
SubnetIds []string
noSmithyDocumentSerde
}
// The details of the VPC of the Amazon ES destination.
type VpcConfigurationDescription struct {
// The ARN of the IAM role that the delivery stream uses to create endpoints in
// the destination VPC. You can use your existing Kinesis Data Firehose delivery
// role or you can specify a new role. In either case, make sure that the role
// trusts the Kinesis Data Firehose service principal and that it grants the
// following permissions:
// - ec2:DescribeVpcs
// - ec2:DescribeVpcAttribute
// - ec2:DescribeSubnets
// - ec2:DescribeSecurityGroups
// - ec2:DescribeNetworkInterfaces
// - ec2:CreateNetworkInterface
// - ec2:CreateNetworkInterfacePermission
// - ec2:DeleteNetworkInterface
// If you revoke these permissions after you create the delivery stream, Kinesis
// Data Firehose can't scale out by creating more ENIs when necessary. You might
// therefore see a degradation in performance.
//
// This member is required.
RoleARN *string
// The IDs of the security groups that Kinesis Data Firehose uses when it creates
// ENIs in the VPC of the Amazon ES destination. You can use the same security
// group that the Amazon ES domain uses or different ones. If you specify different
// security groups, ensure that they allow outbound HTTPS traffic to the Amazon ES
// domain's security group. Also ensure that the Amazon ES domain's security group
// allows HTTPS traffic from the security groups specified here. If you use the
// same security group for both your delivery stream and the Amazon ES domain, make
// sure the security group inbound rule allows HTTPS traffic. For more information
// about security group rules, see Security group rules (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html#SecurityGroupRules)
// in the Amazon VPC documentation.
//
// This member is required.
SecurityGroupIds []string
// The IDs of the subnets that Kinesis Data Firehose uses to create ENIs in the
// VPC of the Amazon ES destination. Make sure that the routing tables and inbound
// and outbound rules allow traffic to flow from the subnets whose IDs are
// specified here to the subnets that have the destination Amazon ES endpoints.
// Kinesis Data Firehose creates at least one ENI in each of the subnets that are
// specified here. Do not delete or modify these ENIs. The number of ENIs that
// Kinesis Data Firehose creates in the subnets specified here scales up and down
// automatically based on throughput. To enable Kinesis Data Firehose to scale up
// the number of ENIs to match throughput, ensure that you have sufficient quota.
// To help you calculate the quota you need, assume that Kinesis Data Firehose can
// create up to three ENIs for this delivery stream for each of the subnets
// specified here. For more information about ENI quota, see Network Interfaces (https://docs.aws.amazon.com/vpc/latest/userguide/amazon-vpc-limits.html#vpc-limits-enis)
// in the Amazon VPC Quotas topic.
//
// This member is required.
SubnetIds []string
// The ID of the Amazon ES destination's VPC.
//
// This member is required.
VpcId *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 2,377 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
import (
"context"
cryptorand "crypto/rand"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyrand "github.com/aws/smithy-go/rand"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "fis"
const ServiceAPIVersion = "2020-12-01"
// Client provides the API client to make operations call for AWS Fault Injection
// Simulator.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
resolveIdempotencyTokenProvider(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// Provides idempotency tokens values that will be automatically populated into
// idempotent API operations.
IdempotencyTokenProvider IdempotencyTokenProvider
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "fis", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func resolveIdempotencyTokenProvider(o *Options) {
if o.IdempotencyTokenProvider != nil {
return
}
o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
// IdempotencyTokenProvider interface for providing idempotency token
type IdempotencyTokenProvider interface {
GetIdempotencyToken() (string, error)
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 455 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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 fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an experiment template. An experiment template includes the following
// components:
// - Targets: A target can be a specific resource in your Amazon Web Services
// environment, or one or more resources that match criteria that you specify, for
// example, resources that have specific tags.
// - Actions: The actions to carry out on the target. You can specify multiple
// actions, the duration of each action, and when to start each action during an
// experiment.
// - Stop conditions: If a stop condition is triggered while an experiment is
// running, the experiment is automatically stopped. You can define a stop
// condition as a CloudWatch alarm.
//
// For more information, see Experiment templates (https://docs.aws.amazon.com/fis/latest/userguide/experiment-templates.html)
// in the Fault Injection Simulator User Guide.
func (c *Client) CreateExperimentTemplate(ctx context.Context, params *CreateExperimentTemplateInput, optFns ...func(*Options)) (*CreateExperimentTemplateOutput, error) {
if params == nil {
params = &CreateExperimentTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateExperimentTemplate", params, optFns, c.addOperationCreateExperimentTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateExperimentTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateExperimentTemplateInput struct {
// The actions for the experiment.
//
// This member is required.
Actions map[string]types.CreateExperimentTemplateActionInput
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// A description for the experiment template.
//
// This member is required.
Description *string
// The Amazon Resource Name (ARN) of an IAM role that grants the FIS service
// permission to perform service actions on your behalf.
//
// This member is required.
RoleArn *string
// The stop conditions.
//
// This member is required.
StopConditions []types.CreateExperimentTemplateStopConditionInput
// The configuration for experiment logging.
LogConfiguration *types.CreateExperimentTemplateLogConfigurationInput
// The tags to apply to the experiment template.
Tags map[string]string
// The targets for the experiment.
Targets map[string]types.CreateExperimentTemplateTargetInput
noSmithyDocumentSerde
}
type CreateExperimentTemplateOutput struct {
// Information about the experiment template.
ExperimentTemplate *types.ExperimentTemplate
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateExperimentTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateExperimentTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateExperimentTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateExperimentTemplateMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateExperimentTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateExperimentTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateExperimentTemplate struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateExperimentTemplate) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateExperimentTemplate) 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.(*CreateExperimentTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateExperimentTemplateInput ")
}
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_opCreateExperimentTemplateMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateExperimentTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateExperimentTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "CreateExperimentTemplate",
}
}
| 206 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified experiment template.
func (c *Client) DeleteExperimentTemplate(ctx context.Context, params *DeleteExperimentTemplateInput, optFns ...func(*Options)) (*DeleteExperimentTemplateOutput, error) {
if params == nil {
params = &DeleteExperimentTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteExperimentTemplate", params, optFns, c.addOperationDeleteExperimentTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteExperimentTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteExperimentTemplateInput struct {
// The ID of the experiment template.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DeleteExperimentTemplateOutput struct {
// Information about the experiment template.
ExperimentTemplate *types.ExperimentTemplate
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteExperimentTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteExperimentTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteExperimentTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteExperimentTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteExperimentTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteExperimentTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "DeleteExperimentTemplate",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about the specified FIS action.
func (c *Client) GetAction(ctx context.Context, params *GetActionInput, optFns ...func(*Options)) (*GetActionOutput, error) {
if params == nil {
params = &GetActionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetAction", params, optFns, c.addOperationGetActionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetActionOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetActionInput struct {
// The ID of the action.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type GetActionOutput struct {
// Information about the action.
Action *types.Action
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetActionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAction{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAction{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetActionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAction(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetAction(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "GetAction",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about the specified experiment.
func (c *Client) GetExperiment(ctx context.Context, params *GetExperimentInput, optFns ...func(*Options)) (*GetExperimentOutput, error) {
if params == nil {
params = &GetExperimentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetExperiment", params, optFns, c.addOperationGetExperimentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetExperimentOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetExperimentInput struct {
// The ID of the experiment.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type GetExperimentOutput struct {
// Information about the experiment.
Experiment *types.Experiment
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetExperimentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetExperiment{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetExperiment{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetExperimentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExperiment(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetExperiment(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "GetExperiment",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about the specified experiment template.
func (c *Client) GetExperimentTemplate(ctx context.Context, params *GetExperimentTemplateInput, optFns ...func(*Options)) (*GetExperimentTemplateOutput, error) {
if params == nil {
params = &GetExperimentTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetExperimentTemplate", params, optFns, c.addOperationGetExperimentTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetExperimentTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetExperimentTemplateInput struct {
// The ID of the experiment template.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type GetExperimentTemplateOutput struct {
// Information about the experiment template.
ExperimentTemplate *types.ExperimentTemplate
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetExperimentTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetExperimentTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetExperimentTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetExperimentTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExperimentTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetExperimentTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "GetExperimentTemplate",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about the specified resource type.
func (c *Client) GetTargetResourceType(ctx context.Context, params *GetTargetResourceTypeInput, optFns ...func(*Options)) (*GetTargetResourceTypeOutput, error) {
if params == nil {
params = &GetTargetResourceTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetTargetResourceType", params, optFns, c.addOperationGetTargetResourceTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetTargetResourceTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetTargetResourceTypeInput struct {
// The resource type.
//
// This member is required.
ResourceType *string
noSmithyDocumentSerde
}
type GetTargetResourceTypeOutput struct {
// Information about the resource type.
TargetResourceType *types.TargetResourceType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetTargetResourceTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetTargetResourceType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetTargetResourceType{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetTargetResourceTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTargetResourceType(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetTargetResourceType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "GetTargetResourceType",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the available FIS actions.
func (c *Client) ListActions(ctx context.Context, params *ListActionsInput, optFns ...func(*Options)) (*ListActionsOutput, error) {
if params == nil {
params = &ListActionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListActions", params, optFns, c.addOperationListActionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListActionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListActionsInput struct {
// The maximum number of results to return with a single call. To retrieve the
// remaining results, make another call with the returned nextToken value.
MaxResults *int32
// The token for the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListActionsOutput struct {
// The actions.
Actions []types.ActionSummary
// The token to use to retrieve the next page of results. This value is null when
// there are no more results to return.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListActionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListActions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListActions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListActions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListActionsAPIClient is a client that implements the ListActions operation.
type ListActionsAPIClient interface {
ListActions(context.Context, *ListActionsInput, ...func(*Options)) (*ListActionsOutput, error)
}
var _ ListActionsAPIClient = (*Client)(nil)
// ListActionsPaginatorOptions is the paginator options for ListActions
type ListActionsPaginatorOptions struct {
// The maximum number of results to return with a single call. To retrieve the
// remaining results, make another call with the returned nextToken value.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListActionsPaginator is a paginator for ListActions
type ListActionsPaginator struct {
options ListActionsPaginatorOptions
client ListActionsAPIClient
params *ListActionsInput
nextToken *string
firstPage bool
}
// NewListActionsPaginator returns a new ListActionsPaginator
func NewListActionsPaginator(client ListActionsAPIClient, params *ListActionsInput, optFns ...func(*ListActionsPaginatorOptions)) *ListActionsPaginator {
if params == nil {
params = &ListActionsInput{}
}
options := ListActionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListActionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListActionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListActions page.
func (p *ListActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActionsOutput, 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.ListActions(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_opListActions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "ListActions",
}
}
| 219 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists your experiments.
func (c *Client) ListExperiments(ctx context.Context, params *ListExperimentsInput, optFns ...func(*Options)) (*ListExperimentsOutput, error) {
if params == nil {
params = &ListExperimentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListExperiments", params, optFns, c.addOperationListExperimentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListExperimentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListExperimentsInput struct {
// The maximum number of results to return with a single call. To retrieve the
// remaining results, make another call with the returned nextToken value.
MaxResults *int32
// The token for the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListExperimentsOutput struct {
// The experiments.
Experiments []types.ExperimentSummary
// The token to use to retrieve the next page of results. This value is null when
// there are no more results to return.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListExperimentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListExperiments{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListExperiments{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListExperiments(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListExperimentsAPIClient is a client that implements the ListExperiments
// operation.
type ListExperimentsAPIClient interface {
ListExperiments(context.Context, *ListExperimentsInput, ...func(*Options)) (*ListExperimentsOutput, error)
}
var _ ListExperimentsAPIClient = (*Client)(nil)
// ListExperimentsPaginatorOptions is the paginator options for ListExperiments
type ListExperimentsPaginatorOptions struct {
// The maximum number of results to return with a single call. To retrieve the
// remaining results, make another call with the returned nextToken value.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListExperimentsPaginator is a paginator for ListExperiments
type ListExperimentsPaginator struct {
options ListExperimentsPaginatorOptions
client ListExperimentsAPIClient
params *ListExperimentsInput
nextToken *string
firstPage bool
}
// NewListExperimentsPaginator returns a new ListExperimentsPaginator
func NewListExperimentsPaginator(client ListExperimentsAPIClient, params *ListExperimentsInput, optFns ...func(*ListExperimentsPaginatorOptions)) *ListExperimentsPaginator {
if params == nil {
params = &ListExperimentsInput{}
}
options := ListExperimentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListExperimentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListExperimentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListExperiments page.
func (p *ListExperimentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExperimentsOutput, 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.ListExperiments(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_opListExperiments(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "ListExperiments",
}
}
| 220 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists your experiment templates.
func (c *Client) ListExperimentTemplates(ctx context.Context, params *ListExperimentTemplatesInput, optFns ...func(*Options)) (*ListExperimentTemplatesOutput, error) {
if params == nil {
params = &ListExperimentTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListExperimentTemplates", params, optFns, c.addOperationListExperimentTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListExperimentTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListExperimentTemplatesInput struct {
// The maximum number of results to return with a single call. To retrieve the
// remaining results, make another call with the returned nextToken value.
MaxResults *int32
// The token for the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListExperimentTemplatesOutput struct {
// The experiment templates.
ExperimentTemplates []types.ExperimentTemplateSummary
// The token to use to retrieve the next page of results. This value is null when
// there are no more results to return.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListExperimentTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListExperimentTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListExperimentTemplates{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListExperimentTemplates(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListExperimentTemplatesAPIClient is a client that implements the
// ListExperimentTemplates operation.
type ListExperimentTemplatesAPIClient interface {
ListExperimentTemplates(context.Context, *ListExperimentTemplatesInput, ...func(*Options)) (*ListExperimentTemplatesOutput, error)
}
var _ ListExperimentTemplatesAPIClient = (*Client)(nil)
// ListExperimentTemplatesPaginatorOptions is the paginator options for
// ListExperimentTemplates
type ListExperimentTemplatesPaginatorOptions struct {
// The maximum number of results to return with a single call. To retrieve the
// remaining results, make another call with the returned nextToken value.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListExperimentTemplatesPaginator is a paginator for ListExperimentTemplates
type ListExperimentTemplatesPaginator struct {
options ListExperimentTemplatesPaginatorOptions
client ListExperimentTemplatesAPIClient
params *ListExperimentTemplatesInput
nextToken *string
firstPage bool
}
// NewListExperimentTemplatesPaginator returns a new
// ListExperimentTemplatesPaginator
func NewListExperimentTemplatesPaginator(client ListExperimentTemplatesAPIClient, params *ListExperimentTemplatesInput, optFns ...func(*ListExperimentTemplatesPaginatorOptions)) *ListExperimentTemplatesPaginator {
if params == nil {
params = &ListExperimentTemplatesInput{}
}
options := ListExperimentTemplatesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListExperimentTemplatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListExperimentTemplatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListExperimentTemplates page.
func (p *ListExperimentTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExperimentTemplatesOutput, 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.ListExperimentTemplates(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_opListExperimentTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "ListExperimentTemplates",
}
}
| 222 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the tags for the specified resource.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) of the resource.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The tags for the resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "ListTagsForResource",
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the target resource types.
func (c *Client) ListTargetResourceTypes(ctx context.Context, params *ListTargetResourceTypesInput, optFns ...func(*Options)) (*ListTargetResourceTypesOutput, error) {
if params == nil {
params = &ListTargetResourceTypesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTargetResourceTypes", params, optFns, c.addOperationListTargetResourceTypesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTargetResourceTypesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTargetResourceTypesInput struct {
// The maximum number of results to return with a single call. To retrieve the
// remaining results, make another call with the returned nextToken value.
MaxResults *int32
// The token for the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListTargetResourceTypesOutput struct {
// The token to use to retrieve the next page of results. This value is null when
// there are no more results to return.
NextToken *string
// The target resource types.
TargetResourceTypes []types.TargetResourceTypeSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTargetResourceTypesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTargetResourceTypes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTargetResourceTypes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListTargetResourceTypes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListTargetResourceTypesAPIClient is a client that implements the
// ListTargetResourceTypes operation.
type ListTargetResourceTypesAPIClient interface {
ListTargetResourceTypes(context.Context, *ListTargetResourceTypesInput, ...func(*Options)) (*ListTargetResourceTypesOutput, error)
}
var _ ListTargetResourceTypesAPIClient = (*Client)(nil)
// ListTargetResourceTypesPaginatorOptions is the paginator options for
// ListTargetResourceTypes
type ListTargetResourceTypesPaginatorOptions struct {
// The maximum number of results to return with a single call. To retrieve the
// remaining results, make another call with the returned nextToken value.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListTargetResourceTypesPaginator is a paginator for ListTargetResourceTypes
type ListTargetResourceTypesPaginator struct {
options ListTargetResourceTypesPaginatorOptions
client ListTargetResourceTypesAPIClient
params *ListTargetResourceTypesInput
nextToken *string
firstPage bool
}
// NewListTargetResourceTypesPaginator returns a new
// ListTargetResourceTypesPaginator
func NewListTargetResourceTypesPaginator(client ListTargetResourceTypesAPIClient, params *ListTargetResourceTypesInput, optFns ...func(*ListTargetResourceTypesPaginatorOptions)) *ListTargetResourceTypesPaginator {
if params == nil {
params = &ListTargetResourceTypesInput{}
}
options := ListTargetResourceTypesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListTargetResourceTypesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListTargetResourceTypesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListTargetResourceTypes page.
func (p *ListTargetResourceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetResourceTypesOutput, 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.ListTargetResourceTypes(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_opListTargetResourceTypes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "ListTargetResourceTypes",
}
}
| 222 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts running an experiment from the specified experiment template.
func (c *Client) StartExperiment(ctx context.Context, params *StartExperimentInput, optFns ...func(*Options)) (*StartExperimentOutput, error) {
if params == nil {
params = &StartExperimentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartExperiment", params, optFns, c.addOperationStartExperimentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartExperimentOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartExperimentInput struct {
// Unique, case-sensitive identifier that you provide to ensure the idempotency of
// the request.
//
// This member is required.
ClientToken *string
// The ID of the experiment template.
//
// This member is required.
ExperimentTemplateId *string
// The tags to apply to the experiment.
Tags map[string]string
noSmithyDocumentSerde
}
type StartExperimentOutput struct {
// Information about the experiment.
Experiment *types.Experiment
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartExperimentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartExperiment{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartExperiment{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opStartExperimentMiddleware(stack, options); err != nil {
return err
}
if err = addOpStartExperimentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartExperiment(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpStartExperiment struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpStartExperiment) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpStartExperiment) 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.(*StartExperimentInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *StartExperimentInput ")
}
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_opStartExperimentMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpStartExperiment{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opStartExperiment(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "StartExperiment",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Stops the specified experiment.
func (c *Client) StopExperiment(ctx context.Context, params *StopExperimentInput, optFns ...func(*Options)) (*StopExperimentOutput, error) {
if params == nil {
params = &StopExperimentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopExperiment", params, optFns, c.addOperationStopExperimentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopExperimentOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopExperimentInput struct {
// The ID of the experiment.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type StopExperimentOutput struct {
// Information about the experiment.
Experiment *types.Experiment
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopExperimentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStopExperiment{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopExperiment{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopExperimentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopExperiment(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStopExperiment(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "StopExperiment",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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"
)
// Applies the specified tags to the specified resource.
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource.
//
// This member is required.
ResourceArn *string
// The tags for the resource.
//
// This member is required.
Tags map[string]string
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "TagResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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 the specified tags from the specified resource.
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource.
//
// This member is required.
ResourceArn *string
// The tag keys to remove.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "UntagResource",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified experiment template.
func (c *Client) UpdateExperimentTemplate(ctx context.Context, params *UpdateExperimentTemplateInput, optFns ...func(*Options)) (*UpdateExperimentTemplateOutput, error) {
if params == nil {
params = &UpdateExperimentTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateExperimentTemplate", params, optFns, c.addOperationUpdateExperimentTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateExperimentTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateExperimentTemplateInput struct {
// The ID of the experiment template.
//
// This member is required.
Id *string
// The actions for the experiment.
Actions map[string]types.UpdateExperimentTemplateActionInputItem
// A description for the template.
Description *string
// The configuration for experiment logging.
LogConfiguration *types.UpdateExperimentTemplateLogConfigurationInput
// The Amazon Resource Name (ARN) of an IAM role that grants the FIS service
// permission to perform service actions on your behalf.
RoleArn *string
// The stop conditions for the experiment.
StopConditions []types.UpdateExperimentTemplateStopConditionInput
// The targets for the experiment.
Targets map[string]types.UpdateExperimentTemplateTargetInput
noSmithyDocumentSerde
}
type UpdateExperimentTemplateOutput struct {
// Information about the experiment template.
ExperimentTemplate *types.ExperimentTemplate
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateExperimentTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateExperimentTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateExperimentTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateExperimentTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateExperimentTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateExperimentTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fis",
OperationName: "UpdateExperimentTemplate",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/fis/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsRestjson1_deserializeOpCreateExperimentTemplate struct {
}
func (*awsRestjson1_deserializeOpCreateExperimentTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateExperimentTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateExperimentTemplate(response, &metadata)
}
output := &CreateExperimentTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateExperimentTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateExperimentTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateExperimentTemplateOutput(v **CreateExperimentTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateExperimentTemplateOutput
if *v == nil {
sv = &CreateExperimentTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "experimentTemplate":
if err := awsRestjson1_deserializeDocumentExperimentTemplate(&sv.ExperimentTemplate, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteExperimentTemplate struct {
}
func (*awsRestjson1_deserializeOpDeleteExperimentTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteExperimentTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteExperimentTemplate(response, &metadata)
}
output := &DeleteExperimentTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDeleteExperimentTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteExperimentTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteExperimentTemplateOutput(v **DeleteExperimentTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteExperimentTemplateOutput
if *v == nil {
sv = &DeleteExperimentTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "experimentTemplate":
if err := awsRestjson1_deserializeDocumentExperimentTemplate(&sv.ExperimentTemplate, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetAction struct {
}
func (*awsRestjson1_deserializeOpGetAction) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetAction(response, &metadata)
}
output := &GetActionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetActionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetAction(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetActionOutput(v **GetActionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetActionOutput
if *v == nil {
sv = &GetActionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "action":
if err := awsRestjson1_deserializeDocumentAction(&sv.Action, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetExperiment struct {
}
func (*awsRestjson1_deserializeOpGetExperiment) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetExperiment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetExperiment(response, &metadata)
}
output := &GetExperimentOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetExperimentOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetExperiment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetExperimentOutput(v **GetExperimentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetExperimentOutput
if *v == nil {
sv = &GetExperimentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "experiment":
if err := awsRestjson1_deserializeDocumentExperiment(&sv.Experiment, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetExperimentTemplate struct {
}
func (*awsRestjson1_deserializeOpGetExperimentTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetExperimentTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetExperimentTemplate(response, &metadata)
}
output := &GetExperimentTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetExperimentTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetExperimentTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetExperimentTemplateOutput(v **GetExperimentTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetExperimentTemplateOutput
if *v == nil {
sv = &GetExperimentTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "experimentTemplate":
if err := awsRestjson1_deserializeDocumentExperimentTemplate(&sv.ExperimentTemplate, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetTargetResourceType struct {
}
func (*awsRestjson1_deserializeOpGetTargetResourceType) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetTargetResourceType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetTargetResourceType(response, &metadata)
}
output := &GetTargetResourceTypeOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetTargetResourceTypeOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetTargetResourceType(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetTargetResourceTypeOutput(v **GetTargetResourceTypeOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetTargetResourceTypeOutput
if *v == nil {
sv = &GetTargetResourceTypeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "targetResourceType":
if err := awsRestjson1_deserializeDocumentTargetResourceType(&sv.TargetResourceType, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListActions struct {
}
func (*awsRestjson1_deserializeOpListActions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListActions(response, &metadata)
}
output := &ListActionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListActionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListActions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListActionsOutput(v **ListActionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListActionsOutput
if *v == nil {
sv = &ListActionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "actions":
if err := awsRestjson1_deserializeDocumentActionSummaryList(&sv.Actions, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListExperiments struct {
}
func (*awsRestjson1_deserializeOpListExperiments) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListExperiments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListExperiments(response, &metadata)
}
output := &ListExperimentsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListExperimentsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListExperiments(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListExperimentsOutput(v **ListExperimentsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListExperimentsOutput
if *v == nil {
sv = &ListExperimentsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "experiments":
if err := awsRestjson1_deserializeDocumentExperimentSummaryList(&sv.Experiments, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListExperimentTemplates struct {
}
func (*awsRestjson1_deserializeOpListExperimentTemplates) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListExperimentTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListExperimentTemplates(response, &metadata)
}
output := &ListExperimentTemplatesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListExperimentTemplatesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListExperimentTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListExperimentTemplatesOutput(v **ListExperimentTemplatesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListExperimentTemplatesOutput
if *v == nil {
sv = &ListExperimentTemplatesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "experimentTemplates":
if err := awsRestjson1_deserializeDocumentExperimentTemplateSummaryList(&sv.ExperimentTemplates, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTagsForResource struct {
}
func (*awsRestjson1_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTargetResourceTypes struct {
}
func (*awsRestjson1_deserializeOpListTargetResourceTypes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTargetResourceTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListTargetResourceTypes(response, &metadata)
}
output := &ListTargetResourceTypesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListTargetResourceTypesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListTargetResourceTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListTargetResourceTypesOutput(v **ListTargetResourceTypesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTargetResourceTypesOutput
if *v == nil {
sv = &ListTargetResourceTypesOutput{}
} 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 "targetResourceTypes":
if err := awsRestjson1_deserializeDocumentTargetResourceTypeSummaryList(&sv.TargetResourceTypes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpStartExperiment struct {
}
func (*awsRestjson1_deserializeOpStartExperiment) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartExperiment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorStartExperiment(response, &metadata)
}
output := &StartExperimentOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentStartExperimentOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorStartExperiment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentStartExperimentOutput(v **StartExperimentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartExperimentOutput
if *v == nil {
sv = &StartExperimentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "experiment":
if err := awsRestjson1_deserializeDocumentExperiment(&sv.Experiment, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpStopExperiment struct {
}
func (*awsRestjson1_deserializeOpStopExperiment) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStopExperiment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorStopExperiment(response, &metadata)
}
output := &StopExperimentOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentStopExperimentOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorStopExperiment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentStopExperimentOutput(v **StopExperimentOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StopExperimentOutput
if *v == nil {
sv = &StopExperimentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "experiment":
if err := awsRestjson1_deserializeDocumentExperiment(&sv.Experiment, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpTagResource struct {
}
func (*awsRestjson1_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUntagResource struct {
}
func (*awsRestjson1_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateExperimentTemplate struct {
}
func (*awsRestjson1_deserializeOpUpdateExperimentTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateExperimentTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdateExperimentTemplate(response, &metadata)
}
output := &UpdateExperimentTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateExperimentTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateExperimentTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ServiceQuotaExceededException", errorCode):
return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateExperimentTemplateOutput(v **UpdateExperimentTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateExperimentTemplateOutput
if *v == nil {
sv = &UpdateExperimentTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "experimentTemplate":
if err := awsRestjson1_deserializeDocumentExperimentTemplate(&sv.ExperimentTemplate, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ConflictException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceNotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ServiceQuotaExceededException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ValidationException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentValidationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeDocumentAction(v **types.Action, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Action
if *v == nil {
sv = &types.Action{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "parameters":
if err := awsRestjson1_deserializeDocumentActionParameterMap(&sv.Parameters, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "targets":
if err := awsRestjson1_deserializeDocumentActionTargetMap(&sv.Targets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentActionParameter(v **types.ActionParameter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ActionParameter
if *v == nil {
sv = &types.ActionParameter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionParameterDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "required":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected ActionParameterRequired to be of type *bool, got %T instead", value)
}
sv.Required = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentActionParameterMap(v *map[string]types.ActionParameter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.ActionParameter
if *v == nil {
mv = map[string]types.ActionParameter{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.ActionParameter
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentActionParameter(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentActionSummary(v **types.ActionSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ActionSummary
if *v == nil {
sv = &types.ActionSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "targets":
if err := awsRestjson1_deserializeDocumentActionTargetMap(&sv.Targets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentActionSummaryList(v *[]types.ActionSummary, 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.ActionSummary
if *v == nil {
cv = []types.ActionSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ActionSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentActionSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentActionTarget(v **types.ActionTarget, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ActionTarget
if *v == nil {
sv = &types.ActionTarget{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TargetResourceTypeId to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentActionTargetMap(v *map[string]types.ActionTarget, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.ActionTarget
if *v == nil {
mv = map[string]types.ActionTarget{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.ActionTarget
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentActionTarget(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperiment(v **types.Experiment, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Experiment
if *v == nil {
sv = &types.Experiment{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "actions":
if err := awsRestjson1_deserializeDocumentExperimentActionMap(&sv.Actions, value); err != nil {
return err
}
case "creationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected CreationTime to be a JSON Number, got %T instead", value)
}
}
case "endTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected ExperimentEndTime to be a JSON Number, got %T instead", value)
}
}
case "experimentTemplateId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateId to be of type string, got %T instead", value)
}
sv.ExperimentTemplateId = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "logConfiguration":
if err := awsRestjson1_deserializeDocumentExperimentLogConfiguration(&sv.LogConfiguration, value); err != nil {
return err
}
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
case "startTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected ExperimentStartTime to be a JSON Number, got %T instead", value)
}
}
case "state":
if err := awsRestjson1_deserializeDocumentExperimentState(&sv.State, value); err != nil {
return err
}
case "stopConditions":
if err := awsRestjson1_deserializeDocumentExperimentStopConditionList(&sv.StopConditions, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "targets":
if err := awsRestjson1_deserializeDocumentExperimentTargetMap(&sv.Targets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentAction(v **types.ExperimentAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentAction
if *v == nil {
sv = &types.ExperimentAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "actionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionId to be of type string, got %T instead", value)
}
sv.ActionId = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentActionDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "endTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected ExperimentActionEndTime to be a JSON Number, got %T instead", value)
}
}
case "parameters":
if err := awsRestjson1_deserializeDocumentExperimentActionParameterMap(&sv.Parameters, value); err != nil {
return err
}
case "startAfter":
if err := awsRestjson1_deserializeDocumentExperimentActionStartAfterList(&sv.StartAfter, value); err != nil {
return err
}
case "startTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected ExperimentActionStartTime to be a JSON Number, got %T instead", value)
}
}
case "state":
if err := awsRestjson1_deserializeDocumentExperimentActionState(&sv.State, value); err != nil {
return err
}
case "targets":
if err := awsRestjson1_deserializeDocumentExperimentActionTargetMap(&sv.Targets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentActionMap(v *map[string]types.ExperimentAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.ExperimentAction
if *v == nil {
mv = map[string]types.ExperimentAction{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.ExperimentAction
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentExperimentAction(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentExperimentActionParameterMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentActionParameter to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentExperimentActionStartAfterList(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 ExperimentActionStartAfter to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentActionState(v **types.ExperimentActionState, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentActionState
if *v == nil {
sv = &types.ExperimentActionState{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentActionStatusReason to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentActionStatus to be of type string, got %T instead", value)
}
sv.Status = types.ExperimentActionStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentActionTargetMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTargetName to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentExperimentCloudWatchLogsLogConfiguration(v **types.ExperimentCloudWatchLogsLogConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentCloudWatchLogsLogConfiguration
if *v == nil {
sv = &types.ExperimentCloudWatchLogsLogConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "logGroupArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CloudWatchLogGroupArn to be of type string, got %T instead", value)
}
sv.LogGroupArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentLogConfiguration(v **types.ExperimentLogConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentLogConfiguration
if *v == nil {
sv = &types.ExperimentLogConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "cloudWatchLogsConfiguration":
if err := awsRestjson1_deserializeDocumentExperimentCloudWatchLogsLogConfiguration(&sv.CloudWatchLogsConfiguration, value); err != nil {
return err
}
case "logSchemaVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected LogSchemaVersion to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LogSchemaVersion = ptr.Int32(int32(i64))
}
case "s3Configuration":
if err := awsRestjson1_deserializeDocumentExperimentS3LogConfiguration(&sv.S3Configuration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentS3LogConfiguration(v **types.ExperimentS3LogConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentS3LogConfiguration
if *v == nil {
sv = &types.ExperimentS3LogConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "bucketName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value)
}
sv.BucketName = ptr.String(jtv)
}
case "prefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3ObjectKey to be of type string, got %T instead", value)
}
sv.Prefix = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentState(v **types.ExperimentState, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentState
if *v == nil {
sv = &types.ExperimentState{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentStatusReason to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentStatus to be of type string, got %T instead", value)
}
sv.Status = types.ExperimentStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentStopCondition(v **types.ExperimentStopCondition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentStopCondition
if *v == nil {
sv = &types.ExperimentStopCondition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "source":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StopConditionSource to be of type string, got %T instead", value)
}
sv.Source = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StopConditionValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentStopConditionList(v *[]types.ExperimentStopCondition, 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.ExperimentStopCondition
if *v == nil {
cv = []types.ExperimentStopCondition{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExperimentStopCondition
destAddr := &col
if err := awsRestjson1_deserializeDocumentExperimentStopCondition(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentSummary(v **types.ExperimentSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentSummary
if *v == nil {
sv = &types.ExperimentSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "creationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected CreationTime to be a JSON Number, got %T instead", value)
}
}
case "experimentTemplateId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateId to be of type string, got %T instead", value)
}
sv.ExperimentTemplateId = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "state":
if err := awsRestjson1_deserializeDocumentExperimentState(&sv.State, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentSummaryList(v *[]types.ExperimentSummary, 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.ExperimentSummary
if *v == nil {
cv = []types.ExperimentSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExperimentSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentExperimentSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTarget(v **types.ExperimentTarget, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTarget
if *v == nil {
sv = &types.ExperimentTarget{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "filters":
if err := awsRestjson1_deserializeDocumentExperimentTargetFilterList(&sv.Filters, value); err != nil {
return err
}
case "parameters":
if err := awsRestjson1_deserializeDocumentExperimentTargetParameterMap(&sv.Parameters, value); err != nil {
return err
}
case "resourceArns":
if err := awsRestjson1_deserializeDocumentResourceArnList(&sv.ResourceArns, value); err != nil {
return err
}
case "resourceTags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.ResourceTags, value); err != nil {
return err
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TargetResourceTypeId to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
case "selectionMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTargetSelectionMode to be of type string, got %T instead", value)
}
sv.SelectionMode = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTargetFilter(v **types.ExperimentTargetFilter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTargetFilter
if *v == nil {
sv = &types.ExperimentTargetFilter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "path":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTargetFilterPath to be of type string, got %T instead", value)
}
sv.Path = ptr.String(jtv)
}
case "values":
if err := awsRestjson1_deserializeDocumentExperimentTargetFilterValues(&sv.Values, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTargetFilterList(v *[]types.ExperimentTargetFilter, 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.ExperimentTargetFilter
if *v == nil {
cv = []types.ExperimentTargetFilter{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExperimentTargetFilter
destAddr := &col
if err := awsRestjson1_deserializeDocumentExperimentTargetFilter(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTargetFilterValues(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 ExperimentTargetFilterValue to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTargetMap(v *map[string]types.ExperimentTarget, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.ExperimentTarget
if *v == nil {
mv = map[string]types.ExperimentTarget{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.ExperimentTarget
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentExperimentTarget(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTargetParameterMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTargetParameterValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplate(v **types.ExperimentTemplate, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTemplate
if *v == nil {
sv = &types.ExperimentTemplate{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "actions":
if err := awsRestjson1_deserializeDocumentExperimentTemplateActionMap(&sv.Actions, value); err != nil {
return err
}
case "creationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected CreationTime to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "lastUpdateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected LastUpdateTime to be a JSON Number, got %T instead", value)
}
}
case "logConfiguration":
if err := awsRestjson1_deserializeDocumentExperimentTemplateLogConfiguration(&sv.LogConfiguration, value); err != nil {
return err
}
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
case "stopConditions":
if err := awsRestjson1_deserializeDocumentExperimentTemplateStopConditionList(&sv.StopConditions, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "targets":
if err := awsRestjson1_deserializeDocumentExperimentTemplateTargetMap(&sv.Targets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateAction(v **types.ExperimentTemplateAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTemplateAction
if *v == nil {
sv = &types.ExperimentTemplateAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "actionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionId to be of type string, got %T instead", value)
}
sv.ActionId = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateActionDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "parameters":
if err := awsRestjson1_deserializeDocumentExperimentTemplateActionParameterMap(&sv.Parameters, value); err != nil {
return err
}
case "startAfter":
if err := awsRestjson1_deserializeDocumentExperimentTemplateActionStartAfterList(&sv.StartAfter, value); err != nil {
return err
}
case "targets":
if err := awsRestjson1_deserializeDocumentExperimentTemplateActionTargetMap(&sv.Targets, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateActionMap(v *map[string]types.ExperimentTemplateAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.ExperimentTemplateAction
if *v == nil {
mv = map[string]types.ExperimentTemplateAction{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.ExperimentTemplateAction
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentExperimentTemplateAction(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateActionParameterMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateActionParameter to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateActionStartAfterList(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 ExperimentTemplateActionStartAfter to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateActionTargetMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateTargetName to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateCloudWatchLogsLogConfiguration(v **types.ExperimentTemplateCloudWatchLogsLogConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTemplateCloudWatchLogsLogConfiguration
if *v == nil {
sv = &types.ExperimentTemplateCloudWatchLogsLogConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "logGroupArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CloudWatchLogGroupArn to be of type string, got %T instead", value)
}
sv.LogGroupArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateLogConfiguration(v **types.ExperimentTemplateLogConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTemplateLogConfiguration
if *v == nil {
sv = &types.ExperimentTemplateLogConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "cloudWatchLogsConfiguration":
if err := awsRestjson1_deserializeDocumentExperimentTemplateCloudWatchLogsLogConfiguration(&sv.CloudWatchLogsConfiguration, value); err != nil {
return err
}
case "logSchemaVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected LogSchemaVersion to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LogSchemaVersion = ptr.Int32(int32(i64))
}
case "s3Configuration":
if err := awsRestjson1_deserializeDocumentExperimentTemplateS3LogConfiguration(&sv.S3Configuration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateS3LogConfiguration(v **types.ExperimentTemplateS3LogConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTemplateS3LogConfiguration
if *v == nil {
sv = &types.ExperimentTemplateS3LogConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "bucketName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value)
}
sv.BucketName = ptr.String(jtv)
}
case "prefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3ObjectKey to be of type string, got %T instead", value)
}
sv.Prefix = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateStopCondition(v **types.ExperimentTemplateStopCondition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTemplateStopCondition
if *v == nil {
sv = &types.ExperimentTemplateStopCondition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "source":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StopConditionSource to be of type string, got %T instead", value)
}
sv.Source = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StopConditionValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateStopConditionList(v *[]types.ExperimentTemplateStopCondition, 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.ExperimentTemplateStopCondition
if *v == nil {
cv = []types.ExperimentTemplateStopCondition{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExperimentTemplateStopCondition
destAddr := &col
if err := awsRestjson1_deserializeDocumentExperimentTemplateStopCondition(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateSummary(v **types.ExperimentTemplateSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTemplateSummary
if *v == nil {
sv = &types.ExperimentTemplateSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "creationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected CreationTime to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "lastUpdateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected LastUpdateTime to be a JSON Number, got %T instead", value)
}
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateSummaryList(v *[]types.ExperimentTemplateSummary, 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.ExperimentTemplateSummary
if *v == nil {
cv = []types.ExperimentTemplateSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExperimentTemplateSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentExperimentTemplateSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateTarget(v **types.ExperimentTemplateTarget, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTemplateTarget
if *v == nil {
sv = &types.ExperimentTemplateTarget{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "filters":
if err := awsRestjson1_deserializeDocumentExperimentTemplateTargetFilterList(&sv.Filters, value); err != nil {
return err
}
case "parameters":
if err := awsRestjson1_deserializeDocumentExperimentTemplateTargetParameterMap(&sv.Parameters, value); err != nil {
return err
}
case "resourceArns":
if err := awsRestjson1_deserializeDocumentResourceArnList(&sv.ResourceArns, value); err != nil {
return err
}
case "resourceTags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.ResourceTags, value); err != nil {
return err
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TargetResourceTypeId to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
case "selectionMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateTargetSelectionMode to be of type string, got %T instead", value)
}
sv.SelectionMode = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateTargetFilter(v **types.ExperimentTemplateTargetFilter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ExperimentTemplateTargetFilter
if *v == nil {
sv = &types.ExperimentTemplateTargetFilter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "path":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateTargetFilterPath to be of type string, got %T instead", value)
}
sv.Path = ptr.String(jtv)
}
case "values":
if err := awsRestjson1_deserializeDocumentExperimentTemplateTargetFilterValues(&sv.Values, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateTargetFilterList(v *[]types.ExperimentTemplateTargetFilter, 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.ExperimentTemplateTargetFilter
if *v == nil {
cv = []types.ExperimentTemplateTargetFilter{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ExperimentTemplateTargetFilter
destAddr := &col
if err := awsRestjson1_deserializeDocumentExperimentTemplateTargetFilter(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateTargetFilterValues(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 ExperimentTemplateTargetFilterValue to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateTargetMap(v *map[string]types.ExperimentTemplateTarget, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.ExperimentTemplateTarget
if *v == nil {
mv = map[string]types.ExperimentTemplateTarget{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.ExperimentTemplateTarget
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentExperimentTemplateTarget(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentExperimentTemplateTargetParameterMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExperimentTemplateTargetParameterValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentResourceArnList(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 ResourceArn to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ServiceQuotaExceededException
if *v == nil {
sv = &types.ServiceQuotaExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentTargetResourceType(v **types.TargetResourceType, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.TargetResourceType
if *v == nil {
sv = &types.TargetResourceType{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TargetResourceTypeDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "parameters":
if err := awsRestjson1_deserializeDocumentTargetResourceTypeParameterMap(&sv.Parameters, value); err != nil {
return err
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TargetResourceTypeId to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTargetResourceTypeParameter(v **types.TargetResourceTypeParameter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.TargetResourceTypeParameter
if *v == nil {
sv = &types.TargetResourceTypeParameter{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TargetResourceTypeParameterDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "required":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected TargetResourceTypeParameterRequired to be of type *bool, got %T instead", value)
}
sv.Required = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTargetResourceTypeParameterMap(v *map[string]types.TargetResourceTypeParameter, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.TargetResourceTypeParameter
if *v == nil {
mv = map[string]types.TargetResourceTypeParameter{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.TargetResourceTypeParameter
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentTargetResourceTypeParameter(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentTargetResourceTypeSummary(v **types.TargetResourceTypeSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.TargetResourceTypeSummary
if *v == nil {
sv = &types.TargetResourceTypeSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TargetResourceTypeDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TargetResourceTypeId to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTargetResourceTypeSummaryList(v *[]types.TargetResourceTypeSummary, 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.TargetResourceTypeSummary
if *v == nil {
cv = []types.TargetResourceTypeSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TargetResourceTypeSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentTargetResourceTypeSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 5,218 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package fis provides the API client, operations, and parameter types for AWS
// Fault Injection Simulator.
//
// Fault Injection Simulator is a managed service that enables you to perform
// fault injection experiments on your Amazon Web Services workloads. For more
// information, see the Fault Injection Simulator User Guide (https://docs.aws.amazon.com/fis/latest/userguide/)
// .
package fis
| 11 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
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/fis/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 = "fis"
}
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 fis
// 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 fis
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/fis/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpCreateExperimentTemplate struct {
}
func (*awsRestjson1_serializeOpCreateExperimentTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateExperimentTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateExperimentTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/experimentTemplates")
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_serializeOpDocumentCreateExperimentTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateExperimentTemplateInput(v *CreateExperimentTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateExperimentTemplateInput(v *CreateExperimentTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Actions != nil {
ok := object.Key("actions")
if err := awsRestjson1_serializeDocumentCreateExperimentTemplateActionInputMap(v.Actions, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.LogConfiguration != nil {
ok := object.Key("logConfiguration")
if err := awsRestjson1_serializeDocumentCreateExperimentTemplateLogConfigurationInput(v.LogConfiguration, ok); err != nil {
return err
}
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.StopConditions != nil {
ok := object.Key("stopConditions")
if err := awsRestjson1_serializeDocumentCreateExperimentTemplateStopConditionInputList(v.StopConditions, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.Targets != nil {
ok := object.Key("targets")
if err := awsRestjson1_serializeDocumentCreateExperimentTemplateTargetInputMap(v.Targets, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteExperimentTemplate struct {
}
func (*awsRestjson1_serializeOpDeleteExperimentTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteExperimentTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteExperimentTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/experimentTemplates/{id}")
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_serializeOpHttpBindingsDeleteExperimentTemplateInput(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_serializeOpHttpBindingsDeleteExperimentTemplateInput(v *DeleteExperimentTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetAction struct {
}
func (*awsRestjson1_serializeOpGetAction) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetActionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/actions/{id}")
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_serializeOpHttpBindingsGetActionInput(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_serializeOpHttpBindingsGetActionInput(v *GetActionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetExperiment struct {
}
func (*awsRestjson1_serializeOpGetExperiment) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetExperiment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetExperimentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/experiments/{id}")
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_serializeOpHttpBindingsGetExperimentInput(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_serializeOpHttpBindingsGetExperimentInput(v *GetExperimentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetExperimentTemplate struct {
}
func (*awsRestjson1_serializeOpGetExperimentTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetExperimentTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetExperimentTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/experimentTemplates/{id}")
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_serializeOpHttpBindingsGetExperimentTemplateInput(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_serializeOpHttpBindingsGetExperimentTemplateInput(v *GetExperimentTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetTargetResourceType struct {
}
func (*awsRestjson1_serializeOpGetTargetResourceType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetTargetResourceType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetTargetResourceTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/targetResourceTypes/{resourceType}")
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_serializeOpHttpBindingsGetTargetResourceTypeInput(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_serializeOpHttpBindingsGetTargetResourceTypeInput(v *GetTargetResourceTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceType == nil || len(*v.ResourceType) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceType must not be empty")}
}
if v.ResourceType != nil {
if err := encoder.SetURI("resourceType").String(*v.ResourceType); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListActions struct {
}
func (*awsRestjson1_serializeOpListActions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListActions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListActionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/actions")
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_serializeOpHttpBindingsListActionsInput(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_serializeOpHttpBindingsListActionsInput(v *ListActionsInput, 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_serializeOpListExperiments struct {
}
func (*awsRestjson1_serializeOpListExperiments) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListExperiments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListExperimentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/experiments")
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_serializeOpHttpBindingsListExperimentsInput(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_serializeOpHttpBindingsListExperimentsInput(v *ListExperimentsInput, 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_serializeOpListExperimentTemplates struct {
}
func (*awsRestjson1_serializeOpListExperimentTemplates) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListExperimentTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListExperimentTemplatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/experimentTemplates")
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_serializeOpHttpBindingsListExperimentTemplatesInput(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_serializeOpHttpBindingsListExperimentTemplatesInput(v *ListExperimentTemplatesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListTagsForResource struct {
}
func (*awsRestjson1_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListTargetResourceTypes struct {
}
func (*awsRestjson1_serializeOpListTargetResourceTypes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTargetResourceTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTargetResourceTypesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/targetResourceTypes")
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_serializeOpHttpBindingsListTargetResourceTypesInput(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_serializeOpHttpBindingsListTargetResourceTypesInput(v *ListTargetResourceTypesInput, 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_serializeOpStartExperiment struct {
}
func (*awsRestjson1_serializeOpStartExperiment) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartExperiment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartExperimentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/experiments")
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_serializeOpDocumentStartExperimentInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsStartExperimentInput(v *StartExperimentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentStartExperimentInput(v *StartExperimentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ExperimentTemplateId != nil {
ok := object.Key("experimentTemplateId")
ok.String(*v.ExperimentTemplateId)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStopExperiment struct {
}
func (*awsRestjson1_serializeOpStopExperiment) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStopExperiment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopExperimentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/experiments/{id}")
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_serializeOpHttpBindingsStopExperimentInput(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_serializeOpHttpBindingsStopExperimentInput(v *StopExperimentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUntagResource struct {
}
func (*awsRestjson1_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("tagKeys").String(v.TagKeys[i])
}
}
return nil
}
type awsRestjson1_serializeOpUpdateExperimentTemplate struct {
}
func (*awsRestjson1_serializeOpUpdateExperimentTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateExperimentTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateExperimentTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/experimentTemplates/{id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateExperimentTemplateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateExperimentTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateExperimentTemplateInput(v *UpdateExperimentTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateExperimentTemplateInput(v *UpdateExperimentTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Actions != nil {
ok := object.Key("actions")
if err := awsRestjson1_serializeDocumentUpdateExperimentTemplateActionInputMap(v.Actions, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.LogConfiguration != nil {
ok := object.Key("logConfiguration")
if err := awsRestjson1_serializeDocumentUpdateExperimentTemplateLogConfigurationInput(v.LogConfiguration, ok); err != nil {
return err
}
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.StopConditions != nil {
ok := object.Key("stopConditions")
if err := awsRestjson1_serializeDocumentUpdateExperimentTemplateStopConditionInputList(v.StopConditions, ok); err != nil {
return err
}
}
if v.Targets != nil {
ok := object.Key("targets")
if err := awsRestjson1_serializeDocumentUpdateExperimentTemplateTargetInputMap(v.Targets, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCreateExperimentTemplateActionInput(v *types.CreateExperimentTemplateActionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActionId != nil {
ok := object.Key("actionId")
ok.String(*v.ActionId)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Parameters != nil {
ok := object.Key("parameters")
if err := awsRestjson1_serializeDocumentExperimentTemplateActionParameterMap(v.Parameters, ok); err != nil {
return err
}
}
if v.StartAfter != nil {
ok := object.Key("startAfter")
if err := awsRestjson1_serializeDocumentExperimentTemplateActionStartAfterList(v.StartAfter, ok); err != nil {
return err
}
}
if v.Targets != nil {
ok := object.Key("targets")
if err := awsRestjson1_serializeDocumentExperimentTemplateActionTargetMap(v.Targets, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCreateExperimentTemplateActionInputMap(v map[string]types.CreateExperimentTemplateActionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentCreateExperimentTemplateActionInput(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCreateExperimentTemplateLogConfigurationInput(v *types.CreateExperimentTemplateLogConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLogsConfiguration != nil {
ok := object.Key("cloudWatchLogsConfiguration")
if err := awsRestjson1_serializeDocumentExperimentTemplateCloudWatchLogsLogConfigurationInput(v.CloudWatchLogsConfiguration, ok); err != nil {
return err
}
}
if v.LogSchemaVersion != nil {
ok := object.Key("logSchemaVersion")
ok.Integer(*v.LogSchemaVersion)
}
if v.S3Configuration != nil {
ok := object.Key("s3Configuration")
if err := awsRestjson1_serializeDocumentExperimentTemplateS3LogConfigurationInput(v.S3Configuration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCreateExperimentTemplateStopConditionInput(v *types.CreateExperimentTemplateStopConditionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Source != nil {
ok := object.Key("source")
ok.String(*v.Source)
}
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentCreateExperimentTemplateStopConditionInputList(v []types.CreateExperimentTemplateStopConditionInput, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentCreateExperimentTemplateStopConditionInput(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCreateExperimentTemplateTargetInput(v *types.CreateExperimentTemplateTargetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentExperimentTemplateTargetFilterInputList(v.Filters, ok); err != nil {
return err
}
}
if v.Parameters != nil {
ok := object.Key("parameters")
if err := awsRestjson1_serializeDocumentExperimentTemplateTargetParameterMap(v.Parameters, ok); err != nil {
return err
}
}
if v.ResourceArns != nil {
ok := object.Key("resourceArns")
if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil {
return err
}
}
if v.ResourceTags != nil {
ok := object.Key("resourceTags")
if err := awsRestjson1_serializeDocumentTagMap(v.ResourceTags, ok); err != nil {
return err
}
}
if v.ResourceType != nil {
ok := object.Key("resourceType")
ok.String(*v.ResourceType)
}
if v.SelectionMode != nil {
ok := object.Key("selectionMode")
ok.String(*v.SelectionMode)
}
return nil
}
func awsRestjson1_serializeDocumentCreateExperimentTemplateTargetInputMap(v map[string]types.CreateExperimentTemplateTargetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentCreateExperimentTemplateTargetInput(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentExperimentTemplateActionParameterMap(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_serializeDocumentExperimentTemplateActionStartAfterList(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_serializeDocumentExperimentTemplateActionTargetMap(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_serializeDocumentExperimentTemplateCloudWatchLogsLogConfigurationInput(v *types.ExperimentTemplateCloudWatchLogsLogConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogGroupArn != nil {
ok := object.Key("logGroupArn")
ok.String(*v.LogGroupArn)
}
return nil
}
func awsRestjson1_serializeDocumentExperimentTemplateS3LogConfigurationInput(v *types.ExperimentTemplateS3LogConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketName != nil {
ok := object.Key("bucketName")
ok.String(*v.BucketName)
}
if v.Prefix != nil {
ok := object.Key("prefix")
ok.String(*v.Prefix)
}
return nil
}
func awsRestjson1_serializeDocumentExperimentTemplateTargetFilterInputList(v []types.ExperimentTemplateTargetInputFilter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentExperimentTemplateTargetInputFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentExperimentTemplateTargetFilterValues(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_serializeDocumentExperimentTemplateTargetInputFilter(v *types.ExperimentTemplateTargetInputFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Path != nil {
ok := object.Key("path")
ok.String(*v.Path)
}
if v.Values != nil {
ok := object.Key("values")
if err := awsRestjson1_serializeDocumentExperimentTemplateTargetFilterValues(v.Values, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentExperimentTemplateTargetParameterMap(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_serializeDocumentResourceArnList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentUpdateExperimentTemplateActionInputItem(v *types.UpdateExperimentTemplateActionInputItem, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActionId != nil {
ok := object.Key("actionId")
ok.String(*v.ActionId)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Parameters != nil {
ok := object.Key("parameters")
if err := awsRestjson1_serializeDocumentExperimentTemplateActionParameterMap(v.Parameters, ok); err != nil {
return err
}
}
if v.StartAfter != nil {
ok := object.Key("startAfter")
if err := awsRestjson1_serializeDocumentExperimentTemplateActionStartAfterList(v.StartAfter, ok); err != nil {
return err
}
}
if v.Targets != nil {
ok := object.Key("targets")
if err := awsRestjson1_serializeDocumentExperimentTemplateActionTargetMap(v.Targets, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentUpdateExperimentTemplateActionInputMap(v map[string]types.UpdateExperimentTemplateActionInputItem, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentUpdateExperimentTemplateActionInputItem(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentUpdateExperimentTemplateLogConfigurationInput(v *types.UpdateExperimentTemplateLogConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLogsConfiguration != nil {
ok := object.Key("cloudWatchLogsConfiguration")
if err := awsRestjson1_serializeDocumentExperimentTemplateCloudWatchLogsLogConfigurationInput(v.CloudWatchLogsConfiguration, ok); err != nil {
return err
}
}
if v.LogSchemaVersion != nil {
ok := object.Key("logSchemaVersion")
ok.Integer(*v.LogSchemaVersion)
}
if v.S3Configuration != nil {
ok := object.Key("s3Configuration")
if err := awsRestjson1_serializeDocumentExperimentTemplateS3LogConfigurationInput(v.S3Configuration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentUpdateExperimentTemplateStopConditionInput(v *types.UpdateExperimentTemplateStopConditionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Source != nil {
ok := object.Key("source")
ok.String(*v.Source)
}
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentUpdateExperimentTemplateStopConditionInputList(v []types.UpdateExperimentTemplateStopConditionInput, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentUpdateExperimentTemplateStopConditionInput(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentUpdateExperimentTemplateTargetInput(v *types.UpdateExperimentTemplateTargetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("filters")
if err := awsRestjson1_serializeDocumentExperimentTemplateTargetFilterInputList(v.Filters, ok); err != nil {
return err
}
}
if v.Parameters != nil {
ok := object.Key("parameters")
if err := awsRestjson1_serializeDocumentExperimentTemplateTargetParameterMap(v.Parameters, ok); err != nil {
return err
}
}
if v.ResourceArns != nil {
ok := object.Key("resourceArns")
if err := awsRestjson1_serializeDocumentResourceArnList(v.ResourceArns, ok); err != nil {
return err
}
}
if v.ResourceTags != nil {
ok := object.Key("resourceTags")
if err := awsRestjson1_serializeDocumentTagMap(v.ResourceTags, ok); err != nil {
return err
}
}
if v.ResourceType != nil {
ok := object.Key("resourceType")
ok.String(*v.ResourceType)
}
if v.SelectionMode != nil {
ok := object.Key("selectionMode")
ok.String(*v.SelectionMode)
}
return nil
}
func awsRestjson1_serializeDocumentUpdateExperimentTemplateTargetInputMap(v map[string]types.UpdateExperimentTemplateTargetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentUpdateExperimentTemplateTargetInput(&mapVar, om); err != nil {
return err
}
}
return nil
}
| 1,576 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fis
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/fis/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateExperimentTemplate struct {
}
func (*validateOpCreateExperimentTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateExperimentTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateExperimentTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateExperimentTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteExperimentTemplate struct {
}
func (*validateOpDeleteExperimentTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteExperimentTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteExperimentTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteExperimentTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAction struct {
}
func (*validateOpGetAction) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetActionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetActionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetExperiment struct {
}
func (*validateOpGetExperiment) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetExperiment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetExperimentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetExperimentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetExperimentTemplate struct {
}
func (*validateOpGetExperimentTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetExperimentTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetExperimentTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetExperimentTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetTargetResourceType struct {
}
func (*validateOpGetTargetResourceType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetTargetResourceType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetTargetResourceTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetTargetResourceTypeInput(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 validateOpStartExperiment struct {
}
func (*validateOpStartExperiment) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartExperiment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartExperimentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartExperimentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopExperiment struct {
}
func (*validateOpStopExperiment) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopExperiment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopExperimentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopExperimentInput(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 validateOpUpdateExperimentTemplate struct {
}
func (*validateOpUpdateExperimentTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateExperimentTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateExperimentTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateExperimentTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateExperimentTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateExperimentTemplate{}, middleware.After)
}
func addOpDeleteExperimentTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteExperimentTemplate{}, middleware.After)
}
func addOpGetActionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAction{}, middleware.After)
}
func addOpGetExperimentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetExperiment{}, middleware.After)
}
func addOpGetExperimentTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetExperimentTemplate{}, middleware.After)
}
func addOpGetTargetResourceTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetTargetResourceType{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpStartExperimentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartExperiment{}, middleware.After)
}
func addOpStopExperimentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopExperiment{}, 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 addOpUpdateExperimentTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateExperimentTemplate{}, middleware.After)
}
func validateCreateExperimentTemplateActionInput(v *types.CreateExperimentTemplateActionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExperimentTemplateActionInput"}
if v.ActionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ActionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCreateExperimentTemplateActionInputMap(v map[string]types.CreateExperimentTemplateActionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExperimentTemplateActionInputMap"}
for key := range v {
value := v[key]
if err := validateCreateExperimentTemplateActionInput(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCreateExperimentTemplateLogConfigurationInput(v *types.CreateExperimentTemplateLogConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExperimentTemplateLogConfigurationInput"}
if v.CloudWatchLogsConfiguration != nil {
if err := validateExperimentTemplateCloudWatchLogsLogConfigurationInput(v.CloudWatchLogsConfiguration); err != nil {
invalidParams.AddNested("CloudWatchLogsConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.S3Configuration != nil {
if err := validateExperimentTemplateS3LogConfigurationInput(v.S3Configuration); err != nil {
invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError))
}
}
if v.LogSchemaVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogSchemaVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCreateExperimentTemplateStopConditionInput(v *types.CreateExperimentTemplateStopConditionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExperimentTemplateStopConditionInput"}
if v.Source == nil {
invalidParams.Add(smithy.NewErrParamRequired("Source"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCreateExperimentTemplateStopConditionInputList(v []types.CreateExperimentTemplateStopConditionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExperimentTemplateStopConditionInputList"}
for i := range v {
if err := validateCreateExperimentTemplateStopConditionInput(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCreateExperimentTemplateTargetInput(v *types.CreateExperimentTemplateTargetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExperimentTemplateTargetInput"}
if v.ResourceType == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
}
if v.Filters != nil {
if err := validateExperimentTemplateTargetFilterInputList(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if v.SelectionMode == nil {
invalidParams.Add(smithy.NewErrParamRequired("SelectionMode"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCreateExperimentTemplateTargetInputMap(v map[string]types.CreateExperimentTemplateTargetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExperimentTemplateTargetInputMap"}
for key := range v {
value := v[key]
if err := validateCreateExperimentTemplateTargetInput(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExperimentTemplateCloudWatchLogsLogConfigurationInput(v *types.ExperimentTemplateCloudWatchLogsLogConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExperimentTemplateCloudWatchLogsLogConfigurationInput"}
if v.LogGroupArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogGroupArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExperimentTemplateS3LogConfigurationInput(v *types.ExperimentTemplateS3LogConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExperimentTemplateS3LogConfigurationInput"}
if v.BucketName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExperimentTemplateTargetFilterInputList(v []types.ExperimentTemplateTargetInputFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExperimentTemplateTargetFilterInputList"}
for i := range v {
if err := validateExperimentTemplateTargetInputFilter(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExperimentTemplateTargetInputFilter(v *types.ExperimentTemplateTargetInputFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExperimentTemplateTargetInputFilter"}
if v.Path == nil {
invalidParams.Add(smithy.NewErrParamRequired("Path"))
}
if v.Values == nil {
invalidParams.Add(smithy.NewErrParamRequired("Values"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUpdateExperimentTemplateLogConfigurationInput(v *types.UpdateExperimentTemplateLogConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateExperimentTemplateLogConfigurationInput"}
if v.CloudWatchLogsConfiguration != nil {
if err := validateExperimentTemplateCloudWatchLogsLogConfigurationInput(v.CloudWatchLogsConfiguration); err != nil {
invalidParams.AddNested("CloudWatchLogsConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.S3Configuration != nil {
if err := validateExperimentTemplateS3LogConfigurationInput(v.S3Configuration); err != nil {
invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUpdateExperimentTemplateStopConditionInput(v *types.UpdateExperimentTemplateStopConditionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateExperimentTemplateStopConditionInput"}
if v.Source == nil {
invalidParams.Add(smithy.NewErrParamRequired("Source"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUpdateExperimentTemplateStopConditionInputList(v []types.UpdateExperimentTemplateStopConditionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateExperimentTemplateStopConditionInputList"}
for i := range v {
if err := validateUpdateExperimentTemplateStopConditionInput(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUpdateExperimentTemplateTargetInput(v *types.UpdateExperimentTemplateTargetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateExperimentTemplateTargetInput"}
if v.ResourceType == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
}
if v.Filters != nil {
if err := validateExperimentTemplateTargetFilterInputList(v.Filters); err != nil {
invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError))
}
}
if v.SelectionMode == nil {
invalidParams.Add(smithy.NewErrParamRequired("SelectionMode"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateUpdateExperimentTemplateTargetInputMap(v map[string]types.UpdateExperimentTemplateTargetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateExperimentTemplateTargetInputMap"}
for key := range v {
value := v[key]
if err := validateUpdateExperimentTemplateTargetInput(&value); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%q]", key), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateExperimentTemplateInput(v *CreateExperimentTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateExperimentTemplateInput"}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.Description == nil {
invalidParams.Add(smithy.NewErrParamRequired("Description"))
}
if v.StopConditions == nil {
invalidParams.Add(smithy.NewErrParamRequired("StopConditions"))
} else if v.StopConditions != nil {
if err := validateCreateExperimentTemplateStopConditionInputList(v.StopConditions); err != nil {
invalidParams.AddNested("StopConditions", err.(smithy.InvalidParamsError))
}
}
if v.Targets != nil {
if err := validateCreateExperimentTemplateTargetInputMap(v.Targets); err != nil {
invalidParams.AddNested("Targets", err.(smithy.InvalidParamsError))
}
}
if v.Actions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Actions"))
} else if v.Actions != nil {
if err := validateCreateExperimentTemplateActionInputMap(v.Actions); err != nil {
invalidParams.AddNested("Actions", err.(smithy.InvalidParamsError))
}
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.LogConfiguration != nil {
if err := validateCreateExperimentTemplateLogConfigurationInput(v.LogConfiguration); err != nil {
invalidParams.AddNested("LogConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteExperimentTemplateInput(v *DeleteExperimentTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteExperimentTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetActionInput(v *GetActionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetActionInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetExperimentInput(v *GetExperimentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetExperimentInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetExperimentTemplateInput(v *GetExperimentTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetExperimentTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetTargetResourceTypeInput(v *GetTargetResourceTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetTargetResourceTypeInput"}
if v.ResourceType == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
}
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 validateOpStartExperimentInput(v *StartExperimentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartExperimentInput"}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.ExperimentTemplateId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExperimentTemplateId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopExperimentInput(v *StopExperimentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopExperimentInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
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 invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateExperimentTemplateInput(v *UpdateExperimentTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateExperimentTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.StopConditions != nil {
if err := validateUpdateExperimentTemplateStopConditionInputList(v.StopConditions); err != nil {
invalidParams.AddNested("StopConditions", err.(smithy.InvalidParamsError))
}
}
if v.Targets != nil {
if err := validateUpdateExperimentTemplateTargetInputMap(v.Targets); err != nil {
invalidParams.AddNested("Targets", err.(smithy.InvalidParamsError))
}
}
if v.LogConfiguration != nil {
if err := validateUpdateExperimentTemplateLogConfigurationInput(v.LogConfiguration); err != nil {
invalidParams.AddNested("LogConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 822 |
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 fis 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: "fis.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fis-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "fis-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "fis.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "fis.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fis-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "fis-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "fis.{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: "fis-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "fis.{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: "fis-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "fis.{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: "fis-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "fis.{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: "fis-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "fis.{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: "fis.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "fis-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "fis-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "fis.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 297 |
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 ExperimentActionStatus string
// Enum values for ExperimentActionStatus
const (
ExperimentActionStatusPending ExperimentActionStatus = "pending"
ExperimentActionStatusInitiating ExperimentActionStatus = "initiating"
ExperimentActionStatusRunning ExperimentActionStatus = "running"
ExperimentActionStatusCompleted ExperimentActionStatus = "completed"
ExperimentActionStatusCancelled ExperimentActionStatus = "cancelled"
ExperimentActionStatusStopping ExperimentActionStatus = "stopping"
ExperimentActionStatusStopped ExperimentActionStatus = "stopped"
ExperimentActionStatusFailed ExperimentActionStatus = "failed"
)
// Values returns all known values for ExperimentActionStatus. 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 (ExperimentActionStatus) Values() []ExperimentActionStatus {
return []ExperimentActionStatus{
"pending",
"initiating",
"running",
"completed",
"cancelled",
"stopping",
"stopped",
"failed",
}
}
type ExperimentStatus string
// Enum values for ExperimentStatus
const (
ExperimentStatusPending ExperimentStatus = "pending"
ExperimentStatusInitiating ExperimentStatus = "initiating"
ExperimentStatusRunning ExperimentStatus = "running"
ExperimentStatusCompleted ExperimentStatus = "completed"
ExperimentStatusStopping ExperimentStatus = "stopping"
ExperimentStatusStopped ExperimentStatus = "stopped"
ExperimentStatusFailed ExperimentStatus = "failed"
)
// Values returns all known values for ExperimentStatus. 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 (ExperimentStatus) Values() []ExperimentStatus {
return []ExperimentStatus{
"pending",
"initiating",
"running",
"completed",
"stopping",
"stopped",
"failed",
}
}
| 62 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// The request could not be processed because of a conflict.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified resource cannot 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 }
// You have exceeded your service quota.
type ServiceQuotaExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServiceQuotaExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceQuotaExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceQuotaExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceQuotaExceededException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified input is not valid, or fails to satisfy the constraints for the
// request.
type ValidationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ValidationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ValidationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ValidationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ValidationException"
}
return *e.ErrorCodeOverride
}
func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 114 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// Describes an action. For more information, see FIS actions (https://docs.aws.amazon.com/fis/latest/userguide/fis-actions-reference.html)
// in the Fault Injection Simulator User Guide.
type Action struct {
// The description for the action.
Description *string
// The ID of the action.
Id *string
// The action parameters, if applicable.
Parameters map[string]ActionParameter
// The tags for the action.
Tags map[string]string
// The supported targets for the action.
Targets map[string]ActionTarget
noSmithyDocumentSerde
}
// Describes a parameter for an action.
type ActionParameter struct {
// The parameter description.
Description *string
// Indicates whether the parameter is required.
Required *bool
noSmithyDocumentSerde
}
// Provides a summary of an action.
type ActionSummary struct {
// The description for the action.
Description *string
// The ID of the action.
Id *string
// The tags for the action.
Tags map[string]string
// The targets for the action.
Targets map[string]ActionTarget
noSmithyDocumentSerde
}
// Describes a target for an action.
type ActionTarget struct {
// The resource type of the target.
ResourceType *string
noSmithyDocumentSerde
}
// Specifies an action for an experiment template. For more information, see
// Actions (https://docs.aws.amazon.com/fis/latest/userguide/actions.html) in the
// Fault Injection Simulator User Guide.
type CreateExperimentTemplateActionInput struct {
// The ID of the action. The format of the action ID is:
// aws:service-name:action-type.
//
// This member is required.
ActionId *string
// A description for the action.
Description *string
// The parameters for the action, if applicable.
Parameters map[string]string
// The name of the action that must be completed before the current action starts.
// Omit this parameter to run the action at the start of the experiment.
StartAfter []string
// The targets for the action.
Targets map[string]string
noSmithyDocumentSerde
}
// Specifies the configuration for experiment logging.
type CreateExperimentTemplateLogConfigurationInput struct {
// The schema version.
//
// This member is required.
LogSchemaVersion *int32
// The configuration for experiment logging to Amazon CloudWatch Logs.
CloudWatchLogsConfiguration *ExperimentTemplateCloudWatchLogsLogConfigurationInput
// The configuration for experiment logging to Amazon S3.
S3Configuration *ExperimentTemplateS3LogConfigurationInput
noSmithyDocumentSerde
}
// Specifies a stop condition for an experiment template.
type CreateExperimentTemplateStopConditionInput struct {
// The source for the stop condition. Specify aws:cloudwatch:alarm if the stop
// condition is defined by a CloudWatch alarm. Specify none if there is no stop
// condition.
//
// This member is required.
Source *string
// The Amazon Resource Name (ARN) of the CloudWatch alarm. This is required if the
// source is a CloudWatch alarm.
Value *string
noSmithyDocumentSerde
}
// Specifies a target for an experiment. You must specify at least one Amazon
// Resource Name (ARN) or at least one resource tag. You cannot specify both ARNs
// and tags. For more information, see Targets (https://docs.aws.amazon.com/fis/latest/userguide/targets.html)
// in the Fault Injection Simulator User Guide.
type CreateExperimentTemplateTargetInput struct {
// The resource type. The resource type must be supported for the specified action.
//
// This member is required.
ResourceType *string
// Scopes the identified resources to a specific count of the resources at random,
// or a percentage of the resources. All identified resources are included in the
// target.
// - ALL - Run the action on all identified targets. This is the default.
// - COUNT(n) - Run the action on the specified number of targets, chosen from
// the identified targets at random. For example, COUNT(1) selects one of the
// targets.
// - PERCENT(n) - Run the action on the specified percentage of targets, chosen
// from the identified targets at random. For example, PERCENT(25) selects 25% of
// the targets.
//
// This member is required.
SelectionMode *string
// The filters to apply to identify target resources using specific attributes.
Filters []ExperimentTemplateTargetInputFilter
// The resource type parameters.
Parameters map[string]string
// The Amazon Resource Names (ARNs) of the resources.
ResourceArns []string
// The tags for the target resources.
ResourceTags map[string]string
noSmithyDocumentSerde
}
// Describes an experiment.
type Experiment struct {
// The actions for the experiment.
Actions map[string]ExperimentAction
// The time that the experiment was created.
CreationTime *time.Time
// The time that the experiment ended.
EndTime *time.Time
// The ID of the experiment template.
ExperimentTemplateId *string
// The ID of the experiment.
Id *string
// The configuration for experiment logging.
LogConfiguration *ExperimentLogConfiguration
// The Amazon Resource Name (ARN) of an IAM role that grants the FIS service
// permission to perform service actions on your behalf.
RoleArn *string
// The time that the experiment started.
StartTime *time.Time
// The state of the experiment.
State *ExperimentState
// The stop conditions for the experiment.
StopConditions []ExperimentStopCondition
// The tags for the experiment.
Tags map[string]string
// The targets for the experiment.
Targets map[string]ExperimentTarget
noSmithyDocumentSerde
}
// Describes the action for an experiment.
type ExperimentAction struct {
// The ID of the action.
ActionId *string
// The description for the action.
Description *string
// The time that the action ended.
EndTime *time.Time
// The parameters for the action.
Parameters map[string]string
// The name of the action that must be completed before this action starts.
StartAfter []string
// The time that the action started.
StartTime *time.Time
// The state of the action.
State *ExperimentActionState
// The targets for the action.
Targets map[string]string
noSmithyDocumentSerde
}
// Describes the state of an action.
type ExperimentActionState struct {
// The reason for the state.
Reason *string
// The state of the action.
Status ExperimentActionStatus
noSmithyDocumentSerde
}
// Describes the configuration for experiment logging to Amazon CloudWatch Logs.
type ExperimentCloudWatchLogsLogConfiguration struct {
// The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs log
// group.
LogGroupArn *string
noSmithyDocumentSerde
}
// Describes the configuration for experiment logging.
type ExperimentLogConfiguration struct {
// The configuration for experiment logging to Amazon CloudWatch Logs.
CloudWatchLogsConfiguration *ExperimentCloudWatchLogsLogConfiguration
// The schema version.
LogSchemaVersion *int32
// The configuration for experiment logging to Amazon S3.
S3Configuration *ExperimentS3LogConfiguration
noSmithyDocumentSerde
}
// Describes the configuration for experiment logging to Amazon S3.
type ExperimentS3LogConfiguration struct {
// The name of the destination bucket.
BucketName *string
// The bucket prefix.
Prefix *string
noSmithyDocumentSerde
}
// Describes the state of an experiment.
type ExperimentState struct {
// The reason for the state.
Reason *string
// The state of the experiment.
Status ExperimentStatus
noSmithyDocumentSerde
}
// Describes the stop condition for an experiment.
type ExperimentStopCondition struct {
// The source for the stop condition.
Source *string
// The Amazon Resource Name (ARN) of the CloudWatch alarm, if applicable.
Value *string
noSmithyDocumentSerde
}
// Provides a summary of an experiment.
type ExperimentSummary struct {
// The time that the experiment was created.
CreationTime *time.Time
// The ID of the experiment template.
ExperimentTemplateId *string
// The ID of the experiment.
Id *string
// The state of the experiment.
State *ExperimentState
// The tags for the experiment.
Tags map[string]string
noSmithyDocumentSerde
}
// Describes a target for an experiment.
type ExperimentTarget struct {
// The filters to apply to identify target resources using specific attributes.
Filters []ExperimentTargetFilter
// The resource type parameters.
Parameters map[string]string
// The Amazon Resource Names (ARNs) of the resources.
ResourceArns []string
// The tags for the target resources.
ResourceTags map[string]string
// The resource type.
ResourceType *string
// Scopes the identified resources to a specific count or percentage.
SelectionMode *string
noSmithyDocumentSerde
}
// Describes a filter used for the target resources in an experiment.
type ExperimentTargetFilter struct {
// The attribute path for the filter.
Path *string
// The attribute values for the filter.
Values []string
noSmithyDocumentSerde
}
// Describes an experiment template.
type ExperimentTemplate struct {
// The actions for the experiment.
Actions map[string]ExperimentTemplateAction
// The time the experiment template was created.
CreationTime *time.Time
// The description for the experiment template.
Description *string
// The ID of the experiment template.
Id *string
// The time the experiment template was last updated.
LastUpdateTime *time.Time
// The configuration for experiment logging.
LogConfiguration *ExperimentTemplateLogConfiguration
// The Amazon Resource Name (ARN) of an IAM role.
RoleArn *string
// The stop conditions for the experiment.
StopConditions []ExperimentTemplateStopCondition
// The tags for the experiment template.
Tags map[string]string
// The targets for the experiment.
Targets map[string]ExperimentTemplateTarget
noSmithyDocumentSerde
}
// Describes an action for an experiment template.
type ExperimentTemplateAction struct {
// The ID of the action.
ActionId *string
// A description for the action.
Description *string
// The parameters for the action.
Parameters map[string]string
// The name of the action that must be completed before the current action starts.
StartAfter []string
// The targets for the action.
Targets map[string]string
noSmithyDocumentSerde
}
// Describes the configuration for experiment logging to Amazon CloudWatch Logs.
type ExperimentTemplateCloudWatchLogsLogConfiguration struct {
// The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs log
// group.
LogGroupArn *string
noSmithyDocumentSerde
}
// Specifies the configuration for experiment logging to Amazon CloudWatch Logs.
type ExperimentTemplateCloudWatchLogsLogConfigurationInput struct {
// The Amazon Resource Name (ARN) of the destination Amazon CloudWatch Logs log
// group.
//
// This member is required.
LogGroupArn *string
noSmithyDocumentSerde
}
// Describes the configuration for experiment logging.
type ExperimentTemplateLogConfiguration struct {
// The configuration for experiment logging to Amazon CloudWatch Logs.
CloudWatchLogsConfiguration *ExperimentTemplateCloudWatchLogsLogConfiguration
// The schema version.
LogSchemaVersion *int32
// The configuration for experiment logging to Amazon S3.
S3Configuration *ExperimentTemplateS3LogConfiguration
noSmithyDocumentSerde
}
// Describes the configuration for experiment logging to Amazon S3.
type ExperimentTemplateS3LogConfiguration struct {
// The name of the destination bucket.
BucketName *string
// The bucket prefix.
Prefix *string
noSmithyDocumentSerde
}
// Specifies the configuration for experiment logging to Amazon S3.
type ExperimentTemplateS3LogConfigurationInput struct {
// The name of the destination bucket.
//
// This member is required.
BucketName *string
// The bucket prefix.
Prefix *string
noSmithyDocumentSerde
}
// Describes a stop condition for an experiment template.
type ExperimentTemplateStopCondition struct {
// The source for the stop condition.
Source *string
// The Amazon Resource Name (ARN) of the CloudWatch alarm, if applicable.
Value *string
noSmithyDocumentSerde
}
// Provides a summary of an experiment template.
type ExperimentTemplateSummary struct {
// The time that the experiment template was created.
CreationTime *time.Time
// The description of the experiment template.
Description *string
// The ID of the experiment template.
Id *string
// The time that the experiment template was last updated.
LastUpdateTime *time.Time
// The tags for the experiment template.
Tags map[string]string
noSmithyDocumentSerde
}
// Describes a target for an experiment template.
type ExperimentTemplateTarget struct {
// The filters to apply to identify target resources using specific attributes.
Filters []ExperimentTemplateTargetFilter
// The resource type parameters.
Parameters map[string]string
// The Amazon Resource Names (ARNs) of the targets.
ResourceArns []string
// The tags for the target resources.
ResourceTags map[string]string
// The resource type.
ResourceType *string
// Scopes the identified resources to a specific count or percentage.
SelectionMode *string
noSmithyDocumentSerde
}
// Describes a filter used for the target resources in an experiment template.
type ExperimentTemplateTargetFilter struct {
// The attribute path for the filter.
Path *string
// The attribute values for the filter.
Values []string
noSmithyDocumentSerde
}
// Specifies a filter used for the target resource input in an experiment
// template. For more information, see Resource filters (https://docs.aws.amazon.com/fis/latest/userguide/targets.html#target-filters)
// in the Fault Injection Simulator User Guide.
type ExperimentTemplateTargetInputFilter struct {
// The attribute path for the filter.
//
// This member is required.
Path *string
// The attribute values for the filter.
//
// This member is required.
Values []string
noSmithyDocumentSerde
}
// Describes a resource type.
type TargetResourceType struct {
// A description of the resource type.
Description *string
// The parameters for the resource type.
Parameters map[string]TargetResourceTypeParameter
// The resource type.
ResourceType *string
noSmithyDocumentSerde
}
// Describes the parameters for a resource type. Use parameters to determine which
// tasks are identified during target resolution.
type TargetResourceTypeParameter struct {
// A description of the parameter.
Description *string
// Indicates whether the parameter is required.
Required *bool
noSmithyDocumentSerde
}
// Describes a resource type.
type TargetResourceTypeSummary struct {
// A description of the resource type.
Description *string
// The resource type.
ResourceType *string
noSmithyDocumentSerde
}
// Specifies an action for an experiment template.
type UpdateExperimentTemplateActionInputItem struct {
// The ID of the action.
ActionId *string
// A description for the action.
Description *string
// The parameters for the action, if applicable.
Parameters map[string]string
// The name of the action that must be completed before the current action starts.
// Omit this parameter to run the action at the start of the experiment.
StartAfter []string
// The targets for the action.
Targets map[string]string
noSmithyDocumentSerde
}
// Specifies the configuration for experiment logging.
type UpdateExperimentTemplateLogConfigurationInput struct {
// The configuration for experiment logging to Amazon CloudWatch Logs.
CloudWatchLogsConfiguration *ExperimentTemplateCloudWatchLogsLogConfigurationInput
// The schema version.
LogSchemaVersion *int32
// The configuration for experiment logging to Amazon S3.
S3Configuration *ExperimentTemplateS3LogConfigurationInput
noSmithyDocumentSerde
}
// Specifies a stop condition for an experiment. You can define a stop condition
// as a CloudWatch alarm.
type UpdateExperimentTemplateStopConditionInput struct {
// The source for the stop condition. Specify aws:cloudwatch:alarm if the stop
// condition is defined by a CloudWatch alarm. Specify none if there is no stop
// condition.
//
// This member is required.
Source *string
// The Amazon Resource Name (ARN) of the CloudWatch alarm.
Value *string
noSmithyDocumentSerde
}
// Specifies a target for an experiment. You must specify at least one Amazon
// Resource Name (ARN) or at least one resource tag. You cannot specify both.
type UpdateExperimentTemplateTargetInput struct {
// The resource type. The resource type must be supported for the specified action.
//
// This member is required.
ResourceType *string
// Scopes the identified resources to a specific count or percentage.
//
// This member is required.
SelectionMode *string
// The filters to apply to identify target resources using specific attributes.
Filters []ExperimentTemplateTargetInputFilter
// The resource type parameters.
Parameters map[string]string
// The Amazon Resource Names (ARNs) of the targets.
ResourceArns []string
// The tags for the target resources.
ResourceTags map[string]string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 706 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fms
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 = "FMS"
const ServiceAPIVersion = "2018-01-01"
// Client provides the API client to make operations call for Firewall Management
// Service.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "fms", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 435 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fms
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 fms
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"
)
// Sets a Firewall Manager default administrator account. The Firewall Manager
// default administrator account can manage third-party firewalls and has full
// administrative scope that allows administration of all policy types, accounts,
// organizational units, and Regions. This account must be a member account of the
// organization in Organizations whose resources you want to protect. For
// information about working with Firewall Manager administrator accounts, see
// Managing Firewall Manager administrators (https://docs.aws.amazon.com/organizations/latest/userguide/fms-administrators.html)
// in the Firewall Manager Developer Guide.
func (c *Client) AssociateAdminAccount(ctx context.Context, params *AssociateAdminAccountInput, optFns ...func(*Options)) (*AssociateAdminAccountOutput, error) {
if params == nil {
params = &AssociateAdminAccountInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateAdminAccount", params, optFns, c.addOperationAssociateAdminAccountMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateAdminAccountOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateAdminAccountInput struct {
// The Amazon Web Services account ID to associate with Firewall Manager as the
// Firewall Manager default administrator account. This account must be a member
// account of the organization in Organizations whose resources you want to
// protect. For more information about Organizations, see Managing the Amazon Web
// Services Accounts in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts.html)
// .
//
// This member is required.
AdminAccount *string
noSmithyDocumentSerde
}
type AssociateAdminAccountOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateAdminAccountMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateAdminAccount{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateAdminAccount{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateAdminAccountValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateAdminAccount(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAssociateAdminAccount(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fms",
OperationName: "AssociateAdminAccount",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fms
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/fms/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets the Firewall Manager policy administrator as a tenant administrator of a
// third-party firewall service. A tenant is an instance of the third-party
// firewall service that's associated with your Amazon Web Services customer
// account.
func (c *Client) AssociateThirdPartyFirewall(ctx context.Context, params *AssociateThirdPartyFirewallInput, optFns ...func(*Options)) (*AssociateThirdPartyFirewallOutput, error) {
if params == nil {
params = &AssociateThirdPartyFirewallInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateThirdPartyFirewall", params, optFns, c.addOperationAssociateThirdPartyFirewallMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateThirdPartyFirewallOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateThirdPartyFirewallInput struct {
// The name of the third-party firewall vendor.
//
// This member is required.
ThirdPartyFirewall types.ThirdPartyFirewall
noSmithyDocumentSerde
}
type AssociateThirdPartyFirewallOutput struct {
// The current status for setting a Firewall Manager policy administrator's
// account as an administrator of the third-party firewall tenant.
// - ONBOARDING - The Firewall Manager policy administrator is being designated
// as a tenant administrator.
// - ONBOARD_COMPLETE - The Firewall Manager policy administrator is designated
// as a tenant administrator.
// - OFFBOARDING - The Firewall Manager policy administrator is being removed as
// a tenant administrator.
// - OFFBOARD_COMPLETE - The Firewall Manager policy administrator has been
// removed as a tenant administrator.
// - NOT_EXIST - The Firewall Manager policy administrator doesn't exist as a
// tenant administrator.
ThirdPartyFirewallStatus types.ThirdPartyFirewallAssociationStatus
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateThirdPartyFirewallMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateThirdPartyFirewall{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateThirdPartyFirewall{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateThirdPartyFirewallValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateThirdPartyFirewall(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAssociateThirdPartyFirewall(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fms",
OperationName: "AssociateThirdPartyFirewall",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fms
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/fms/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associate resources to a Firewall Manager resource set.
func (c *Client) BatchAssociateResource(ctx context.Context, params *BatchAssociateResourceInput, optFns ...func(*Options)) (*BatchAssociateResourceOutput, error) {
if params == nil {
params = &BatchAssociateResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchAssociateResource", params, optFns, c.addOperationBatchAssociateResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchAssociateResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchAssociateResourceInput struct {
// The uniform resource identifiers (URIs) of resources that should be associated
// to the resource set. The URIs must be Amazon Resource Names (ARNs).
//
// This member is required.
Items []string
// A unique identifier for the resource set, used in a request to refer to the
// resource set.
//
// This member is required.
ResourceSetIdentifier *string
noSmithyDocumentSerde
}
type BatchAssociateResourceOutput struct {
// The resources that failed to associate to the resource set.
//
// This member is required.
FailedItems []types.FailedItem
// A unique identifier for the resource set, used in a request to refer to the
// resource set.
//
// This member is required.
ResourceSetIdentifier *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchAssociateResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchAssociateResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchAssociateResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBatchAssociateResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchAssociateResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opBatchAssociateResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fms",
OperationName: "BatchAssociateResource",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fms
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/fms/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disassociates resources from a Firewall Manager resource set.
func (c *Client) BatchDisassociateResource(ctx context.Context, params *BatchDisassociateResourceInput, optFns ...func(*Options)) (*BatchDisassociateResourceOutput, error) {
if params == nil {
params = &BatchDisassociateResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchDisassociateResource", params, optFns, c.addOperationBatchDisassociateResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchDisassociateResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchDisassociateResourceInput struct {
// The uniform resource identifiers (URI) of resources that should be
// disassociated from the resource set. The URIs must be Amazon Resource Names
// (ARNs).
//
// This member is required.
Items []string
// A unique identifier for the resource set, used in a request to refer to the
// resource set.
//
// This member is required.
ResourceSetIdentifier *string
noSmithyDocumentSerde
}
type BatchDisassociateResourceOutput struct {
// The resources that failed to disassociate from the resource set.
//
// This member is required.
FailedItems []types.FailedItem
// A unique identifier for the resource set, used in a request to refer to the
// resource set.
//
// This member is required.
ResourceSetIdentifier *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchDisassociateResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDisassociateResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDisassociateResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBatchDisassociateResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDisassociateResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opBatchDisassociateResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fms",
OperationName: "BatchDisassociateResource",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fms
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"
)
// Permanently deletes an Firewall Manager applications list.
func (c *Client) DeleteAppsList(ctx context.Context, params *DeleteAppsListInput, optFns ...func(*Options)) (*DeleteAppsListOutput, error) {
if params == nil {
params = &DeleteAppsListInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAppsList", params, optFns, c.addOperationDeleteAppsListMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAppsListOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAppsListInput struct {
// The ID of the applications list that you want to delete. You can retrieve this
// ID from PutAppsList , ListAppsLists , and GetAppsList .
//
// This member is required.
ListId *string
noSmithyDocumentSerde
}
type DeleteAppsListOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAppsListMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAppsList{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAppsList{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteAppsListValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAppsList(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteAppsList(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fms",
OperationName: "DeleteAppsList",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fms
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes an Firewall Manager association with the IAM role and the Amazon Simple
// Notification Service (SNS) topic that is used to record Firewall Manager SNS
// logs.
func (c *Client) DeleteNotificationChannel(ctx context.Context, params *DeleteNotificationChannelInput, optFns ...func(*Options)) (*DeleteNotificationChannelOutput, error) {
if params == nil {
params = &DeleteNotificationChannelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteNotificationChannel", params, optFns, c.addOperationDeleteNotificationChannelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteNotificationChannelOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteNotificationChannelInput struct {
noSmithyDocumentSerde
}
type DeleteNotificationChannelOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteNotificationChannelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteNotificationChannel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteNotificationChannel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDeleteNotificationChannel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteNotificationChannel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fms",
OperationName: "DeleteNotificationChannel",
}
}
| 113 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package fms
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"
)
// Permanently deletes an Firewall Manager policy.
func (c *Client) DeletePolicy(ctx context.Context, params *DeletePolicyInput, optFns ...func(*Options)) (*DeletePolicyOutput, error) {
if params == nil {
params = &DeletePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeletePolicy", params, optFns, c.addOperationDeletePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeletePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeletePolicyInput struct {
// The ID of the policy that you want to delete. You can retrieve this ID from
// PutPolicy and ListPolicies .
//
// This member is required.
PolicyId *string
// If True , the request performs cleanup according to the policy type. For WAF and
// Shield Advanced policies, the cleanup does the following:
// - Deletes rule groups created by Firewall Manager
// - Removes web ACLs from in-scope resources
// - Deletes web ACLs that contain no rules or rule groups
// For security group policies, the cleanup does the following for each security
// group in the policy:
// - Disassociates the security group from in-scope resources
// - Deletes the security group if it was created through Firewall Manager and
// if it's no longer associated with any resources through another policy
// After the cleanup, in-scope resources are no longer protected by web ACLs in
// this policy. Protection of out-of-scope resources remains unchanged. Scope is
// determined by tags that you create and accounts that you associate with the
// policy. When creating the policy, if you specify that only resources in specific
// accounts or with specific tags are in scope of the policy, those accounts and
// resources are handled by the policy. All others are out of scope. If you don't
// specify tags or accounts, all resources are in scope.
DeleteAllPolicyResources bool
noSmithyDocumentSerde
}
type DeletePolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeletePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeletePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeletePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "fms",
OperationName: "DeletePolicy",
}
}
| 140 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.