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 kinesis
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 = "Kinesis"
const ServiceAPIVersion = "2013-12-02"
// Client provides the API client to make operations call for Amazon Kinesis.
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)
}
setSafeEventStreamClientLogMode(&options, opID)
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, "kinesis", 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)
}
| 436 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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 kinesis
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds or updates tags for the specified Kinesis data stream. You can assign up
// to 50 tags to a data stream. When invoking this API, it is recommended you use
// the StreamARN input parameter rather than the StreamName input parameter. If
// tags have already been assigned to the stream, AddTagsToStream overwrites any
// existing tags that correspond to the specified tag keys. AddTagsToStream has a
// limit of five transactions per second per account.
func (c *Client) AddTagsToStream(ctx context.Context, params *AddTagsToStreamInput, optFns ...func(*Options)) (*AddTagsToStreamOutput, error) {
if params == nil {
params = &AddTagsToStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddTagsToStream", params, optFns, c.addOperationAddTagsToStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddTagsToStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for AddTagsToStream .
type AddTagsToStreamInput struct {
// A set of up to 10 key-value pairs to use to create the tags.
//
// This member is required.
Tags map[string]string
// The ARN of the stream.
StreamARN *string
// The name of the stream.
StreamName *string
noSmithyDocumentSerde
}
type AddTagsToStreamOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddTagsToStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddTagsToStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddTagsToStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddTagsToStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTagsToStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddTagsToStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "AddTagsToStream",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a Kinesis data stream. A stream captures and transports data records
// that are continuously emitted from different data sources or producers.
// Scale-out within a stream is explicitly supported by means of shards, which are
// uniquely identified groups of data records in a stream. You can create your data
// stream using either on-demand or provisioned capacity mode. Data streams with an
// on-demand mode require no capacity planning and automatically scale to handle
// gigabytes of write and read throughput per minute. With the on-demand mode,
// Kinesis Data Streams automatically manages the shards in order to provide the
// necessary throughput. For the data streams with a provisioned mode, you must
// specify the number of shards for the data stream. Each shard can support reads
// up to five transactions per second, up to a maximum data read total of 2 MiB per
// second. Each shard can support writes up to 1,000 records per second, up to a
// maximum data write total of 1 MiB per second. If the amount of data input
// increases or decreases, you can add or remove shards. The stream name identifies
// the stream. The name is scoped to the Amazon Web Services account used by the
// application. It is also scoped by Amazon Web Services Region. That is, two
// streams in two different accounts can have the same name, and two streams in the
// same account, but in two different Regions, can have the same name. CreateStream
// is an asynchronous operation. Upon receiving a CreateStream request, Kinesis
// Data Streams immediately returns and sets the stream status to CREATING . After
// the stream is created, Kinesis Data Streams sets the stream status to ACTIVE .
// You should perform read and write operations only on an ACTIVE stream. You
// receive a LimitExceededException when making a CreateStream request when you
// try to do one of the following:
// - Have more than five streams in the CREATING state at any point in time.
// - Create more shards than are authorized for your account.
//
// For the default shard limit for an Amazon Web Services account, see Amazon
// Kinesis Data Streams Limits (https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html)
// in the Amazon Kinesis Data Streams Developer Guide. To increase this limit,
// contact Amazon Web Services Support (https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)
// . You can use DescribeStreamSummary to check the stream status, which is
// returned in StreamStatus . CreateStream has a limit of five transactions per
// second per account.
func (c *Client) CreateStream(ctx context.Context, params *CreateStreamInput, optFns ...func(*Options)) (*CreateStreamOutput, error) {
if params == nil {
params = &CreateStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateStream", params, optFns, c.addOperationCreateStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for CreateStream .
type CreateStreamInput struct {
// A name to identify the stream. The stream name is scoped to the Amazon Web
// Services account used by the application that creates the stream. It is also
// scoped by Amazon Web Services Region. That is, two streams in two different
// Amazon Web Services accounts can have the same name. Two streams in the same
// Amazon Web Services account but in two different Regions can also have the same
// name.
//
// This member is required.
StreamName *string
// The number of shards that the stream will use. The throughput of the stream is
// a function of the number of shards; more shards are required for greater
// provisioned throughput.
ShardCount *int32
// Indicates the capacity mode of the data stream. Currently, in Kinesis Data
// Streams, you can choose between an on-demand capacity mode and a provisioned
// capacity mode for your data streams.
StreamModeDetails *types.StreamModeDetails
noSmithyDocumentSerde
}
type CreateStreamOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "CreateStream",
}
}
| 170 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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"
)
// Decreases the Kinesis data stream's retention period, which is the length of
// time data records are accessible after they are added to the stream. The minimum
// value of a stream's retention period is 24 hours. When invoking this API, it is
// recommended you use the StreamARN input parameter rather than the StreamName
// input parameter. This operation may result in lost data. For example, if the
// stream's retention period is 48 hours and is decreased to 24 hours, any data
// already in the stream that is older than 24 hours is inaccessible.
func (c *Client) DecreaseStreamRetentionPeriod(ctx context.Context, params *DecreaseStreamRetentionPeriodInput, optFns ...func(*Options)) (*DecreaseStreamRetentionPeriodOutput, error) {
if params == nil {
params = &DecreaseStreamRetentionPeriodInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DecreaseStreamRetentionPeriod", params, optFns, c.addOperationDecreaseStreamRetentionPeriodMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DecreaseStreamRetentionPeriodOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for DecreaseStreamRetentionPeriod .
type DecreaseStreamRetentionPeriodInput struct {
// The new retention period of the stream, in hours. Must be less than the current
// retention period.
//
// This member is required.
RetentionPeriodHours *int32
// The ARN of the stream.
StreamARN *string
// The name of the stream to modify.
StreamName *string
noSmithyDocumentSerde
}
type DecreaseStreamRetentionPeriodOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDecreaseStreamRetentionPeriodMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDecreaseStreamRetentionPeriod{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDecreaseStreamRetentionPeriod{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDecreaseStreamRetentionPeriodValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDecreaseStreamRetentionPeriod(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDecreaseStreamRetentionPeriod(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "DecreaseStreamRetentionPeriod",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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 Kinesis data stream and all its shards and data. You must shut down
// any applications that are operating on the stream before you delete the stream.
// If an application attempts to operate on a deleted stream, it receives the
// exception ResourceNotFoundException . When invoking this API, it is recommended
// you use the StreamARN input parameter rather than the StreamName input
// parameter. If the stream is in the ACTIVE state, you can delete it. After a
// DeleteStream request, the specified stream is in the DELETING state until
// Kinesis Data Streams completes the deletion. Note: Kinesis Data Streams might
// continue to accept data read and write operations, such as PutRecord ,
// PutRecords , and GetRecords , on a stream in the DELETING state until the
// stream deletion is complete. When you delete a stream, any shards in that stream
// are also deleted, and any tags are dissociated from the stream. You can use the
// DescribeStreamSummary operation to check the state of the stream, which is
// returned in StreamStatus . DeleteStream has a limit of five transactions per
// second per account.
func (c *Client) DeleteStream(ctx context.Context, params *DeleteStreamInput, optFns ...func(*Options)) (*DeleteStreamOutput, error) {
if params == nil {
params = &DeleteStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteStream", params, optFns, c.addOperationDeleteStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for DeleteStream .
type DeleteStreamInput struct {
// If this parameter is unset ( null ) or if you set it to false , and the stream
// has registered consumers, the call to DeleteStream fails with a
// ResourceInUseException .
EnforceConsumerDeletion *bool
// The ARN of the stream.
StreamARN *string
// The name of the stream to delete.
StreamName *string
noSmithyDocumentSerde
}
type DeleteStreamOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDeleteStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "DeleteStream",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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"
)
// To deregister a consumer, provide its ARN. Alternatively, you can provide the
// ARN of the data stream and the name you gave the consumer when you registered
// it. You may also provide all three parameters, as long as they don't conflict
// with each other. If you don't know the name or ARN of the consumer that you want
// to deregister, you can use the ListStreamConsumers operation to get a list of
// the descriptions of all the consumers that are currently registered with a given
// data stream. The description of a consumer contains its name and ARN. This
// operation has a limit of five transactions per second per stream.
func (c *Client) DeregisterStreamConsumer(ctx context.Context, params *DeregisterStreamConsumerInput, optFns ...func(*Options)) (*DeregisterStreamConsumerOutput, error) {
if params == nil {
params = &DeregisterStreamConsumerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeregisterStreamConsumer", params, optFns, c.addOperationDeregisterStreamConsumerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeregisterStreamConsumerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeregisterStreamConsumerInput struct {
// The ARN returned by Kinesis Data Streams when you registered the consumer. If
// you don't know the ARN of the consumer that you want to deregister, you can use
// the ListStreamConsumers operation to get a list of the descriptions of all the
// consumers that are currently registered with a given data stream. The
// description of a consumer contains its ARN.
ConsumerARN *string
// The name that you gave to the consumer.
ConsumerName *string
// The ARN of the Kinesis data stream that the consumer is registered with. 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#arn-syntax-kinesis-streams)
// .
StreamARN *string
noSmithyDocumentSerde
}
type DeregisterStreamConsumerOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeregisterStreamConsumerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterStreamConsumer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterStreamConsumer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDeregisterStreamConsumer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeregisterStreamConsumer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "DeregisterStreamConsumer",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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"
)
// Describes the shard limits and usage for the account. If you update your
// account limits, the old limits might be returned for a few minutes. This
// operation has a limit of one transaction per second per account.
func (c *Client) DescribeLimits(ctx context.Context, params *DescribeLimitsInput, optFns ...func(*Options)) (*DescribeLimitsOutput, error) {
if params == nil {
params = &DescribeLimitsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeLimits", params, optFns, c.addOperationDescribeLimitsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeLimitsOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeLimitsInput struct {
noSmithyDocumentSerde
}
type DescribeLimitsOutput struct {
// Indicates the number of data streams with the on-demand capacity mode.
//
// This member is required.
OnDemandStreamCount *int32
// The maximum number of data streams with the on-demand capacity mode.
//
// This member is required.
OnDemandStreamCountLimit *int32
// The number of open shards.
//
// This member is required.
OpenShardCount *int32
// The maximum number of shards.
//
// This member is required.
ShardLimit *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeLimitsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeLimits{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeLimits{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeLimits(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeLimits(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "DescribeLimits",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
import (
"context"
"errors"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
smithywaiter "github.com/aws/smithy-go/waiter"
"github.com/jmespath/go-jmespath"
"time"
)
// Describes the specified Kinesis data stream. This API has been revised. It's
// highly recommended that you use the DescribeStreamSummary API to get a
// summarized description of the specified Kinesis data stream and the ListShards
// API to list the shards in a specified data stream and obtain information about
// each shard. When invoking this API, it is recommended you use the StreamARN
// input parameter rather than the StreamName input parameter. The information
// returned includes the stream name, Amazon Resource Name (ARN), creation time,
// enhanced metric configuration, and shard map. The shard map is an array of shard
// objects. For each shard object, there is the hash key and sequence number ranges
// that the shard spans, and the IDs of any earlier shards that played in a role in
// creating the shard. Every record ingested in the stream is identified by a
// sequence number, which is assigned when the record is put into the stream. You
// can limit the number of shards returned by each call. For more information, see
// Retrieving Shards from a Stream (https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-retrieve-shards.html)
// in the Amazon Kinesis Data Streams Developer Guide. There are no guarantees
// about the chronological order shards returned. To process shards in
// chronological order, use the ID of the parent shard to track the lineage to the
// oldest shard. This operation has a limit of 10 transactions per second per
// account.
func (c *Client) DescribeStream(ctx context.Context, params *DescribeStreamInput, optFns ...func(*Options)) (*DescribeStreamOutput, error) {
if params == nil {
params = &DescribeStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStream", params, optFns, c.addOperationDescribeStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for DescribeStream .
type DescribeStreamInput struct {
// The shard ID of the shard to start with. Specify this parameter to indicate
// that you want to describe the stream starting with the shard whose ID
// immediately follows ExclusiveStartShardId . If you don't specify this parameter,
// the default behavior for DescribeStream is to describe the stream starting with
// the first shard in the stream.
ExclusiveStartShardId *string
// The maximum number of shards to return in a single call. The default value is
// 100. If you specify a value greater than 100, at most 100 results are returned.
Limit *int32
// The ARN of the stream.
StreamARN *string
// The name of the stream to describe.
StreamName *string
noSmithyDocumentSerde
}
// Represents the output for DescribeStream .
type DescribeStreamOutput struct {
// The current status of the stream, the stream Amazon Resource Name (ARN), an
// array of shard objects that comprise the stream, and whether there are more
// shards available.
//
// This member is required.
StreamDescription *types.StreamDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeStreamAPIClient is a client that implements the DescribeStream
// operation.
type DescribeStreamAPIClient interface {
DescribeStream(context.Context, *DescribeStreamInput, ...func(*Options)) (*DescribeStreamOutput, error)
}
var _ DescribeStreamAPIClient = (*Client)(nil)
// StreamExistsWaiterOptions are waiter options for StreamExistsWaiter
type StreamExistsWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// StreamExistsWaiter will use default minimum delay of 10 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, StreamExistsWaiter will use default max delay of 120 seconds. Note
// that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeStreamInput, *DescribeStreamOutput, error) (bool, error)
}
// StreamExistsWaiter defines the waiters for StreamExists
type StreamExistsWaiter struct {
client DescribeStreamAPIClient
options StreamExistsWaiterOptions
}
// NewStreamExistsWaiter constructs a StreamExistsWaiter.
func NewStreamExistsWaiter(client DescribeStreamAPIClient, optFns ...func(*StreamExistsWaiterOptions)) *StreamExistsWaiter {
options := StreamExistsWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = streamExistsStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &StreamExistsWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for StreamExists waiter. The maxWaitDur is the
// maximum wait duration the waiter will wait. The maxWaitDur is required and must
// be greater than zero.
func (w *StreamExistsWaiter) Wait(ctx context.Context, params *DescribeStreamInput, maxWaitDur time.Duration, optFns ...func(*StreamExistsWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for StreamExists waiter and returns the
// output of the successful operation. The maxWaitDur is the maximum wait duration
// the waiter will wait. The maxWaitDur is required and must be greater than zero.
func (w *StreamExistsWaiter) WaitForOutput(ctx context.Context, params *DescribeStreamInput, maxWaitDur time.Duration, optFns ...func(*StreamExistsWaiterOptions)) (*DescribeStreamOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeStream(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for StreamExists waiter")
}
func streamExistsStateRetryable(ctx context.Context, input *DescribeStreamInput, output *DescribeStreamOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("StreamDescription.StreamStatus", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "ACTIVE"
value, ok := pathValue.(types.StreamStatus)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.StreamStatus value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
return true, nil
}
// StreamNotExistsWaiterOptions are waiter options for StreamNotExistsWaiter
type StreamNotExistsWaiterOptions struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// MinDelay is the minimum amount of time to delay between retries. If unset,
// StreamNotExistsWaiter will use default minimum delay of 10 seconds. Note that
// MinDelay must resolve to a value lesser than or equal to the MaxDelay.
MinDelay time.Duration
// MaxDelay is the maximum amount of time to delay between retries. If unset or
// set to zero, StreamNotExistsWaiter will use default max delay of 120 seconds.
// Note that MaxDelay must resolve to value greater than or equal to the MinDelay.
MaxDelay time.Duration
// LogWaitAttempts is used to enable logging for waiter retry attempts
LogWaitAttempts bool
// Retryable is function that can be used to override the service defined
// waiter-behavior based on operation output, or returned error. This function is
// used by the waiter to decide if a state is retryable or a terminal state. By
// default service-modeled logic will populate this option. This option can thus be
// used to define a custom waiter state with fall-back to service-modeled waiter
// state mutators.The function returns an error in case of a failure state. In case
// of retry state, this function returns a bool value of true and nil error, while
// in case of success it returns a bool value of false and nil error.
Retryable func(context.Context, *DescribeStreamInput, *DescribeStreamOutput, error) (bool, error)
}
// StreamNotExistsWaiter defines the waiters for StreamNotExists
type StreamNotExistsWaiter struct {
client DescribeStreamAPIClient
options StreamNotExistsWaiterOptions
}
// NewStreamNotExistsWaiter constructs a StreamNotExistsWaiter.
func NewStreamNotExistsWaiter(client DescribeStreamAPIClient, optFns ...func(*StreamNotExistsWaiterOptions)) *StreamNotExistsWaiter {
options := StreamNotExistsWaiterOptions{}
options.MinDelay = 10 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = streamNotExistsStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &StreamNotExistsWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for StreamNotExists waiter. The maxWaitDur is
// the maximum wait duration the waiter will wait. The maxWaitDur is required and
// must be greater than zero.
func (w *StreamNotExistsWaiter) Wait(ctx context.Context, params *DescribeStreamInput, maxWaitDur time.Duration, optFns ...func(*StreamNotExistsWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for StreamNotExists waiter and returns
// the output of the successful operation. The maxWaitDur is the maximum wait
// duration the waiter will wait. The maxWaitDur is required and must be greater
// than zero.
func (w *StreamNotExistsWaiter) WaitForOutput(ctx context.Context, params *DescribeStreamInput, maxWaitDur time.Duration, optFns ...func(*StreamNotExistsWaiterOptions)) (*DescribeStreamOutput, error) {
if maxWaitDur <= 0 {
return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero")
}
options := w.options
for _, fn := range optFns {
fn(&options)
}
if options.MaxDelay <= 0 {
options.MaxDelay = 120 * time.Second
}
if options.MinDelay > options.MaxDelay {
return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay)
}
ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur)
defer cancelFn()
logger := smithywaiter.Logger{}
remainingTime := maxWaitDur
var attempt int64
for {
attempt++
apiOptions := options.APIOptions
start := time.Now()
if options.LogWaitAttempts {
logger.Attempt = attempt
apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...)
apiOptions = append(apiOptions, logger.AddLogger)
}
out, err := w.client.DescribeStream(ctx, params, func(o *Options) {
o.APIOptions = append(o.APIOptions, apiOptions...)
})
retryable, err := options.Retryable(ctx, params, out, err)
if err != nil {
return nil, err
}
if !retryable {
return out, nil
}
remainingTime -= time.Since(start)
if remainingTime < options.MinDelay || remainingTime <= 0 {
break
}
// compute exponential backoff between waiter retries
delay, err := smithywaiter.ComputeDelay(
attempt, options.MinDelay, options.MaxDelay, remainingTime,
)
if err != nil {
return nil, fmt.Errorf("error computing waiter delay, %w", err)
}
remainingTime -= delay
// sleep for the delay amount before invoking a request
if err := smithytime.SleepWithContext(ctx, delay); err != nil {
return nil, fmt.Errorf("request cancelled while waiting, %w", err)
}
}
return nil, fmt.Errorf("exceeded max wait time for StreamNotExists waiter")
}
func streamNotExistsStateRetryable(ctx context.Context, input *DescribeStreamInput, output *DescribeStreamOutput, err error) (bool, error) {
if err != nil {
var errorType *types.ResourceNotFoundException
if errors.As(err, &errorType) {
return false, nil
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribeStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "DescribeStream",
}
}
| 481 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// To get the description of a registered consumer, provide the ARN of the
// consumer. Alternatively, you can provide the ARN of the data stream and the name
// you gave the consumer when you registered it. You may also provide all three
// parameters, as long as they don't conflict with each other. If you don't know
// the name or ARN of the consumer that you want to describe, you can use the
// ListStreamConsumers operation to get a list of the descriptions of all the
// consumers that are currently registered with a given data stream. This operation
// has a limit of 20 transactions per second per stream.
func (c *Client) DescribeStreamConsumer(ctx context.Context, params *DescribeStreamConsumerInput, optFns ...func(*Options)) (*DescribeStreamConsumerOutput, error) {
if params == nil {
params = &DescribeStreamConsumerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStreamConsumer", params, optFns, c.addOperationDescribeStreamConsumerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeStreamConsumerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeStreamConsumerInput struct {
// The ARN returned by Kinesis Data Streams when you registered the consumer.
ConsumerARN *string
// The name that you gave to the consumer.
ConsumerName *string
// The ARN of the Kinesis data stream that the consumer is registered with. 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#arn-syntax-kinesis-streams)
// .
StreamARN *string
noSmithyDocumentSerde
}
type DescribeStreamConsumerOutput struct {
// An object that represents the details of the consumer.
//
// This member is required.
ConsumerDescription *types.ConsumerDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeStreamConsumerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeStreamConsumer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeStreamConsumer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeStreamConsumer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeStreamConsumer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "DescribeStreamConsumer",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a summarized description of the specified Kinesis data stream without
// the shard list. When invoking this API, it is recommended you use the StreamARN
// input parameter rather than the StreamName input parameter. The information
// returned includes the stream name, Amazon Resource Name (ARN), status, record
// retention period, approximate creation time, monitoring, encryption details, and
// open shard count. DescribeStreamSummary has a limit of 20 transactions per
// second per account.
func (c *Client) DescribeStreamSummary(ctx context.Context, params *DescribeStreamSummaryInput, optFns ...func(*Options)) (*DescribeStreamSummaryOutput, error) {
if params == nil {
params = &DescribeStreamSummaryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStreamSummary", params, optFns, c.addOperationDescribeStreamSummaryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeStreamSummaryOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeStreamSummaryInput struct {
// The ARN of the stream.
StreamARN *string
// The name of the stream to describe.
StreamName *string
noSmithyDocumentSerde
}
type DescribeStreamSummaryOutput struct {
// A StreamDescriptionSummary containing information about the stream.
//
// This member is required.
StreamDescriptionSummary *types.StreamDescriptionSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeStreamSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeStreamSummary{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeStreamSummary{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeStreamSummary(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeStreamSummary(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "DescribeStreamSummary",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disables enhanced monitoring. When invoking this API, it is recommended you use
// the StreamARN input parameter rather than the StreamName input parameter.
func (c *Client) DisableEnhancedMonitoring(ctx context.Context, params *DisableEnhancedMonitoringInput, optFns ...func(*Options)) (*DisableEnhancedMonitoringOutput, error) {
if params == nil {
params = &DisableEnhancedMonitoringInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DisableEnhancedMonitoring", params, optFns, c.addOperationDisableEnhancedMonitoringMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DisableEnhancedMonitoringOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for DisableEnhancedMonitoring .
type DisableEnhancedMonitoringInput struct {
// List of shard-level metrics to disable. The following are the valid shard-level
// metrics. The value " ALL " disables every metric.
// - IncomingBytes
// - IncomingRecords
// - OutgoingBytes
// - OutgoingRecords
// - WriteProvisionedThroughputExceeded
// - ReadProvisionedThroughputExceeded
// - IteratorAgeMilliseconds
// - ALL
// For more information, see Monitoring the Amazon Kinesis Data Streams Service
// with Amazon CloudWatch (https://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html)
// in the Amazon Kinesis Data Streams Developer Guide.
//
// This member is required.
ShardLevelMetrics []types.MetricsName
// The ARN of the stream.
StreamARN *string
// The name of the Kinesis data stream for which to disable enhanced monitoring.
StreamName *string
noSmithyDocumentSerde
}
// Represents the output for EnableEnhancedMonitoring and DisableEnhancedMonitoring
// .
type DisableEnhancedMonitoringOutput struct {
// Represents the current state of the metrics that are in the enhanced state
// before the operation.
CurrentShardLevelMetrics []types.MetricsName
// Represents the list of all the metrics that would be in the enhanced state
// after the operation.
DesiredShardLevelMetrics []types.MetricsName
// The ARN of the stream.
StreamARN *string
// The name of the Kinesis data stream.
StreamName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDisableEnhancedMonitoringMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisableEnhancedMonitoring{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisableEnhancedMonitoring{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDisableEnhancedMonitoringValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableEnhancedMonitoring(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDisableEnhancedMonitoring(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "DisableEnhancedMonitoring",
}
}
| 158 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Enables enhanced Kinesis data stream monitoring for shard-level metrics. When
// invoking this API, it is recommended you use the StreamARN input parameter
// rather than the StreamName input parameter.
func (c *Client) EnableEnhancedMonitoring(ctx context.Context, params *EnableEnhancedMonitoringInput, optFns ...func(*Options)) (*EnableEnhancedMonitoringOutput, error) {
if params == nil {
params = &EnableEnhancedMonitoringInput{}
}
result, metadata, err := c.invokeOperation(ctx, "EnableEnhancedMonitoring", params, optFns, c.addOperationEnableEnhancedMonitoringMiddlewares)
if err != nil {
return nil, err
}
out := result.(*EnableEnhancedMonitoringOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for EnableEnhancedMonitoring .
type EnableEnhancedMonitoringInput struct {
// List of shard-level metrics to enable. The following are the valid shard-level
// metrics. The value " ALL " enables every metric.
// - IncomingBytes
// - IncomingRecords
// - OutgoingBytes
// - OutgoingRecords
// - WriteProvisionedThroughputExceeded
// - ReadProvisionedThroughputExceeded
// - IteratorAgeMilliseconds
// - ALL
// For more information, see Monitoring the Amazon Kinesis Data Streams Service
// with Amazon CloudWatch (https://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html)
// in the Amazon Kinesis Data Streams Developer Guide.
//
// This member is required.
ShardLevelMetrics []types.MetricsName
// The ARN of the stream.
StreamARN *string
// The name of the stream for which to enable enhanced monitoring.
StreamName *string
noSmithyDocumentSerde
}
// Represents the output for EnableEnhancedMonitoring and DisableEnhancedMonitoring
// .
type EnableEnhancedMonitoringOutput struct {
// Represents the current state of the metrics that are in the enhanced state
// before the operation.
CurrentShardLevelMetrics []types.MetricsName
// Represents the list of all the metrics that would be in the enhanced state
// after the operation.
DesiredShardLevelMetrics []types.MetricsName
// The ARN of the stream.
StreamARN *string
// The name of the Kinesis data stream.
StreamName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationEnableEnhancedMonitoringMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnableEnhancedMonitoring{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnableEnhancedMonitoring{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpEnableEnhancedMonitoringValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableEnhancedMonitoring(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opEnableEnhancedMonitoring(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "EnableEnhancedMonitoring",
}
}
| 159 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
kinesiscust "github.com/aws/aws-sdk-go-v2/service/kinesis/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets data records from a Kinesis data stream's shard. When invoking this API,
// it is recommended you use the StreamARN input parameter in addition to the
// ShardIterator parameter. Specify a shard iterator using the ShardIterator
// parameter. The shard iterator specifies the position in the shard from which you
// want to start reading data records sequentially. If there are no records
// available in the portion of the shard that the iterator points to, GetRecords
// returns an empty list. It might take multiple calls to get to a portion of the
// shard that contains records. You can scale by provisioning multiple shards per
// stream while considering service limits (for more information, see Amazon
// Kinesis Data Streams Limits (https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html)
// in the Amazon Kinesis Data Streams Developer Guide). Your application should
// have one thread per shard, each reading continuously from its stream. To read
// from a stream continually, call GetRecords in a loop. Use GetShardIterator to
// get the shard iterator to specify in the first GetRecords call. GetRecords
// returns a new shard iterator in NextShardIterator . Specify the shard iterator
// returned in NextShardIterator in subsequent calls to GetRecords . If the shard
// has been closed, the shard iterator can't return more data and GetRecords
// returns null in NextShardIterator . You can terminate the loop when the shard is
// closed, or when the shard iterator reaches the record with the sequence number
// or other attribute that marks it as the last record to process. Each data record
// can be up to 1 MiB in size, and each shard can read up to 2 MiB per second. You
// can ensure that your calls don't exceed the maximum supported size or throughput
// by using the Limit parameter to specify the maximum number of records that
// GetRecords can return. Consider your average record size when determining this
// limit. The maximum number of records that can be returned per call is 10,000.
// The size of the data returned by GetRecords varies depending on the utilization
// of the shard. It is recommended that consumer applications retrieve records via
// the GetRecords command using the 5 TPS limit to remain caught up. Retrieving
// records less frequently can lead to consumer applications falling behind. The
// maximum size of data that GetRecords can return is 10 MiB. If a call returns
// this amount of data, subsequent calls made within the next 5 seconds throw
// ProvisionedThroughputExceededException . If there is insufficient provisioned
// throughput on the stream, subsequent calls made within the next 1 second throw
// ProvisionedThroughputExceededException . GetRecords doesn't return any data
// when it throws an exception. For this reason, we recommend that you wait 1
// second between calls to GetRecords . However, it's possible that the application
// will get exceptions for longer than 1 second. To detect whether the application
// is falling behind in processing, you can use the MillisBehindLatest response
// attribute. You can also monitor the stream using CloudWatch metrics and other
// mechanisms (see Monitoring (https://docs.aws.amazon.com/kinesis/latest/dev/monitoring.html)
// in the Amazon Kinesis Data Streams Developer Guide). Each Amazon Kinesis record
// includes a value, ApproximateArrivalTimestamp , that is set when a stream
// successfully receives and stores a record. This is commonly referred to as a
// server-side time stamp, whereas a client-side time stamp is set when a data
// producer creates or sends the record to a stream (a data producer is any data
// source putting data records into a stream, for example with PutRecords ). The
// time stamp has millisecond precision. There are no guarantees about the time
// stamp accuracy, or that the time stamp is always increasing. For example,
// records in a shard or across a stream might have time stamps that are out of
// order. This operation has a limit of five transactions per second per shard.
func (c *Client) GetRecords(ctx context.Context, params *GetRecordsInput, optFns ...func(*Options)) (*GetRecordsOutput, error) {
if params == nil {
params = &GetRecordsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetRecords", params, optFns, c.addOperationGetRecordsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetRecordsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for GetRecords .
type GetRecordsInput struct {
// The position in the shard from which you want to start sequentially reading
// data records. A shard iterator specifies this position using the sequence number
// of a data record in the shard.
//
// This member is required.
ShardIterator *string
// The maximum number of records to return. Specify a value of up to 10,000. If
// you specify a value that is greater than 10,000, GetRecords throws
// InvalidArgumentException . The default value is 10,000.
Limit *int32
// The ARN of the stream.
StreamARN *string
noSmithyDocumentSerde
}
// Represents the output for GetRecords .
type GetRecordsOutput struct {
// The data records retrieved from the shard.
//
// This member is required.
Records []types.Record
// The list of the current shard's child shards, returned in the GetRecords API's
// response only when the end of the current shard is reached.
ChildShards []types.ChildShard
// The number of milliseconds the GetRecords response is from the tip of the
// stream, indicating how far behind current time the consumer is. A value of zero
// indicates that record processing is caught up, and there are no new records to
// process at this moment.
MillisBehindLatest *int64
// The next position in the shard from which to start sequentially reading data
// records. If set to null , the shard has been closed and the requested iterator
// does not return any more data.
NextShardIterator *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetRecordsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRecords{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRecords{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetRecordsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRecords(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = awshttp.AddResponseReadTimeoutMiddleware(stack, kinesiscust.ReadTimeoutDuration); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetRecords(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "GetRecords",
}
}
| 208 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets an Amazon Kinesis shard iterator. A shard iterator expires 5 minutes after
// it is returned to the requester. When invoking this API, it is recommended you
// use the StreamARN input parameter rather than the StreamName input parameter. A
// shard iterator specifies the shard position from which to start reading data
// records sequentially. The position is specified using the sequence number of a
// data record in a shard. A sequence number is the identifier associated with
// every record ingested in the stream, and is assigned when a record is put into
// the stream. Each stream has one or more shards. You must specify the shard
// iterator type. For example, you can set the ShardIteratorType parameter to read
// exactly from the position denoted by a specific sequence number by using the
// AT_SEQUENCE_NUMBER shard iterator type. Alternatively, the parameter can read
// right after the sequence number by using the AFTER_SEQUENCE_NUMBER shard
// iterator type, using sequence numbers returned by earlier calls to PutRecord ,
// PutRecords , GetRecords , or DescribeStream . In the request, you can specify
// the shard iterator type AT_TIMESTAMP to read records from an arbitrary point in
// time, TRIM_HORIZON to cause ShardIterator to point to the last untrimmed record
// in the shard in the system (the oldest data record in the shard), or LATEST so
// that you always read the most recent data in the shard. When you read repeatedly
// from a stream, use a GetShardIterator request to get the first shard iterator
// for use in your first GetRecords request and for subsequent reads use the shard
// iterator returned by the GetRecords request in NextShardIterator . A new shard
// iterator is returned by every GetRecords request in NextShardIterator , which
// you use in the ShardIterator parameter of the next GetRecords request. If a
// GetShardIterator request is made too often, you receive a
// ProvisionedThroughputExceededException . For more information about throughput
// limits, see GetRecords , and Streams Limits (https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html)
// in the Amazon Kinesis Data Streams Developer Guide. If the shard is closed,
// GetShardIterator returns a valid iterator for the last sequence number of the
// shard. A shard can be closed as a result of using SplitShard or MergeShards .
// GetShardIterator has a limit of five transactions per second per account per
// open shard.
func (c *Client) GetShardIterator(ctx context.Context, params *GetShardIteratorInput, optFns ...func(*Options)) (*GetShardIteratorOutput, error) {
if params == nil {
params = &GetShardIteratorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetShardIterator", params, optFns, c.addOperationGetShardIteratorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetShardIteratorOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for GetShardIterator .
type GetShardIteratorInput struct {
// The shard ID of the Kinesis Data Streams shard to get the iterator for.
//
// This member is required.
ShardId *string
// Determines how the shard iterator is used to start reading data records from
// the shard. The following are the valid Amazon Kinesis shard iterator types:
// - AT_SEQUENCE_NUMBER - Start reading from the position denoted by a specific
// sequence number, provided in the value StartingSequenceNumber .
// - AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a
// specific sequence number, provided in the value StartingSequenceNumber .
// - AT_TIMESTAMP - Start reading from the position denoted by a specific time
// stamp, provided in the value Timestamp .
// - TRIM_HORIZON - Start reading at the last untrimmed record in the shard in
// the system, which is the oldest data record in the shard.
// - LATEST - Start reading just after the most recent record in the shard, so
// that you always read the most recent data in the shard.
//
// This member is required.
ShardIteratorType types.ShardIteratorType
// The sequence number of the data record in the shard from which to start
// reading. Used with shard iterator type AT_SEQUENCE_NUMBER and
// AFTER_SEQUENCE_NUMBER.
StartingSequenceNumber *string
// The ARN of the stream.
StreamARN *string
// The name of the Amazon Kinesis data stream.
StreamName *string
// The time stamp of the data record from which to start reading. Used with shard
// iterator type AT_TIMESTAMP. A time stamp is the Unix epoch date with precision
// in milliseconds. For example, 2016-04-04T19:58:46.480-00:00 or 1459799926.480 .
// If a record with this exact time stamp does not exist, the iterator returned is
// for the next (later) record. If the time stamp is older than the current trim
// horizon, the iterator returned is for the oldest untrimmed data record
// (TRIM_HORIZON).
Timestamp *time.Time
noSmithyDocumentSerde
}
// Represents the output for GetShardIterator .
type GetShardIteratorOutput struct {
// The position in the shard from which to start reading data records
// sequentially. A shard iterator specifies this position using the sequence number
// of a data record in a shard.
ShardIterator *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetShardIteratorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetShardIterator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetShardIterator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetShardIteratorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetShardIterator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetShardIterator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "GetShardIterator",
}
}
| 196 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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"
)
// Increases the Kinesis data stream's retention period, which is the length of
// time data records are accessible after they are added to the stream. The maximum
// value of a stream's retention period is 8760 hours (365 days). When invoking
// this API, it is recommended you use the StreamARN input parameter rather than
// the StreamName input parameter. If you choose a longer stream retention period,
// this operation increases the time period during which records that have not yet
// expired are accessible. However, it does not make previous, expired data (older
// than the stream's previous retention period) accessible after the operation has
// been called. For example, if a stream's retention period is set to 24 hours and
// is increased to 168 hours, any data that is older than 24 hours remains
// inaccessible to consumer applications.
func (c *Client) IncreaseStreamRetentionPeriod(ctx context.Context, params *IncreaseStreamRetentionPeriodInput, optFns ...func(*Options)) (*IncreaseStreamRetentionPeriodOutput, error) {
if params == nil {
params = &IncreaseStreamRetentionPeriodInput{}
}
result, metadata, err := c.invokeOperation(ctx, "IncreaseStreamRetentionPeriod", params, optFns, c.addOperationIncreaseStreamRetentionPeriodMiddlewares)
if err != nil {
return nil, err
}
out := result.(*IncreaseStreamRetentionPeriodOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for IncreaseStreamRetentionPeriod .
type IncreaseStreamRetentionPeriodInput struct {
// The new retention period of the stream, in hours. Must be more than the current
// retention period.
//
// This member is required.
RetentionPeriodHours *int32
// The ARN of the stream.
StreamARN *string
// The name of the stream to modify.
StreamName *string
noSmithyDocumentSerde
}
type IncreaseStreamRetentionPeriodOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationIncreaseStreamRetentionPeriodMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpIncreaseStreamRetentionPeriod{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpIncreaseStreamRetentionPeriod{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpIncreaseStreamRetentionPeriodValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opIncreaseStreamRetentionPeriod(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opIncreaseStreamRetentionPeriod(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "IncreaseStreamRetentionPeriod",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Lists the shards in a stream and provides information about each shard. This
// operation has a limit of 1000 transactions per second per data stream. When
// invoking this API, it is recommended you use the StreamARN input parameter
// rather than the StreamName input parameter. This action does not list expired
// shards. For information about expired shards, see Data Routing, Data
// Persistence, and Shard State after a Reshard (https://docs.aws.amazon.com/streams/latest/dev/kinesis-using-sdk-java-after-resharding.html#kinesis-using-sdk-java-resharding-data-routing)
// . This API is a new operation that is used by the Amazon Kinesis Client Library
// (KCL). If you have a fine-grained IAM policy that only allows specific
// operations, you must update your policy to allow calls to this API. For more
// information, see Controlling Access to Amazon Kinesis Data Streams Resources
// Using IAM (https://docs.aws.amazon.com/streams/latest/dev/controlling-access.html)
// .
func (c *Client) ListShards(ctx context.Context, params *ListShardsInput, optFns ...func(*Options)) (*ListShardsOutput, error) {
if params == nil {
params = &ListShardsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListShards", params, optFns, c.addOperationListShardsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListShardsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListShardsInput struct {
// Specify this parameter to indicate that you want to list the shards starting
// with the shard whose ID immediately follows ExclusiveStartShardId . If you don't
// specify this parameter, the default behavior is for ListShards to list the
// shards starting with the first one in the stream. You cannot specify this
// parameter if you specify NextToken .
ExclusiveStartShardId *string
// The maximum number of shards to return in a single call to ListShards . The
// maximum number of shards to return in a single call. The default value is 1000.
// If you specify a value greater than 1000, at most 1000 results are returned.
// When the number of shards to be listed is greater than the value of MaxResults ,
// the response contains a NextToken value that you can use in a subsequent call
// to ListShards to list the next set of shards.
MaxResults *int32
// When the number of shards in the data stream is greater than the default value
// for the MaxResults parameter, or if you explicitly specify a value for
// MaxResults that is less than the number of shards in the data stream, the
// response includes a pagination token named NextToken . You can specify this
// NextToken value in a subsequent call to ListShards to list the next set of
// shards. Don't specify StreamName or StreamCreationTimestamp if you specify
// NextToken because the latter unambiguously identifies the stream. You can
// optionally specify a value for the MaxResults parameter when you specify
// NextToken . If you specify a MaxResults value that is less than the number of
// shards that the operation returns if you don't specify MaxResults , the response
// will contain a new NextToken value. You can use the new NextToken value in a
// subsequent call to the ListShards operation. Tokens expire after 300 seconds.
// When you obtain a value for NextToken in the response to a call to ListShards ,
// you have 300 seconds to use that value. If you specify an expired token in a
// call to ListShards , you get ExpiredNextTokenException .
NextToken *string
// Enables you to filter out the response of the ListShards API. You can only
// specify one filter at a time. If you use the ShardFilter parameter when
// invoking the ListShards API, the Type is the required property and must be
// specified. If you specify the AT_TRIM_HORIZON , FROM_TRIM_HORIZON , or AT_LATEST
// types, you do not need to specify either the ShardId or the Timestamp optional
// properties. If you specify the AFTER_SHARD_ID type, you must also provide the
// value for the optional ShardId property. The ShardId property is identical in
// fuctionality to the ExclusiveStartShardId parameter of the ListShards API. When
// ShardId property is specified, the response includes the shards starting with
// the shard whose ID immediately follows the ShardId that you provided. If you
// specify the AT_TIMESTAMP or FROM_TIMESTAMP_ID type, you must also provide the
// value for the optional Timestamp property. If you specify the AT_TIMESTAMP
// type, then all shards that were open at the provided timestamp are returned. If
// you specify the FROM_TIMESTAMP type, then all shards starting from the provided
// timestamp to TIP are returned.
ShardFilter *types.ShardFilter
// The ARN of the stream.
StreamARN *string
// Specify this input parameter to distinguish data streams that have the same
// name. For example, if you create a data stream and then delete it, and you later
// create another data stream with the same name, you can use this input parameter
// to specify which of the two streams you want to list the shards for. You cannot
// specify this parameter if you specify the NextToken parameter.
StreamCreationTimestamp *time.Time
// The name of the data stream whose shards you want to list. You cannot specify
// this parameter if you specify the NextToken parameter.
StreamName *string
noSmithyDocumentSerde
}
type ListShardsOutput struct {
// When the number of shards in the data stream is greater than the default value
// for the MaxResults parameter, or if you explicitly specify a value for
// MaxResults that is less than the number of shards in the data stream, the
// response includes a pagination token named NextToken . You can specify this
// NextToken value in a subsequent call to ListShards to list the next set of
// shards. For more information about the use of this pagination token when calling
// the ListShards operation, see ListShardsInput$NextToken . Tokens expire after
// 300 seconds. When you obtain a value for NextToken in the response to a call to
// ListShards , you have 300 seconds to use that value. If you specify an expired
// token in a call to ListShards , you get ExpiredNextTokenException .
NextToken *string
// An array of JSON objects. Each object represents one shard and specifies the
// IDs of the shard, the shard's parent, and the shard that's adjacent to the
// shard's parent. Each object also contains the starting and ending hash keys and
// the starting and ending sequence numbers for the shard.
Shards []types.Shard
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListShardsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListShards{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListShards{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListShardsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListShards(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListShards(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "ListShards",
}
}
| 210 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Lists the consumers registered to receive data from a stream using enhanced
// fan-out, and provides information about each consumer. This operation has a
// limit of 5 transactions per second per stream.
func (c *Client) ListStreamConsumers(ctx context.Context, params *ListStreamConsumersInput, optFns ...func(*Options)) (*ListStreamConsumersOutput, error) {
if params == nil {
params = &ListStreamConsumersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListStreamConsumers", params, optFns, c.addOperationListStreamConsumersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListStreamConsumersOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListStreamConsumersInput struct {
// The ARN of the Kinesis data stream for which you want to list the registered
// consumers. 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#arn-syntax-kinesis-streams)
// .
//
// This member is required.
StreamARN *string
// The maximum number of consumers that you want a single call of
// ListStreamConsumers to return. The default value is 100. If you specify a value
// greater than 100, at most 100 results are returned.
MaxResults *int32
// When the number of consumers that are registered with the data stream is
// greater than the default value for the MaxResults parameter, or if you
// explicitly specify a value for MaxResults that is less than the number of
// consumers that are registered with the data stream, the response includes a
// pagination token named NextToken . You can specify this NextToken value in a
// subsequent call to ListStreamConsumers to list the next set of registered
// consumers. Don't specify StreamName or StreamCreationTimestamp if you specify
// NextToken because the latter unambiguously identifies the stream. You can
// optionally specify a value for the MaxResults parameter when you specify
// NextToken . If you specify a MaxResults value that is less than the number of
// consumers that the operation returns if you don't specify MaxResults , the
// response will contain a new NextToken value. You can use the new NextToken
// value in a subsequent call to the ListStreamConsumers operation to list the
// next set of consumers. Tokens expire after 300 seconds. When you obtain a value
// for NextToken in the response to a call to ListStreamConsumers , you have 300
// seconds to use that value. If you specify an expired token in a call to
// ListStreamConsumers , you get ExpiredNextTokenException .
NextToken *string
// Specify this input parameter to distinguish data streams that have the same
// name. For example, if you create a data stream and then delete it, and you later
// create another data stream with the same name, you can use this input parameter
// to specify which of the two streams you want to list the consumers for. You
// can't specify this parameter if you specify the NextToken parameter.
StreamCreationTimestamp *time.Time
noSmithyDocumentSerde
}
type ListStreamConsumersOutput struct {
// An array of JSON objects. Each object represents one registered consumer.
Consumers []types.Consumer
// When the number of consumers that are registered with the data stream is
// greater than the default value for the MaxResults parameter, or if you
// explicitly specify a value for MaxResults that is less than the number of
// registered consumers, the response includes a pagination token named NextToken .
// You can specify this NextToken value in a subsequent call to ListStreamConsumers
// to list the next set of registered consumers. For more information about the use
// of this pagination token when calling the ListStreamConsumers operation, see
// ListStreamConsumersInput$NextToken . Tokens expire after 300 seconds. When you
// obtain a value for NextToken in the response to a call to ListStreamConsumers ,
// you have 300 seconds to use that value. If you specify an expired token in a
// call to ListStreamConsumers , you get ExpiredNextTokenException .
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListStreamConsumersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListStreamConsumers{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListStreamConsumers{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListStreamConsumersValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListStreamConsumers(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListStreamConsumersAPIClient is a client that implements the
// ListStreamConsumers operation.
type ListStreamConsumersAPIClient interface {
ListStreamConsumers(context.Context, *ListStreamConsumersInput, ...func(*Options)) (*ListStreamConsumersOutput, error)
}
var _ ListStreamConsumersAPIClient = (*Client)(nil)
// ListStreamConsumersPaginatorOptions is the paginator options for
// ListStreamConsumers
type ListStreamConsumersPaginatorOptions struct {
// The maximum number of consumers that you want a single call of
// ListStreamConsumers to return. The default value is 100. If you specify a value
// greater than 100, at most 100 results are returned.
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
}
// ListStreamConsumersPaginator is a paginator for ListStreamConsumers
type ListStreamConsumersPaginator struct {
options ListStreamConsumersPaginatorOptions
client ListStreamConsumersAPIClient
params *ListStreamConsumersInput
nextToken *string
firstPage bool
}
// NewListStreamConsumersPaginator returns a new ListStreamConsumersPaginator
func NewListStreamConsumersPaginator(client ListStreamConsumersAPIClient, params *ListStreamConsumersInput, optFns ...func(*ListStreamConsumersPaginatorOptions)) *ListStreamConsumersPaginator {
if params == nil {
params = &ListStreamConsumersInput{}
}
options := ListStreamConsumersPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListStreamConsumersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListStreamConsumersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListStreamConsumers page.
func (p *ListStreamConsumersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamConsumersOutput, 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.ListStreamConsumers(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_opListStreamConsumers(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "ListStreamConsumers",
}
}
| 269 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists your Kinesis data streams. The number of streams may be too large to
// return from a single call to ListStreams . You can limit the number of returned
// streams using the Limit parameter. If you do not specify a value for the Limit
// parameter, Kinesis Data Streams uses the default limit, which is currently 100.
// You can detect if there are more streams available to list by using the
// HasMoreStreams flag from the returned output. If there are more streams
// available, you can request more streams by using the name of the last stream
// returned by the ListStreams request in the ExclusiveStartStreamName parameter
// in a subsequent request to ListStreams . The group of stream names returned by
// the subsequent request is then added to the list. You can continue this process
// until all the stream names have been collected in the list. ListStreams has a
// limit of five transactions per second per account.
func (c *Client) ListStreams(ctx context.Context, params *ListStreamsInput, optFns ...func(*Options)) (*ListStreamsOutput, error) {
if params == nil {
params = &ListStreamsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListStreams", params, optFns, c.addOperationListStreamsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListStreamsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for ListStreams .
type ListStreamsInput struct {
// The name of the stream to start the list with.
ExclusiveStartStreamName *string
// The maximum number of streams to list. The default value is 100. If you specify
// a value greater than 100, at most 100 results are returned.
Limit *int32
//
NextToken *string
noSmithyDocumentSerde
}
// Represents the output for ListStreams .
type ListStreamsOutput struct {
// If set to true , there are more streams available to list.
//
// This member is required.
HasMoreStreams *bool
// The names of the streams that are associated with the Amazon Web Services
// account making the ListStreams request.
//
// This member is required.
StreamNames []string
//
NextToken *string
//
StreamSummaries []types.StreamSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListStreamsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListStreams{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListStreams{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListStreams(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListStreamsAPIClient is a client that implements the ListStreams operation.
type ListStreamsAPIClient interface {
ListStreams(context.Context, *ListStreamsInput, ...func(*Options)) (*ListStreamsOutput, error)
}
var _ ListStreamsAPIClient = (*Client)(nil)
// ListStreamsPaginatorOptions is the paginator options for ListStreams
type ListStreamsPaginatorOptions struct {
// The maximum number of streams to list. The default value is 100. If you specify
// a value greater than 100, at most 100 results are returned.
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
}
// ListStreamsPaginator is a paginator for ListStreams
type ListStreamsPaginator struct {
options ListStreamsPaginatorOptions
client ListStreamsAPIClient
params *ListStreamsInput
nextToken *string
firstPage bool
}
// NewListStreamsPaginator returns a new ListStreamsPaginator
func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator {
if params == nil {
params = &ListStreamsInput{}
}
options := ListStreamsPaginatorOptions{}
if params.Limit != nil {
options.Limit = *params.Limit
}
for _, fn := range optFns {
fn(&options)
}
return &ListStreamsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListStreamsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListStreams page.
func (p *ListStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamsOutput, 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.Limit = limit
result, err := p.client.ListStreams(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_opListStreams(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "ListStreams",
}
}
| 245 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the tags for the specified Kinesis data stream. This operation has a
// limit of five transactions per second per account. When invoking this API, it is
// recommended you use the StreamARN input parameter rather than the StreamName
// input parameter.
func (c *Client) ListTagsForStream(ctx context.Context, params *ListTagsForStreamInput, optFns ...func(*Options)) (*ListTagsForStreamOutput, error) {
if params == nil {
params = &ListTagsForStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForStream", params, optFns, c.addOperationListTagsForStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for ListTagsForStream .
type ListTagsForStreamInput struct {
// The key to use as the starting point for the list of tags. If this parameter is
// set, ListTagsForStream 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 stream, HasMoreTags is set to true . To list additional
// tags, set ExclusiveStartTagKey to the last key in the response.
Limit *int32
// The ARN of the stream.
StreamARN *string
// The name of the stream.
StreamName *string
noSmithyDocumentSerde
}
// Represents the output for ListTagsForStream .
type ListTagsForStreamOutput struct {
// If set to true , more tags are available. To request additional tags, set
// ExclusiveStartTagKey to the key of the last tag returned.
//
// This member is required.
HasMoreTags *bool
// A list of tags associated with StreamName , 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) addOperationListTagsForStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListTagsForStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListTagsForStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "ListTagsForStream",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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"
)
// Merges two adjacent shards in a Kinesis data stream and combines them into a
// single shard to reduce the stream's capacity to ingest and transport data. This
// API is only supported for the data streams with the provisioned capacity mode.
// Two shards are considered adjacent if the union of the hash key ranges for the
// two shards form a contiguous set with no gaps. For example, if you have two
// shards, one with a hash key range of 276...381 and the other with a hash key
// range of 382...454, then you could merge these two shards into a single shard
// that would have a hash key range of 276...454. After the merge, the single child
// shard receives data for all hash key values covered by the two parent shards.
// When invoking this API, it is recommended you use the StreamARN input parameter
// rather than the StreamName input parameter. MergeShards is called when there is
// a need to reduce the overall capacity of a stream because of excess capacity
// that is not being used. You must specify the shard to be merged and the adjacent
// shard for a stream. For more information about merging shards, see Merge Two
// Shards (https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-resharding-merge.html)
// in the Amazon Kinesis Data Streams Developer Guide. If the stream is in the
// ACTIVE state, you can call MergeShards . If a stream is in the CREATING ,
// UPDATING , or DELETING state, MergeShards returns a ResourceInUseException . If
// the specified stream does not exist, MergeShards returns a
// ResourceNotFoundException . You can use DescribeStreamSummary to check the
// state of the stream, which is returned in StreamStatus . MergeShards is an
// asynchronous operation. Upon receiving a MergeShards request, Amazon Kinesis
// Data Streams immediately returns a response and sets the StreamStatus to
// UPDATING . After the operation is completed, Kinesis Data Streams sets the
// StreamStatus to ACTIVE . Read and write operations continue to work while the
// stream is in the UPDATING state. You use DescribeStreamSummary and the
// ListShards APIs to determine the shard IDs that are specified in the MergeShards
// request. If you try to operate on too many streams in parallel using
// CreateStream , DeleteStream , MergeShards , or SplitShard , you receive a
// LimitExceededException . MergeShards has a limit of five transactions per
// second per account.
func (c *Client) MergeShards(ctx context.Context, params *MergeShardsInput, optFns ...func(*Options)) (*MergeShardsOutput, error) {
if params == nil {
params = &MergeShardsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "MergeShards", params, optFns, c.addOperationMergeShardsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*MergeShardsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for MergeShards .
type MergeShardsInput struct {
// The shard ID of the adjacent shard for the merge.
//
// This member is required.
AdjacentShardToMerge *string
// The shard ID of the shard to combine with the adjacent shard for the merge.
//
// This member is required.
ShardToMerge *string
// The ARN of the stream.
StreamARN *string
// The name of the stream for the merge.
StreamName *string
noSmithyDocumentSerde
}
type MergeShardsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationMergeShardsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpMergeShards{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpMergeShards{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpMergeShardsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opMergeShards(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opMergeShards(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "MergeShards",
}
}
| 162 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/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 stream. Call PutRecord
// to send data into the stream for real-time ingestion and subsequent processing,
// one record at a time. Each shard can support writes up to 1,000 records per
// second, up to a maximum data write total of 1 MiB per second. When invoking this
// API, it is recommended you use the StreamARN input parameter rather than the
// StreamName input parameter. You must specify the name of the stream that
// captures, stores, and transports the data; a partition key; and the data blob
// itself. The data blob can be any type of data; for example, a segment from a log
// file, geographic/location data, website clickstream data, and so on. The
// partition key is used by Kinesis Data Streams to distribute data across shards.
// Kinesis Data Streams segregates the data records that belong to a stream into
// multiple shards, using the partition key associated with each data record to
// determine the shard to which a given data record belongs. Partition keys are
// Unicode strings, with a maximum length limit of 256 characters for each key. An
// MD5 hash function is used to map partition keys to 128-bit integer values and to
// map associated data records to shards using the hash key ranges of the shards.
// You can override hashing the partition key to determine the shard by explicitly
// specifying a hash value using the ExplicitHashKey parameter. For more
// information, see Adding Data to a Stream (https://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-add-data-to-stream)
// in the Amazon Kinesis Data Streams Developer Guide. PutRecord returns the shard
// ID of where the data record was placed and the sequence number that was assigned
// to the data record. Sequence numbers increase over time and are specific to a
// shard within a stream, not across all shards within a stream. To guarantee
// strictly increasing ordering, write serially to a shard and use the
// SequenceNumberForOrdering parameter. For more information, see Adding Data to a
// Stream (https://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-add-data-to-stream)
// in the Amazon Kinesis Data Streams Developer Guide. After you write a record to
// a stream, you cannot modify that record or its order within the stream. If a
// PutRecord request cannot be processed because of insufficient provisioned
// throughput on the shard involved in the request, PutRecord throws
// ProvisionedThroughputExceededException . By default, data records are accessible
// for 24 hours from the time that they are added to a stream. You can use
// IncreaseStreamRetentionPeriod or DecreaseStreamRetentionPeriod to modify this
// retention period.
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
}
// Represents the input for PutRecord .
type PutRecordInput struct {
// The data blob to put into the record, which is base64-encoded when the blob is
// serialized. When the data blob (the payload before base64-encoding) is added to
// the partition key size, the total size must not exceed the maximum record size
// (1 MiB).
//
// This member is required.
Data []byte
// Determines which shard in the stream the data record is assigned to. Partition
// keys are Unicode strings with a maximum length limit of 256 characters for each
// key. Amazon Kinesis Data Streams uses the partition key as input to a hash
// function that maps the partition key and associated data to a specific shard.
// Specifically, an MD5 hash function is used to map partition keys to 128-bit
// integer values and to map associated data records to shards. As a result of this
// hashing mechanism, all data records with the same partition key map to the same
// shard within the stream.
//
// This member is required.
PartitionKey *string
// The hash value used to explicitly determine the shard the data record is
// assigned to by overriding the partition key hash.
ExplicitHashKey *string
// Guarantees strictly increasing sequence numbers, for puts from the same client
// and to the same partition key. Usage: set the SequenceNumberForOrdering of
// record n to the sequence number of record n-1 (as returned in the result when
// putting record n-1). If this parameter is not set, records are coarsely ordered
// based on arrival time.
SequenceNumberForOrdering *string
// The ARN of the stream.
StreamARN *string
// The name of the stream to put the data record into.
StreamName *string
noSmithyDocumentSerde
}
// Represents the output for PutRecord .
type PutRecordOutput struct {
// The sequence number identifier that was assigned to the put data record. The
// sequence number for the record is unique across all records in the stream. A
// sequence number is the identifier associated with every record put into the
// stream.
//
// This member is required.
SequenceNumber *string
// The shard ID of the shard where the data record was placed.
//
// This member is required.
ShardId *string
// The encryption type to use on the record. This parameter can be one of the
// following values:
// - NONE : Do not encrypt the records in the stream.
// - KMS : Use server-side encryption on the records in the stream using a
// customer-managed Amazon Web Services KMS key.
EncryptionType types.EncryptionType
// 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: "kinesis",
OperationName: "PutRecord",
}
}
| 209 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Writes multiple data records into a Kinesis data stream in a single call (also
// referred to as a PutRecords request). Use this operation to send data into the
// stream for data ingestion and processing. When invoking this API, it is
// recommended you use the StreamARN input parameter rather than the StreamName
// input parameter. Each PutRecords request can support up to 500 records. Each
// record in the request can be as large as 1 MiB, up to a limit of 5 MiB for the
// entire request, including partition keys. Each shard can support writes up to
// 1,000 records per second, up to a maximum data write total of 1 MiB per second.
// You must specify the name of the stream that captures, stores, and transports
// the data; and an array of request Records , with each record in the array
// requiring a partition key and data blob. The record size limit applies to the
// total size of the partition key and data blob. The data blob can be any type of
// data; for example, a segment from a log file, geographic/location data, website
// clickstream data, and so on. The partition key is used by Kinesis Data Streams
// as input to a hash function that maps the partition key and associated data to a
// specific shard. An MD5 hash function is used to map partition keys to 128-bit
// integer values and to map associated data records to shards. As a result of this
// hashing mechanism, all data records with the same partition key map to the same
// shard within the stream. For more information, see Adding Data to a Stream (https://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-add-data-to-stream)
// in the Amazon Kinesis Data Streams Developer Guide. Each record in the Records
// array may include an optional parameter, ExplicitHashKey , which overrides the
// partition key to shard mapping. This parameter allows a data producer to
// determine explicitly the shard where the record is stored. For more information,
// see Adding Multiple Records with PutRecords (https://docs.aws.amazon.com/kinesis/latest/dev/developing-producers-with-sdk.html#kinesis-using-sdk-java-putrecords)
// in the Amazon Kinesis Data Streams Developer Guide. The PutRecords response
// includes an array of response Records . Each record in the response array
// directly correlates with a record in the request array using natural ordering,
// from the top to the bottom of the request and response. The response Records
// array always includes the same number of records as the request array. The
// response Records array includes both successfully and unsuccessfully processed
// records. Kinesis Data Streams attempts to process all records in each PutRecords
// request. A single record failure does not stop the processing of subsequent
// records. As a result, PutRecords doesn't guarantee the ordering of records. If
// you need to read records in the same order they are written to the stream, use
// PutRecord instead of PutRecords , and write to the same shard. A successfully
// processed record includes ShardId and SequenceNumber values. The ShardId
// parameter identifies the shard in the stream where the record is stored. The
// SequenceNumber parameter is an identifier assigned to the put record, unique to
// all records in the stream. An unsuccessfully processed record includes ErrorCode
// and ErrorMessage values. ErrorCode reflects the type of error and can be one of
// the following values: ProvisionedThroughputExceededException or InternalFailure
// . ErrorMessage provides more detailed information about the
// ProvisionedThroughputExceededException exception including the account ID,
// stream name, and shard ID of the record that was throttled. For more information
// about partially successful responses, see Adding Multiple Records with
// PutRecords (https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-add-data-to-stream.html#kinesis-using-sdk-java-putrecords)
// in the Amazon Kinesis Data Streams Developer Guide. After you write a record to
// a stream, you cannot modify that record or its order within the stream. By
// default, data records are accessible for 24 hours from the time that they are
// added to a stream. You can use IncreaseStreamRetentionPeriod or
// DecreaseStreamRetentionPeriod to modify this retention period.
func (c *Client) PutRecords(ctx context.Context, params *PutRecordsInput, optFns ...func(*Options)) (*PutRecordsOutput, error) {
if params == nil {
params = &PutRecordsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutRecords", params, optFns, c.addOperationPutRecordsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutRecordsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A PutRecords request.
type PutRecordsInput struct {
// The records associated with the request.
//
// This member is required.
Records []types.PutRecordsRequestEntry
// The ARN of the stream.
StreamARN *string
// The stream name associated with the request.
StreamName *string
noSmithyDocumentSerde
}
// PutRecords results.
type PutRecordsOutput struct {
// An array of successfully and unsuccessfully processed record results. A record
// that is successfully added to a stream includes SequenceNumber and ShardId in
// the result. A record that fails to be added to a stream includes ErrorCode and
// ErrorMessage in the result.
//
// This member is required.
Records []types.PutRecordsResultEntry
// The encryption type used on the records. This parameter can be one of the
// following values:
// - NONE : Do not encrypt the records.
// - KMS : Use server-side encryption on the records using a customer-managed
// Amazon Web Services KMS key.
EncryptionType types.EncryptionType
// The number of unsuccessfully processed records in a PutRecords request.
FailedRecordCount *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutRecordsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRecords{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutRecords{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutRecordsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRecords(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutRecords(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "PutRecords",
}
}
| 198 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Registers a consumer with a Kinesis data stream. When you use this operation,
// the consumer you register can then call SubscribeToShard to receive data from
// the stream using enhanced fan-out, at a rate of up to 2 MiB per second for every
// shard you subscribe to. This rate is unaffected by the total number of consumers
// that read from the same stream. You can register up to 20 consumers per stream.
// A given consumer can only be registered with one stream at a time. For an
// example of how to use this operations, see Enhanced Fan-Out Using the Kinesis
// Data Streams API . The use of this operation has a limit of five transactions
// per second per account. Also, only 5 consumers can be created simultaneously. In
// other words, you cannot have more than 5 consumers in a CREATING status at the
// same time. Registering a 6th consumer while there are 5 in a CREATING status
// results in a LimitExceededException .
func (c *Client) RegisterStreamConsumer(ctx context.Context, params *RegisterStreamConsumerInput, optFns ...func(*Options)) (*RegisterStreamConsumerOutput, error) {
if params == nil {
params = &RegisterStreamConsumerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RegisterStreamConsumer", params, optFns, c.addOperationRegisterStreamConsumerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RegisterStreamConsumerOutput)
out.ResultMetadata = metadata
return out, nil
}
type RegisterStreamConsumerInput struct {
// For a given Kinesis data stream, each consumer must have a unique name.
// However, consumer names don't have to be unique across data streams.
//
// This member is required.
ConsumerName *string
// The ARN of the Kinesis data stream that you want to register the consumer with.
// For more info, see Amazon Resource Names (ARNs) and Amazon Web Services Service
// Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kinesis-streams)
// .
//
// This member is required.
StreamARN *string
noSmithyDocumentSerde
}
type RegisterStreamConsumerOutput struct {
// An object that represents the details of the consumer you registered. When you
// register a consumer, it gets an ARN that is generated by Kinesis Data Streams.
//
// This member is required.
Consumer *types.Consumer
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRegisterStreamConsumerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterStreamConsumer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRegisterStreamConsumer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRegisterStreamConsumerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterStreamConsumer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRegisterStreamConsumer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "RegisterStreamConsumer",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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 Kinesis data stream. Removed tags are deleted
// and cannot be recovered after this operation successfully completes. When
// invoking this API, it is recommended you use the StreamARN input parameter
// rather than the StreamName input parameter. If you specify a tag that does not
// exist, it is ignored. RemoveTagsFromStream has a limit of five transactions per
// second per account.
func (c *Client) RemoveTagsFromStream(ctx context.Context, params *RemoveTagsFromStreamInput, optFns ...func(*Options)) (*RemoveTagsFromStreamOutput, error) {
if params == nil {
params = &RemoveTagsFromStreamInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveTagsFromStream", params, optFns, c.addOperationRemoveTagsFromStreamMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveTagsFromStreamOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for RemoveTagsFromStream .
type RemoveTagsFromStreamInput struct {
// A list of tag keys. Each corresponding tag is removed from the stream.
//
// This member is required.
TagKeys []string
// The ARN of the stream.
StreamARN *string
// The name of the stream.
StreamName *string
noSmithyDocumentSerde
}
type RemoveTagsFromStreamOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveTagsFromStreamMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveTagsFromStream{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveTagsFromStream{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRemoveTagsFromStreamValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTagsFromStream(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRemoveTagsFromStream(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "RemoveTagsFromStream",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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"
)
// Splits a shard into two new shards in the Kinesis data stream, to increase the
// stream's capacity to ingest and transport data. SplitShard is called when there
// is a need to increase the overall capacity of a stream because of an expected
// increase in the volume of data records being ingested. This API is only
// supported for the data streams with the provisioned capacity mode. When invoking
// this API, it is recommended you use the StreamARN input parameter rather than
// the StreamName input parameter. You can also use SplitShard when a shard
// appears to be approaching its maximum utilization; for example, the producers
// sending data into the specific shard are suddenly sending more than previously
// anticipated. You can also call SplitShard to increase stream capacity, so that
// more Kinesis Data Streams applications can simultaneously read data from the
// stream for real-time processing. You must specify the shard to be split and the
// new hash key, which is the position in the shard where the shard gets split in
// two. In many cases, the new hash key might be the average of the beginning and
// ending hash key, but it can be any hash key value in the range being mapped into
// the shard. For more information, see Split a Shard (https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-resharding-split.html)
// in the Amazon Kinesis Data Streams Developer Guide. You can use
// DescribeStreamSummary and the ListShards APIs to determine the shard ID and
// hash key values for the ShardToSplit and NewStartingHashKey parameters that are
// specified in the SplitShard request. SplitShard is an asynchronous operation.
// Upon receiving a SplitShard request, Kinesis Data Streams immediately returns a
// response and sets the stream status to UPDATING . After the operation is
// completed, Kinesis Data Streams sets the stream status to ACTIVE . Read and
// write operations continue to work while the stream is in the UPDATING state.
// You can use DescribeStreamSummary to check the status of the stream, which is
// returned in StreamStatus . If the stream is in the ACTIVE state, you can call
// SplitShard . If the specified stream does not exist, DescribeStreamSummary
// returns a ResourceNotFoundException . If you try to create more shards than are
// authorized for your account, you receive a LimitExceededException . For the
// default shard limit for an Amazon Web Services account, see Kinesis Data
// Streams Limits (https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html)
// in the Amazon Kinesis Data Streams Developer Guide. To increase this limit,
// contact Amazon Web Services Support (https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html)
// . If you try to operate on too many streams simultaneously using CreateStream ,
// DeleteStream , MergeShards , and/or SplitShard , you receive a
// LimitExceededException . SplitShard has a limit of five transactions per second
// per account.
func (c *Client) SplitShard(ctx context.Context, params *SplitShardInput, optFns ...func(*Options)) (*SplitShardOutput, error) {
if params == nil {
params = &SplitShardInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SplitShard", params, optFns, c.addOperationSplitShardMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SplitShardOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents the input for SplitShard .
type SplitShardInput struct {
// A hash key value for the starting hash key of one of the child shards created
// by the split. The hash key range for a given shard constitutes a set of ordered
// contiguous positive integers. The value for NewStartingHashKey must be in the
// range of hash keys being mapped into the shard. The NewStartingHashKey hash key
// value and all higher hash key values in hash key range are distributed to one of
// the child shards. All the lower hash key values in the range are distributed to
// the other child shard.
//
// This member is required.
NewStartingHashKey *string
// The shard ID of the shard to split.
//
// This member is required.
ShardToSplit *string
// The ARN of the stream.
StreamARN *string
// The name of the stream for the shard split.
StreamName *string
noSmithyDocumentSerde
}
type SplitShardOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSplitShardMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSplitShard{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSplitShard{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSplitShardValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSplitShard(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opSplitShard(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "SplitShard",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Enables or updates server-side encryption using an Amazon Web Services KMS key
// for a specified stream. Starting encryption is an asynchronous operation. Upon
// receiving the request, Kinesis Data Streams returns immediately and sets the
// status of the stream to UPDATING . After the update is complete, Kinesis Data
// Streams sets the status of the stream back to ACTIVE . Updating or applying
// encryption normally takes a few seconds to complete, but it can take minutes.
// You can continue to read and write data to your stream while its status is
// UPDATING . Once the status of the stream is ACTIVE , encryption begins for
// records written to the stream. API Limits: You can successfully apply a new
// Amazon Web Services KMS key for server-side encryption 25 times in a rolling
// 24-hour period. Note: It can take up to 5 seconds after the stream is in an
// ACTIVE status before all records written to the stream are encrypted. After you
// enable encryption, you can verify that encryption is applied by inspecting the
// API response from PutRecord or PutRecords . When invoking this API, it is
// recommended you use the StreamARN input parameter rather than the StreamName
// input parameter.
func (c *Client) StartStreamEncryption(ctx context.Context, params *StartStreamEncryptionInput, optFns ...func(*Options)) (*StartStreamEncryptionOutput, error) {
if params == nil {
params = &StartStreamEncryptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartStreamEncryption", params, optFns, c.addOperationStartStreamEncryptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartStreamEncryptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartStreamEncryptionInput struct {
// The encryption type to use. The only valid value is KMS .
//
// This member is required.
EncryptionType types.EncryptionType
// The GUID for the customer-managed Amazon Web Services KMS key to use for
// encryption. This value can be a globally unique identifier, a fully specified
// Amazon Resource Name (ARN) to either an alias or a key, or an alias name
// prefixed by "alias/".You can also use a master key owned by Kinesis Data Streams
// by specifying the alias aws/kinesis .
// - Key ARN example:
// arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
// - Alias ARN example: arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
// - Globally unique key ID example: 12345678-1234-1234-1234-123456789012
// - Alias name example: alias/MyAliasName
// - Master key owned by Kinesis Data Streams: alias/aws/kinesis
//
// This member is required.
KeyId *string
// The ARN of the stream.
StreamARN *string
// The name of the stream for which to start encrypting records.
StreamName *string
noSmithyDocumentSerde
}
type StartStreamEncryptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartStreamEncryptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartStreamEncryption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartStreamEncryption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartStreamEncryptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartStreamEncryption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStartStreamEncryption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "StartStreamEncryption",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disables server-side encryption for a specified stream. When invoking this API,
// it is recommended you use the StreamARN input parameter rather than the
// StreamName input parameter. Stopping encryption is an asynchronous operation.
// Upon receiving the request, Kinesis Data Streams returns immediately and sets
// the status of the stream to UPDATING . After the update is complete, Kinesis
// Data Streams sets the status of the stream back to ACTIVE . Stopping encryption
// normally takes a few seconds to complete, but it can take minutes. You can
// continue to read and write data to your stream while its status is UPDATING .
// Once the status of the stream is ACTIVE , records written to the stream are no
// longer encrypted by Kinesis Data Streams. API Limits: You can successfully
// disable server-side encryption 25 times in a rolling 24-hour period. Note: It
// can take up to 5 seconds after the stream is in an ACTIVE status before all
// records written to the stream are no longer subject to encryption. After you
// disabled encryption, you can verify that encryption is not applied by inspecting
// the API response from PutRecord or PutRecords .
func (c *Client) StopStreamEncryption(ctx context.Context, params *StopStreamEncryptionInput, optFns ...func(*Options)) (*StopStreamEncryptionOutput, error) {
if params == nil {
params = &StopStreamEncryptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopStreamEncryption", params, optFns, c.addOperationStopStreamEncryptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopStreamEncryptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopStreamEncryptionInput struct {
// The encryption type. The only valid value is KMS .
//
// This member is required.
EncryptionType types.EncryptionType
// The GUID for the customer-managed Amazon Web Services KMS key to use for
// encryption. This value can be a globally unique identifier, a fully specified
// Amazon Resource Name (ARN) to either an alias or a key, or an alias name
// prefixed by "alias/".You can also use a master key owned by Kinesis Data Streams
// by specifying the alias aws/kinesis .
// - Key ARN example:
// arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
// - Alias ARN example: arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
// - Globally unique key ID example: 12345678-1234-1234-1234-123456789012
// - Alias name example: alias/MyAliasName
// - Master key owned by Kinesis Data Streams: alias/aws/kinesis
//
// This member is required.
KeyId *string
// The ARN of the stream.
StreamARN *string
// The name of the stream on which to stop encrypting records.
StreamName *string
noSmithyDocumentSerde
}
type StopStreamEncryptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopStreamEncryptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopStreamEncryption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopStreamEncryption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopStreamEncryptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopStreamEncryption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStopStreamEncryption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "StopStreamEncryption",
}
}
| 156 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithysync "github.com/aws/smithy-go/sync"
smithyhttp "github.com/aws/smithy-go/transport/http"
"sync"
)
// This operation establishes an HTTP/2 connection between the consumer you
// specify in the ConsumerARN parameter and the shard you specify in the ShardId
// parameter. After the connection is successfully established, Kinesis Data
// Streams pushes records from the shard to the consumer over this connection.
// Before you call this operation, call RegisterStreamConsumer to register the
// consumer with Kinesis Data Streams. When the SubscribeToShard call succeeds,
// your consumer starts receiving events of type SubscribeToShardEvent over the
// HTTP/2 connection for up to 5 minutes, after which time you need to call
// SubscribeToShard again to renew the subscription if you want to continue to
// receive records. You can make one call to SubscribeToShard per second per
// registered consumer per shard. For example, if you have a 4000 shard stream and
// two registered stream consumers, you can make one SubscribeToShard request per
// second for each combination of shard and registered consumer, allowing you to
// subscribe both consumers to all 4000 shards in one second. If you call
// SubscribeToShard again with the same ConsumerARN and ShardId within 5 seconds
// of a successful call, you'll get a ResourceInUseException . If you call
// SubscribeToShard 5 seconds or more after a successful call, the second call
// takes over the subscription and the previous connection expires or fails with a
// ResourceInUseException . For an example of how to use this operations, see
// Enhanced Fan-Out Using the Kinesis Data Streams API .
func (c *Client) SubscribeToShard(ctx context.Context, params *SubscribeToShardInput, optFns ...func(*Options)) (*SubscribeToShardOutput, error) {
if params == nil {
params = &SubscribeToShardInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SubscribeToShard", params, optFns, c.addOperationSubscribeToShardMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SubscribeToShardOutput)
out.ResultMetadata = metadata
return out, nil
}
type SubscribeToShardInput struct {
// For this parameter, use the value you obtained when you called
// RegisterStreamConsumer .
//
// This member is required.
ConsumerARN *string
// The ID of the shard you want to subscribe to. To see a list of all the shards
// for a given stream, use ListShards .
//
// This member is required.
ShardId *string
// The starting position in the data stream from which to start streaming.
//
// This member is required.
StartingPosition *types.StartingPosition
noSmithyDocumentSerde
}
type SubscribeToShardOutput struct {
eventStream *SubscribeToShardEventStream
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
// GetStream returns the type to interact with the event stream.
func (o *SubscribeToShardOutput) GetStream() *SubscribeToShardEventStream {
return o.eventStream
}
func (c *Client) addOperationSubscribeToShardMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSubscribeToShard{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSubscribeToShard{}, middleware.After)
if err != nil {
return err
}
if err = addEventStreamSubscribeToShardMiddleware(stack, options); err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = addOpSubscribeToShardValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSubscribeToShard(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opSubscribeToShard(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "SubscribeToShard",
}
}
// SubscribeToShardEventStream provides the event stream handling for the SubscribeToShard operation.
//
// For testing and mocking the event stream this type should be initialized via
// the NewSubscribeToShardEventStream constructor function. Using the functional options
// to pass in nested mock behavior.
type SubscribeToShardEventStream struct {
// SubscribeToShardEventStreamReader is the EventStream reader for the
// SubscribeToShardEventStream events. This value is automatically set by the SDK
// when the API call is made Use this member when unit testing your code with the
// SDK to mock out the EventStream Reader.
//
// Must not be nil.
Reader SubscribeToShardEventStreamReader
done chan struct{}
closeOnce sync.Once
err *smithysync.OnceErr
}
// NewSubscribeToShardEventStream initializes an SubscribeToShardEventStream.
// This function should only be used for testing and mocking the SubscribeToShardEventStream
// stream within your application.
//
// The Reader member must be set before reading events from the stream.
func NewSubscribeToShardEventStream(optFns ...func(*SubscribeToShardEventStream)) *SubscribeToShardEventStream {
es := &SubscribeToShardEventStream{
done: make(chan struct{}),
err: smithysync.NewOnceErr(),
}
for _, fn := range optFns {
fn(es)
}
return es
}
// Events returns a channel to read events from.
func (es *SubscribeToShardEventStream) Events() <-chan types.SubscribeToShardEventStream {
return es.Reader.Events()
}
// Close closes the stream. This will also cause the stream to be closed.
// Close must be called when done using the stream API. Not calling Close
// may result in resource leaks.
//
// Will close the underlying EventStream writer and reader, and no more events can be
// sent or received.
func (es *SubscribeToShardEventStream) Close() error {
es.closeOnce.Do(es.safeClose)
return es.Err()
}
func (es *SubscribeToShardEventStream) safeClose() {
close(es.done)
es.Reader.Close()
}
// Err returns any error that occurred while reading or writing EventStream Events
// from the service API's response. Returns nil if there were no errors.
func (es *SubscribeToShardEventStream) Err() error {
if err := es.err.Err(); err != nil {
return err
}
if err := es.Reader.Err(); err != nil {
return err
}
return nil
}
func (es *SubscribeToShardEventStream) waitStreamClose() {
type errorSet interface {
ErrorSet() <-chan struct{}
}
var outputErrCh <-chan struct{}
if v, ok := es.Reader.(errorSet); ok {
outputErrCh = v.ErrorSet()
}
var outputClosedCh <-chan struct{}
if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok {
outputClosedCh = v.Closed()
}
select {
case <-es.done:
case <-outputErrCh:
es.err.SetError(es.Reader.Err())
es.Close()
case <-outputClosedCh:
if err := es.Reader.Err(); err != nil {
es.err.SetError(es.Reader.Err())
}
es.Close()
}
}
| 258 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the shard count of the specified stream to the specified number of
// shards. This API is only supported for the data streams with the provisioned
// capacity mode. When invoking this API, it is recommended you use the StreamARN
// input parameter rather than the StreamName input parameter. Updating the shard
// count is an asynchronous operation. Upon receiving the request, Kinesis Data
// Streams returns immediately and sets the status of the stream to UPDATING .
// After the update is complete, Kinesis Data Streams sets the status of the stream
// back to ACTIVE . Depending on the size of the stream, the scaling action could
// take a few minutes to complete. You can continue to read and write data to your
// stream while its status is UPDATING . To update the shard count, Kinesis Data
// Streams performs splits or merges on individual shards. This can cause
// short-lived shards to be created, in addition to the final shards. These
// short-lived shards count towards your total shard limit for your account in the
// Region. When using this operation, we recommend that you specify a target shard
// count that is a multiple of 25% (25%, 50%, 75%, 100%). You can specify any
// target value within your shard limit. However, if you specify a target that
// isn't a multiple of 25%, the scaling action might take longer to complete. This
// operation has the following default limits. By default, you cannot do the
// following:
// - Scale more than ten times per rolling 24-hour period per stream
// - Scale up to more than double your current shard count for a stream
// - Scale down below half your current shard count for a stream
// - Scale up to more than 10000 shards in a stream
// - Scale a stream with more than 10000 shards down unless the result is less
// than 10000 shards
// - Scale up to more than the shard limit for your account
//
// For the default limits for an Amazon Web Services account, see Streams Limits (https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html)
// in the Amazon Kinesis Data Streams Developer Guide. To request an increase in
// the call rate limit, the shard limit for this API, or your overall shard limit,
// use the limits form (https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase&limitType=service-code-kinesis)
// .
func (c *Client) UpdateShardCount(ctx context.Context, params *UpdateShardCountInput, optFns ...func(*Options)) (*UpdateShardCountOutput, error) {
if params == nil {
params = &UpdateShardCountInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateShardCount", params, optFns, c.addOperationUpdateShardCountMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateShardCountOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateShardCountInput struct {
// The scaling type. Uniform scaling creates shards of equal size.
//
// This member is required.
ScalingType types.ScalingType
// The new number of shards. This value has the following default limits. By
// default, you cannot do the following:
// - Set this value to more than double your current shard count for a stream.
// - Set this value below half your current shard count for a stream.
// - Set this value to more than 10000 shards in a stream (the default limit for
// shard count per stream is 10000 per account per region), unless you request a
// limit increase.
// - Scale a stream with more than 10000 shards down unless you set this value
// to less than 10000 shards.
//
// This member is required.
TargetShardCount *int32
// The ARN of the stream.
StreamARN *string
// The name of the stream.
StreamName *string
noSmithyDocumentSerde
}
type UpdateShardCountOutput struct {
// The current number of shards.
CurrentShardCount *int32
// The ARN of the stream.
StreamARN *string
// The name of the stream.
StreamName *string
// The updated number of shards.
TargetShardCount *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateShardCountMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateShardCount{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateShardCount{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateShardCountValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateShardCount(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateShardCount(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "UpdateShardCount",
}
}
| 184 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the capacity mode of the data stream. Currently, in Kinesis Data
// Streams, you can choose between an on-demand capacity mode and a provisioned
// capacity mode for your data stream.
func (c *Client) UpdateStreamMode(ctx context.Context, params *UpdateStreamModeInput, optFns ...func(*Options)) (*UpdateStreamModeOutput, error) {
if params == nil {
params = &UpdateStreamModeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateStreamMode", params, optFns, c.addOperationUpdateStreamModeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateStreamModeOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateStreamModeInput struct {
// Specifies the ARN of the data stream whose capacity mode you want to update.
//
// This member is required.
StreamARN *string
// Specifies the capacity mode to which you want to set your data stream.
// Currently, in Kinesis Data Streams, you can choose between an on-demand capacity
// mode and a provisioned capacity mode for your data streams.
//
// This member is required.
StreamModeDetails *types.StreamModeDetails
noSmithyDocumentSerde
}
type UpdateStreamModeOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateStreamModeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateStreamMode{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateStreamMode{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateStreamModeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateStreamMode(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateStreamMode(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesis",
OperationName: "UpdateStreamMode",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
import (
"bytes"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/kinesis/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"
"io/ioutil"
"strings"
)
type awsAwsjson11_deserializeOpAddTagsToStream struct {
}
func (*awsAwsjson11_deserializeOpAddTagsToStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddTagsToStream) 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_deserializeOpErrorAddTagsToStream(response, &metadata)
}
output := &AddTagsToStreamOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorAddTagsToStream(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpCreateStream struct {
}
func (*awsAwsjson11_deserializeOpCreateStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateStream) 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_deserializeOpErrorCreateStream(response, &metadata)
}
output := &CreateStreamOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorCreateStream(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)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDecreaseStreamRetentionPeriod struct {
}
func (*awsAwsjson11_deserializeOpDecreaseStreamRetentionPeriod) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDecreaseStreamRetentionPeriod) 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_deserializeOpErrorDecreaseStreamRetentionPeriod(response, &metadata)
}
output := &DecreaseStreamRetentionPeriodOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDecreaseStreamRetentionPeriod(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpDeleteStream struct {
}
func (*awsAwsjson11_deserializeOpDeleteStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteStream) 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_deserializeOpErrorDeleteStream(response, &metadata)
}
output := &DeleteStreamOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeleteStream(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpDeregisterStreamConsumer struct {
}
func (*awsAwsjson11_deserializeOpDeregisterStreamConsumer) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeregisterStreamConsumer) 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_deserializeOpErrorDeregisterStreamConsumer(response, &metadata)
}
output := &DeregisterStreamConsumerOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorDeregisterStreamConsumer(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_deserializeOpDescribeLimits struct {
}
func (*awsAwsjson11_deserializeOpDescribeLimits) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeLimits) 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_deserializeOpErrorDescribeLimits(response, &metadata)
}
output := &DescribeLimitsOutput{}
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_deserializeOpDocumentDescribeLimitsOutput(&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_deserializeOpErrorDescribeLimits(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("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeStream struct {
}
func (*awsAwsjson11_deserializeOpDescribeStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeStream) 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_deserializeOpErrorDescribeStream(response, &metadata)
}
output := &DescribeStreamOutput{}
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_deserializeOpDocumentDescribeStreamOutput(&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_deserializeOpErrorDescribeStream(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpDescribeStreamConsumer struct {
}
func (*awsAwsjson11_deserializeOpDescribeStreamConsumer) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeStreamConsumer) 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_deserializeOpErrorDescribeStreamConsumer(response, &metadata)
}
output := &DescribeStreamConsumerOutput{}
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_deserializeOpDocumentDescribeStreamConsumerOutput(&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_deserializeOpErrorDescribeStreamConsumer(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_deserializeOpDescribeStreamSummary struct {
}
func (*awsAwsjson11_deserializeOpDescribeStreamSummary) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeStreamSummary) 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_deserializeOpErrorDescribeStreamSummary(response, &metadata)
}
output := &DescribeStreamSummaryOutput{}
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_deserializeOpDocumentDescribeStreamSummaryOutput(&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_deserializeOpErrorDescribeStreamSummary(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpDisableEnhancedMonitoring struct {
}
func (*awsAwsjson11_deserializeOpDisableEnhancedMonitoring) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDisableEnhancedMonitoring) 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_deserializeOpErrorDisableEnhancedMonitoring(response, &metadata)
}
output := &DisableEnhancedMonitoringOutput{}
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_deserializeOpDocumentDisableEnhancedMonitoringOutput(&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_deserializeOpErrorDisableEnhancedMonitoring(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpEnableEnhancedMonitoring struct {
}
func (*awsAwsjson11_deserializeOpEnableEnhancedMonitoring) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpEnableEnhancedMonitoring) 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_deserializeOpErrorEnableEnhancedMonitoring(response, &metadata)
}
output := &EnableEnhancedMonitoringOutput{}
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_deserializeOpDocumentEnableEnhancedMonitoringOutput(&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_deserializeOpErrorEnableEnhancedMonitoring(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpGetRecords struct {
}
func (*awsAwsjson11_deserializeOpGetRecords) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetRecords) 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_deserializeOpErrorGetRecords(response, &metadata)
}
output := &GetRecordsOutput{}
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_deserializeOpDocumentGetRecordsOutput(&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_deserializeOpErrorGetRecords(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ExpiredIteratorException", errorCode):
return awsAwsjson11_deserializeErrorExpiredIteratorException(response, errorBody)
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("KMSAccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorKMSAccessDeniedException(response, errorBody)
case strings.EqualFold("KMSDisabledException", errorCode):
return awsAwsjson11_deserializeErrorKMSDisabledException(response, errorBody)
case strings.EqualFold("KMSInvalidStateException", errorCode):
return awsAwsjson11_deserializeErrorKMSInvalidStateException(response, errorBody)
case strings.EqualFold("KMSNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorKMSNotFoundException(response, errorBody)
case strings.EqualFold("KMSOptInRequired", errorCode):
return awsAwsjson11_deserializeErrorKMSOptInRequired(response, errorBody)
case strings.EqualFold("KMSThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorKMSThrottlingException(response, errorBody)
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetShardIterator struct {
}
func (*awsAwsjson11_deserializeOpGetShardIterator) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetShardIterator) 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_deserializeOpErrorGetShardIterator(response, &metadata)
}
output := &GetShardIteratorOutput{}
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_deserializeOpDocumentGetShardIteratorOutput(&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_deserializeOpErrorGetShardIterator(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpIncreaseStreamRetentionPeriod struct {
}
func (*awsAwsjson11_deserializeOpIncreaseStreamRetentionPeriod) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpIncreaseStreamRetentionPeriod) 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_deserializeOpErrorIncreaseStreamRetentionPeriod(response, &metadata)
}
output := &IncreaseStreamRetentionPeriodOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorIncreaseStreamRetentionPeriod(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpListShards struct {
}
func (*awsAwsjson11_deserializeOpListShards) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListShards) 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_deserializeOpErrorListShards(response, &metadata)
}
output := &ListShardsOutput{}
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_deserializeOpDocumentListShardsOutput(&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_deserializeOpErrorListShards(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("ExpiredNextTokenException", errorCode):
return awsAwsjson11_deserializeErrorExpiredNextTokenException(response, errorBody)
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_deserializeOpListStreamConsumers struct {
}
func (*awsAwsjson11_deserializeOpListStreamConsumers) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListStreamConsumers) 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_deserializeOpErrorListStreamConsumers(response, &metadata)
}
output := &ListStreamConsumersOutput{}
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_deserializeOpDocumentListStreamConsumersOutput(&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_deserializeOpErrorListStreamConsumers(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("ExpiredNextTokenException", errorCode):
return awsAwsjson11_deserializeErrorExpiredNextTokenException(response, errorBody)
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_deserializeOpListStreams struct {
}
func (*awsAwsjson11_deserializeOpListStreams) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListStreams) 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_deserializeOpErrorListStreams(response, &metadata)
}
output := &ListStreamsOutput{}
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_deserializeOpDocumentListStreamsOutput(&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_deserializeOpErrorListStreams(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("ExpiredNextTokenException", errorCode):
return awsAwsjson11_deserializeErrorExpiredNextTokenException(response, errorBody)
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForStream struct {
}
func (*awsAwsjson11_deserializeOpListTagsForStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForStream) 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_deserializeOpErrorListTagsForStream(response, &metadata)
}
output := &ListTagsForStreamOutput{}
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_deserializeOpDocumentListTagsForStreamOutput(&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_deserializeOpErrorListTagsForStream(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpMergeShards struct {
}
func (*awsAwsjson11_deserializeOpMergeShards) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpMergeShards) 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_deserializeOpErrorMergeShards(response, &metadata)
}
output := &MergeShardsOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorMergeShards(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(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("AccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("KMSAccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorKMSAccessDeniedException(response, errorBody)
case strings.EqualFold("KMSDisabledException", errorCode):
return awsAwsjson11_deserializeErrorKMSDisabledException(response, errorBody)
case strings.EqualFold("KMSInvalidStateException", errorCode):
return awsAwsjson11_deserializeErrorKMSInvalidStateException(response, errorBody)
case strings.EqualFold("KMSNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorKMSNotFoundException(response, errorBody)
case strings.EqualFold("KMSOptInRequired", errorCode):
return awsAwsjson11_deserializeErrorKMSOptInRequired(response, errorBody)
case strings.EqualFold("KMSThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorKMSThrottlingException(response, errorBody)
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutRecords struct {
}
func (*awsAwsjson11_deserializeOpPutRecords) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutRecords) 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_deserializeOpErrorPutRecords(response, &metadata)
}
output := &PutRecordsOutput{}
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_deserializeOpDocumentPutRecordsOutput(&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_deserializeOpErrorPutRecords(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("KMSAccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorKMSAccessDeniedException(response, errorBody)
case strings.EqualFold("KMSDisabledException", errorCode):
return awsAwsjson11_deserializeErrorKMSDisabledException(response, errorBody)
case strings.EqualFold("KMSInvalidStateException", errorCode):
return awsAwsjson11_deserializeErrorKMSInvalidStateException(response, errorBody)
case strings.EqualFold("KMSNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorKMSNotFoundException(response, errorBody)
case strings.EqualFold("KMSOptInRequired", errorCode):
return awsAwsjson11_deserializeErrorKMSOptInRequired(response, errorBody)
case strings.EqualFold("KMSThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorKMSThrottlingException(response, errorBody)
case strings.EqualFold("ProvisionedThroughputExceededException", errorCode):
return awsAwsjson11_deserializeErrorProvisionedThroughputExceededException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpRegisterStreamConsumer struct {
}
func (*awsAwsjson11_deserializeOpRegisterStreamConsumer) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRegisterStreamConsumer) 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_deserializeOpErrorRegisterStreamConsumer(response, &metadata)
}
output := &RegisterStreamConsumerOutput{}
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_deserializeOpDocumentRegisterStreamConsumerOutput(&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_deserializeOpErrorRegisterStreamConsumer(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_deserializeOpRemoveTagsFromStream struct {
}
func (*awsAwsjson11_deserializeOpRemoveTagsFromStream) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRemoveTagsFromStream) 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_deserializeOpErrorRemoveTagsFromStream(response, &metadata)
}
output := &RemoveTagsFromStreamOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorRemoveTagsFromStream(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpSplitShard struct {
}
func (*awsAwsjson11_deserializeOpSplitShard) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSplitShard) 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_deserializeOpErrorSplitShard(response, &metadata)
}
output := &SplitShardOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSplitShard(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStartStreamEncryption struct {
}
func (*awsAwsjson11_deserializeOpStartStreamEncryption) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStartStreamEncryption) 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_deserializeOpErrorStartStreamEncryption(response, &metadata)
}
output := &StartStreamEncryptionOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorStartStreamEncryption(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("KMSAccessDeniedException", errorCode):
return awsAwsjson11_deserializeErrorKMSAccessDeniedException(response, errorBody)
case strings.EqualFold("KMSDisabledException", errorCode):
return awsAwsjson11_deserializeErrorKMSDisabledException(response, errorBody)
case strings.EqualFold("KMSInvalidStateException", errorCode):
return awsAwsjson11_deserializeErrorKMSInvalidStateException(response, errorBody)
case strings.EqualFold("KMSNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorKMSNotFoundException(response, errorBody)
case strings.EqualFold("KMSOptInRequired", errorCode):
return awsAwsjson11_deserializeErrorKMSOptInRequired(response, errorBody)
case strings.EqualFold("KMSThrottlingException", errorCode):
return awsAwsjson11_deserializeErrorKMSThrottlingException(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_deserializeOpStopStreamEncryption struct {
}
func (*awsAwsjson11_deserializeOpStopStreamEncryption) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStopStreamEncryption) 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_deserializeOpErrorStopStreamEncryption(response, &metadata)
}
output := &StopStreamEncryptionOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorStopStreamEncryption(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpSubscribeToShard struct {
}
func (*awsAwsjson11_deserializeOpSubscribeToShard) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSubscribeToShard) 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_deserializeOpErrorSubscribeToShard(response, &metadata)
}
output := &SubscribeToShardOutput{}
out.Result = output
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorSubscribeToShard(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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_deserializeOpUpdateShardCount struct {
}
func (*awsAwsjson11_deserializeOpUpdateShardCount) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateShardCount) 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_deserializeOpErrorUpdateShardCount(response, &metadata)
}
output := &UpdateShardCountOutput{}
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_deserializeOpDocumentUpdateShardCountOutput(&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_deserializeOpErrorUpdateShardCount(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 awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody)
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)
case strings.EqualFold("ValidationException", errorCode):
return awsAwsjson11_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateStreamMode struct {
}
func (*awsAwsjson11_deserializeOpUpdateStreamMode) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateStreamMode) 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_deserializeOpErrorUpdateStreamMode(response, &metadata)
}
output := &UpdateStreamModeOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUpdateStreamMode(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
}
}
func awsAwsjson11_deserializeEventStreamSubscribeToShardEventStream(v *types.SubscribeToShardEventStream, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader)
if eventType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader)
}
switch {
case strings.EqualFold("SubscribeToShardEvent", eventType.String()):
vv := &types.SubscribeToShardEventStreamMemberSubscribeToShardEvent{}
if err := awsAwsjson11_deserializeEventMessageSubscribeToShardEvent(&vv.Value, msg); err != nil {
return err
}
*v = vv
return nil
default:
buffer := bytes.NewBuffer(nil)
eventstream.NewEncoder().Encode(buffer, *msg)
*v = &types.UnknownUnionMember{
Tag: eventType.String(),
Value: buffer.Bytes(),
}
return nil
}
}
func awsAwsjson11_deserializeEventStreamExceptionSubscribeToShardEventStream(msg *eventstream.Message) error {
exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader)
if exceptionType == nil {
return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader)
}
switch {
case strings.EqualFold("InternalFailureException", exceptionType.String()):
return awsAwsjson11_deserializeEventMessageExceptionInternalFailureException(msg)
case strings.EqualFold("KMSAccessDeniedException", exceptionType.String()):
return awsAwsjson11_deserializeEventMessageExceptionKMSAccessDeniedException(msg)
case strings.EqualFold("KMSDisabledException", exceptionType.String()):
return awsAwsjson11_deserializeEventMessageExceptionKMSDisabledException(msg)
case strings.EqualFold("KMSInvalidStateException", exceptionType.String()):
return awsAwsjson11_deserializeEventMessageExceptionKMSInvalidStateException(msg)
case strings.EqualFold("KMSNotFoundException", exceptionType.String()):
return awsAwsjson11_deserializeEventMessageExceptionKMSNotFoundException(msg)
case strings.EqualFold("KMSOptInRequired", exceptionType.String()):
return awsAwsjson11_deserializeEventMessageExceptionKMSOptInRequired(msg)
case strings.EqualFold("KMSThrottlingException", exceptionType.String()):
return awsAwsjson11_deserializeEventMessageExceptionKMSThrottlingException(msg)
case strings.EqualFold("ResourceInUseException", exceptionType.String()):
return awsAwsjson11_deserializeEventMessageExceptionResourceInUseException(msg)
case strings.EqualFold("ResourceNotFoundException", exceptionType.String()):
return awsAwsjson11_deserializeEventMessageExceptionResourceNotFoundException(msg)
default:
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
code, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
return err
}
errorCode := "UnknownError"
errorMessage := errorCode
if ev := exceptionType.String(); len(ev) > 0 {
errorCode = ev
} else if ev := code; len(ev) > 0 {
errorCode = ev
}
if ev := message; len(ev) > 0 {
errorMessage = ev
}
return &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
}
}
func awsAwsjson11_deserializeEventMessageSubscribeToShardEvent(v *types.SubscribeToShardEvent, msg *eventstream.Message) error {
if v == nil {
return fmt.Errorf("unexpected serialization of nil %T", v)
}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
if err := awsAwsjson11_deserializeDocumentSubscribeToShardEvent(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return nil
}
func awsAwsjson11_deserializeEventMessageExceptionResourceNotFoundException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.ResourceNotFoundException{}
if err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsAwsjson11_deserializeEventMessageExceptionResourceInUseException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.ResourceInUseException{}
if err := awsAwsjson11_deserializeDocumentResourceInUseException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsAwsjson11_deserializeEventMessageExceptionKMSDisabledException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.KMSDisabledException{}
if err := awsAwsjson11_deserializeDocumentKMSDisabledException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsAwsjson11_deserializeEventMessageExceptionKMSInvalidStateException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.KMSInvalidStateException{}
if err := awsAwsjson11_deserializeDocumentKMSInvalidStateException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsAwsjson11_deserializeEventMessageExceptionKMSAccessDeniedException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.KMSAccessDeniedException{}
if err := awsAwsjson11_deserializeDocumentKMSAccessDeniedException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsAwsjson11_deserializeEventMessageExceptionKMSNotFoundException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.KMSNotFoundException{}
if err := awsAwsjson11_deserializeDocumentKMSNotFoundException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsAwsjson11_deserializeEventMessageExceptionKMSOptInRequired(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.KMSOptInRequired{}
if err := awsAwsjson11_deserializeDocumentKMSOptInRequired(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsAwsjson11_deserializeEventMessageExceptionKMSThrottlingException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.KMSThrottlingException{}
if err := awsAwsjson11_deserializeDocumentKMSThrottlingException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsAwsjson11_deserializeEventMessageExceptionInternalFailureException(msg *eventstream.Message) error {
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
v := &types.InternalFailureException{}
if err := awsAwsjson11_deserializeDocumentInternalFailureException(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
}
return v
}
func awsAwsjson11_deserializeDocumentChildShard(v **types.ChildShard, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ChildShard
if *v == nil {
sv = &types.ChildShard{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "HashKeyRange":
if err := awsAwsjson11_deserializeDocumentHashKeyRange(&sv.HashKeyRange, value); err != nil {
return err
}
case "ParentShards":
if err := awsAwsjson11_deserializeDocumentShardIdList(&sv.ParentShards, value); err != nil {
return err
}
case "ShardId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ShardId to be of type string, got %T instead", value)
}
sv.ShardId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentChildShardList(v *[]types.ChildShard, 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.ChildShard
if *v == nil {
cv = []types.ChildShard{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ChildShard
destAddr := &col
if err := awsAwsjson11_deserializeDocumentChildShard(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentHashKeyRange(v **types.HashKeyRange, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HashKeyRange
if *v == nil {
sv = &types.HashKeyRange{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EndingHashKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HashKey to be of type string, got %T instead", value)
}
sv.EndingHashKey = ptr.String(jtv)
}
case "StartingHashKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected HashKey to be of type string, got %T instead", value)
}
sv.StartingHashKey = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalFailureException
if *v == nil {
sv = &types.InternalFailureException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentKMSAccessDeniedException(v **types.KMSAccessDeniedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KMSAccessDeniedException
if *v == nil {
sv = &types.KMSAccessDeniedException{}
} 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_deserializeDocumentKMSDisabledException(v **types.KMSDisabledException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KMSDisabledException
if *v == nil {
sv = &types.KMSDisabledException{}
} 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_deserializeDocumentKMSInvalidStateException(v **types.KMSInvalidStateException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KMSInvalidStateException
if *v == nil {
sv = &types.KMSInvalidStateException{}
} 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_deserializeDocumentKMSNotFoundException(v **types.KMSNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KMSNotFoundException
if *v == nil {
sv = &types.KMSNotFoundException{}
} 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_deserializeDocumentKMSOptInRequired(v **types.KMSOptInRequired, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KMSOptInRequired
if *v == nil {
sv = &types.KMSOptInRequired{}
} 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_deserializeDocumentKMSThrottlingException(v **types.KMSThrottlingException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KMSThrottlingException
if *v == nil {
sv = &types.KMSThrottlingException{}
} 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_deserializeDocumentRecord(v **types.Record, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Record
if *v == nil {
sv = &types.Record{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ApproximateArrivalTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ApproximateArrivalTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "Data":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Data to be []byte, got %T instead", value)
}
dv, err := base64.StdEncoding.DecodeString(jtv)
if err != nil {
return fmt.Errorf("failed to base64 decode Data, %w", err)
}
sv.Data = dv
}
case "EncryptionType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value)
}
sv.EncryptionType = types.EncryptionType(jtv)
}
case "PartitionKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PartitionKey to be of type string, got %T instead", value)
}
sv.PartitionKey = ptr.String(jtv)
}
case "SequenceNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SequenceNumber to be of type string, got %T instead", value)
}
sv.SequenceNumber = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRecordList(v *[]types.Record, 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.Record
if *v == nil {
cv = []types.Record{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Record
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRecord(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
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_deserializeDocumentShardIdList(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 ShardId to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSubscribeToShardEvent(v **types.SubscribeToShardEvent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SubscribeToShardEvent
if *v == nil {
sv = &types.SubscribeToShardEvent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChildShards":
if err := awsAwsjson11_deserializeDocumentChildShardList(&sv.ChildShards, value); err != nil {
return err
}
case "ContinuationSequenceNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SequenceNumber to be of type string, got %T instead", value)
}
sv.ContinuationSequenceNumber = ptr.String(jtv)
}
case "MillisBehindLatest":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MillisBehindLatest to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MillisBehindLatest = ptr.Int64(i64)
}
case "Records":
if err := awsAwsjson11_deserializeDocumentRecordList(&sv.Records, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeEventMessageResponseSubscribeToShardOutput(msg *eventstream.Message) (interface{}, error) {
v := &SubscribeToShardOutput{}
br := bytes.NewReader(msg.Payload)
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(br, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return nil, err
}
if err := awsAwsjson11_deserializeOpDocumentSubscribeToShardOutput(&v, shape); err != nil {
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return nil, err
}
}
return v, nil
}
func awsAwsjson11_deserializeOpDocumentSubscribeToShardOutput(v **SubscribeToShardOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SubscribeToShardOutput
if *v == nil {
sv = &SubscribeToShardOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeErrorAccessDeniedException(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.AccessDeniedException{}
err := awsAwsjson11_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 awsAwsjson11_deserializeErrorExpiredIteratorException(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.ExpiredIteratorException{}
err := awsAwsjson11_deserializeDocumentExpiredIteratorException(&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_deserializeErrorExpiredNextTokenException(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.ExpiredNextTokenException{}
err := awsAwsjson11_deserializeDocumentExpiredNextTokenException(&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_deserializeErrorKMSAccessDeniedException(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.KMSAccessDeniedException{}
err := awsAwsjson11_deserializeDocumentKMSAccessDeniedException(&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_deserializeErrorKMSDisabledException(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.KMSDisabledException{}
err := awsAwsjson11_deserializeDocumentKMSDisabledException(&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_deserializeErrorKMSInvalidStateException(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.KMSInvalidStateException{}
err := awsAwsjson11_deserializeDocumentKMSInvalidStateException(&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_deserializeErrorKMSNotFoundException(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.KMSNotFoundException{}
err := awsAwsjson11_deserializeDocumentKMSNotFoundException(&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_deserializeErrorKMSOptInRequired(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.KMSOptInRequired{}
err := awsAwsjson11_deserializeDocumentKMSOptInRequired(&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_deserializeErrorKMSThrottlingException(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.KMSThrottlingException{}
err := awsAwsjson11_deserializeDocumentKMSThrottlingException(&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_deserializeErrorProvisionedThroughputExceededException(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.ProvisionedThroughputExceededException{}
err := awsAwsjson11_deserializeDocumentProvisionedThroughputExceededException(&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_deserializeErrorValidationException(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.ValidationException{}
err := awsAwsjson11_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 awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AccessDeniedException
if *v == nil {
sv = &types.AccessDeniedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentConsumer(v **types.Consumer, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Consumer
if *v == nil {
sv = &types.Consumer{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConsumerARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConsumerARN to be of type string, got %T instead", value)
}
sv.ConsumerARN = ptr.String(jtv)
}
case "ConsumerCreationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ConsumerCreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "ConsumerName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConsumerName to be of type string, got %T instead", value)
}
sv.ConsumerName = ptr.String(jtv)
}
case "ConsumerStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConsumerStatus to be of type string, got %T instead", value)
}
sv.ConsumerStatus = types.ConsumerStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentConsumerDescription(v **types.ConsumerDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConsumerDescription
if *v == nil {
sv = &types.ConsumerDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConsumerARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConsumerARN to be of type string, got %T instead", value)
}
sv.ConsumerARN = ptr.String(jtv)
}
case "ConsumerCreationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ConsumerCreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "ConsumerName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConsumerName to be of type string, got %T instead", value)
}
sv.ConsumerName = ptr.String(jtv)
}
case "ConsumerStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConsumerStatus to be of type string, got %T instead", value)
}
sv.ConsumerStatus = types.ConsumerStatus(jtv)
}
case "StreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamARN to be of type string, got %T instead", value)
}
sv.StreamARN = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentConsumerList(v *[]types.Consumer, 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.Consumer
if *v == nil {
cv = []types.Consumer{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Consumer
destAddr := &col
if err := awsAwsjson11_deserializeDocumentConsumer(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentEnhancedMetrics(v **types.EnhancedMetrics, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EnhancedMetrics
if *v == nil {
sv = &types.EnhancedMetrics{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ShardLevelMetrics":
if err := awsAwsjson11_deserializeDocumentMetricsNameList(&sv.ShardLevelMetrics, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEnhancedMonitoringList(v *[]types.EnhancedMetrics, 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.EnhancedMetrics
if *v == nil {
cv = []types.EnhancedMetrics{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EnhancedMetrics
destAddr := &col
if err := awsAwsjson11_deserializeDocumentEnhancedMetrics(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentExpiredIteratorException(v **types.ExpiredIteratorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExpiredIteratorException
if *v == nil {
sv = &types.ExpiredIteratorException{}
} 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_deserializeDocumentExpiredNextTokenException(v **types.ExpiredNextTokenException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExpiredNextTokenException
if *v == nil {
sv = &types.ExpiredNextTokenException{}
} 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_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_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_deserializeDocumentMetricsNameList(v *[]types.MetricsName, 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.MetricsName
if *v == nil {
cv = []types.MetricsName{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MetricsName
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MetricsName to be of type string, got %T instead", value)
}
col = types.MetricsName(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentProvisionedThroughputExceededException(v **types.ProvisionedThroughputExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ProvisionedThroughputExceededException
if *v == nil {
sv = &types.ProvisionedThroughputExceededException{}
} 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_deserializeDocumentPutRecordsResultEntry(v **types.PutRecordsResultEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PutRecordsResultEntry
if *v == nil {
sv = &types.PutRecordsResultEntry{}
} 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 "SequenceNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SequenceNumber to be of type string, got %T instead", value)
}
sv.SequenceNumber = ptr.String(jtv)
}
case "ShardId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ShardId to be of type string, got %T instead", value)
}
sv.ShardId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPutRecordsResultEntryList(v *[]types.PutRecordsResultEntry, 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.PutRecordsResultEntry
if *v == nil {
cv = []types.PutRecordsResultEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PutRecordsResultEntry
destAddr := &col
if err := awsAwsjson11_deserializeDocumentPutRecordsResultEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSequenceNumberRange(v **types.SequenceNumberRange, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SequenceNumberRange
if *v == nil {
sv = &types.SequenceNumberRange{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EndingSequenceNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SequenceNumber to be of type string, got %T instead", value)
}
sv.EndingSequenceNumber = ptr.String(jtv)
}
case "StartingSequenceNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SequenceNumber to be of type string, got %T instead", value)
}
sv.StartingSequenceNumber = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentShard(v **types.Shard, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Shard
if *v == nil {
sv = &types.Shard{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AdjacentParentShardId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ShardId to be of type string, got %T instead", value)
}
sv.AdjacentParentShardId = ptr.String(jtv)
}
case "HashKeyRange":
if err := awsAwsjson11_deserializeDocumentHashKeyRange(&sv.HashKeyRange, value); err != nil {
return err
}
case "ParentShardId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ShardId to be of type string, got %T instead", value)
}
sv.ParentShardId = ptr.String(jtv)
}
case "SequenceNumberRange":
if err := awsAwsjson11_deserializeDocumentSequenceNumberRange(&sv.SequenceNumberRange, value); err != nil {
return err
}
case "ShardId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ShardId to be of type string, got %T instead", value)
}
sv.ShardId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentShardList(v *[]types.Shard, 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.Shard
if *v == nil {
cv = []types.Shard{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Shard
destAddr := &col
if err := awsAwsjson11_deserializeDocumentShard(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentStreamDescription(v **types.StreamDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StreamDescription
if *v == nil {
sv = &types.StreamDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EncryptionType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value)
}
sv.EncryptionType = types.EncryptionType(jtv)
}
case "EnhancedMonitoring":
if err := awsAwsjson11_deserializeDocumentEnhancedMonitoringList(&sv.EnhancedMonitoring, value); err != nil {
return err
}
case "HasMoreShards":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.HasMoreShards = ptr.Bool(jtv)
}
case "KeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KeyId to be of type string, got %T instead", value)
}
sv.KeyId = ptr.String(jtv)
}
case "RetentionPeriodHours":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RetentionPeriodHours to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RetentionPeriodHours = ptr.Int32(int32(i64))
}
case "Shards":
if err := awsAwsjson11_deserializeDocumentShardList(&sv.Shards, value); err != nil {
return err
}
case "StreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamARN to be of type string, got %T instead", value)
}
sv.StreamARN = ptr.String(jtv)
}
case "StreamCreationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StreamCreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "StreamModeDetails":
if err := awsAwsjson11_deserializeDocumentStreamModeDetails(&sv.StreamModeDetails, value); err != nil {
return err
}
case "StreamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamName to be of type string, got %T instead", value)
}
sv.StreamName = ptr.String(jtv)
}
case "StreamStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamStatus to be of type string, got %T instead", value)
}
sv.StreamStatus = types.StreamStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStreamDescriptionSummary(v **types.StreamDescriptionSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StreamDescriptionSummary
if *v == nil {
sv = &types.StreamDescriptionSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConsumerCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ConsumerCountObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ConsumerCount = ptr.Int32(int32(i64))
}
case "EncryptionType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value)
}
sv.EncryptionType = types.EncryptionType(jtv)
}
case "EnhancedMonitoring":
if err := awsAwsjson11_deserializeDocumentEnhancedMonitoringList(&sv.EnhancedMonitoring, value); err != nil {
return err
}
case "KeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KeyId to be of type string, got %T instead", value)
}
sv.KeyId = ptr.String(jtv)
}
case "OpenShardCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ShardCountObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.OpenShardCount = ptr.Int32(int32(i64))
}
case "RetentionPeriodHours":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected RetentionPeriodHours to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RetentionPeriodHours = ptr.Int32(int32(i64))
}
case "StreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamARN to be of type string, got %T instead", value)
}
sv.StreamARN = ptr.String(jtv)
}
case "StreamCreationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StreamCreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "StreamModeDetails":
if err := awsAwsjson11_deserializeDocumentStreamModeDetails(&sv.StreamModeDetails, value); err != nil {
return err
}
case "StreamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamName to be of type string, got %T instead", value)
}
sv.StreamName = ptr.String(jtv)
}
case "StreamStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamStatus to be of type string, got %T instead", value)
}
sv.StreamStatus = types.StreamStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStreamModeDetails(v **types.StreamModeDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StreamModeDetails
if *v == nil {
sv = &types.StreamModeDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "StreamMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamMode to be of type string, got %T instead", value)
}
sv.StreamMode = types.StreamMode(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStreamNameList(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 StreamName to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentStreamSummary(v **types.StreamSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StreamSummary
if *v == nil {
sv = &types.StreamSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "StreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamARN to be of type string, got %T instead", value)
}
sv.StreamARN = ptr.String(jtv)
}
case "StreamCreationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StreamCreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "StreamModeDetails":
if err := awsAwsjson11_deserializeDocumentStreamModeDetails(&sv.StreamModeDetails, value); err != nil {
return err
}
case "StreamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamName to be of type string, got %T instead", value)
}
sv.StreamName = ptr.String(jtv)
}
case "StreamStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamStatus to be of type string, got %T instead", value)
}
sv.StreamStatus = types.StreamStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStreamSummaryList(v *[]types.StreamSummary, 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.StreamSummary
if *v == nil {
cv = []types.StreamSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.StreamSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentStreamSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
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_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeLimitsOutput(v **DescribeLimitsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeLimitsOutput
if *v == nil {
sv = &DescribeLimitsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "OnDemandStreamCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected OnDemandStreamCountObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.OnDemandStreamCount = ptr.Int32(int32(i64))
}
case "OnDemandStreamCountLimit":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected OnDemandStreamCountLimitObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.OnDemandStreamCountLimit = ptr.Int32(int32(i64))
}
case "OpenShardCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ShardCountObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.OpenShardCount = ptr.Int32(int32(i64))
}
case "ShardLimit":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ShardCountObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ShardLimit = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeStreamConsumerOutput(v **DescribeStreamConsumerOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeStreamConsumerOutput
if *v == nil {
sv = &DescribeStreamConsumerOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConsumerDescription":
if err := awsAwsjson11_deserializeDocumentConsumerDescription(&sv.ConsumerDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeStreamOutput(v **DescribeStreamOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeStreamOutput
if *v == nil {
sv = &DescribeStreamOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "StreamDescription":
if err := awsAwsjson11_deserializeDocumentStreamDescription(&sv.StreamDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeStreamSummaryOutput(v **DescribeStreamSummaryOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeStreamSummaryOutput
if *v == nil {
sv = &DescribeStreamSummaryOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "StreamDescriptionSummary":
if err := awsAwsjson11_deserializeDocumentStreamDescriptionSummary(&sv.StreamDescriptionSummary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDisableEnhancedMonitoringOutput(v **DisableEnhancedMonitoringOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DisableEnhancedMonitoringOutput
if *v == nil {
sv = &DisableEnhancedMonitoringOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CurrentShardLevelMetrics":
if err := awsAwsjson11_deserializeDocumentMetricsNameList(&sv.CurrentShardLevelMetrics, value); err != nil {
return err
}
case "DesiredShardLevelMetrics":
if err := awsAwsjson11_deserializeDocumentMetricsNameList(&sv.DesiredShardLevelMetrics, value); err != nil {
return err
}
case "StreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamARN to be of type string, got %T instead", value)
}
sv.StreamARN = ptr.String(jtv)
}
case "StreamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamName to be of type string, got %T instead", value)
}
sv.StreamName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentEnableEnhancedMonitoringOutput(v **EnableEnhancedMonitoringOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *EnableEnhancedMonitoringOutput
if *v == nil {
sv = &EnableEnhancedMonitoringOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CurrentShardLevelMetrics":
if err := awsAwsjson11_deserializeDocumentMetricsNameList(&sv.CurrentShardLevelMetrics, value); err != nil {
return err
}
case "DesiredShardLevelMetrics":
if err := awsAwsjson11_deserializeDocumentMetricsNameList(&sv.DesiredShardLevelMetrics, value); err != nil {
return err
}
case "StreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamARN to be of type string, got %T instead", value)
}
sv.StreamARN = ptr.String(jtv)
}
case "StreamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamName to be of type string, got %T instead", value)
}
sv.StreamName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetRecordsOutput(v **GetRecordsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetRecordsOutput
if *v == nil {
sv = &GetRecordsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ChildShards":
if err := awsAwsjson11_deserializeDocumentChildShardList(&sv.ChildShards, value); err != nil {
return err
}
case "MillisBehindLatest":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MillisBehindLatest to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MillisBehindLatest = ptr.Int64(i64)
}
case "NextShardIterator":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ShardIterator to be of type string, got %T instead", value)
}
sv.NextShardIterator = ptr.String(jtv)
}
case "Records":
if err := awsAwsjson11_deserializeDocumentRecordList(&sv.Records, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetShardIteratorOutput(v **GetShardIteratorOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetShardIteratorOutput
if *v == nil {
sv = &GetShardIteratorOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ShardIterator":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ShardIterator to be of type string, got %T instead", value)
}
sv.ShardIterator = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListShardsOutput(v **ListShardsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListShardsOutput
if *v == nil {
sv = &ListShardsOutput{}
} 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 "Shards":
if err := awsAwsjson11_deserializeDocumentShardList(&sv.Shards, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListStreamConsumersOutput(v **ListStreamConsumersOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListStreamConsumersOutput
if *v == nil {
sv = &ListStreamConsumersOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Consumers":
if err := awsAwsjson11_deserializeDocumentConsumerList(&sv.Consumers, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListStreamsOutput(v **ListStreamsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListStreamsOutput
if *v == nil {
sv = &ListStreamsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "HasMoreStreams":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.HasMoreStreams = ptr.Bool(jtv)
}
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 "StreamNames":
if err := awsAwsjson11_deserializeDocumentStreamNameList(&sv.StreamNames, value); err != nil {
return err
}
case "StreamSummaries":
if err := awsAwsjson11_deserializeDocumentStreamSummaryList(&sv.StreamSummaries, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForStreamOutput(v **ListTagsForStreamOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForStreamOutput
if *v == nil {
sv = &ListTagsForStreamOutput{}
} 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_deserializeDocumentTagList(&sv.Tags, 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 "EncryptionType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value)
}
sv.EncryptionType = types.EncryptionType(jtv)
}
case "SequenceNumber":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SequenceNumber to be of type string, got %T instead", value)
}
sv.SequenceNumber = ptr.String(jtv)
}
case "ShardId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ShardId to be of type string, got %T instead", value)
}
sv.ShardId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutRecordsOutput(v **PutRecordsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutRecordsOutput
if *v == nil {
sv = &PutRecordsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EncryptionType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EncryptionType to be of type string, got %T instead", value)
}
sv.EncryptionType = types.EncryptionType(jtv)
}
case "FailedRecordCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PositiveIntegerObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.FailedRecordCount = ptr.Int32(int32(i64))
}
case "Records":
if err := awsAwsjson11_deserializeDocumentPutRecordsResultEntryList(&sv.Records, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentRegisterStreamConsumerOutput(v **RegisterStreamConsumerOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RegisterStreamConsumerOutput
if *v == nil {
sv = &RegisterStreamConsumerOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Consumer":
if err := awsAwsjson11_deserializeDocumentConsumer(&sv.Consumer, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateShardCountOutput(v **UpdateShardCountOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateShardCountOutput
if *v == nil {
sv = &UpdateShardCountOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CurrentShardCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PositiveIntegerObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CurrentShardCount = ptr.Int32(int32(i64))
}
case "StreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamARN to be of type string, got %T instead", value)
}
sv.StreamARN = ptr.String(jtv)
}
case "StreamName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StreamName to be of type string, got %T instead", value)
}
sv.StreamName = ptr.String(jtv)
}
case "TargetShardCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PositiveIntegerObject to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TargetShardCount = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 7,281 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package kinesis provides the API client, operations, and parameter types for
// Amazon Kinesis.
//
// Amazon Kinesis Data Streams Service API Reference Amazon Kinesis Data Streams
// is a managed service that scales elastically for real-time processing of
// streaming big data.
package kinesis
| 10 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
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/kinesis/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 = "kinesis"
}
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 smithy-go-codegen DO NOT EDIT.
package kinesis
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/service/kinesis/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithysync "github.com/aws/smithy-go/sync"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"io/ioutil"
"sync"
)
// SubscribeToShardEventStreamReader provides the interface for reading events
// from a stream.
//
// The writer's Close method must allow multiple concurrent calls.
type SubscribeToShardEventStreamReader interface {
Events() <-chan types.SubscribeToShardEventStream
Close() error
Err() error
}
type subscribeToShardEventStreamReadEvent interface {
isSubscribeToShardEventStreamReadEvent()
}
type subscribeToShardEventStreamReadEventMessage struct {
Value types.SubscribeToShardEventStream
}
func (*subscribeToShardEventStreamReadEventMessage) isSubscribeToShardEventStreamReadEvent() {}
type subscribeToShardEventStreamReadEventInitialResponse struct {
Value interface{}
}
func (*subscribeToShardEventStreamReadEventInitialResponse) isSubscribeToShardEventStreamReadEvent() {
}
type subscribeToShardEventStreamReader struct {
stream chan types.SubscribeToShardEventStream
decoder *eventstream.Decoder
eventStream io.ReadCloser
err *smithysync.OnceErr
payloadBuf []byte
done chan struct{}
closeOnce sync.Once
initialResponseDeserializer func(*eventstream.Message) (interface{}, error)
initialResponse chan interface{}
}
func newSubscribeToShardEventStreamReader(readCloser io.ReadCloser, decoder *eventstream.Decoder, ird func(*eventstream.Message) (interface{}, error)) *subscribeToShardEventStreamReader {
w := &subscribeToShardEventStreamReader{
stream: make(chan types.SubscribeToShardEventStream),
decoder: decoder,
eventStream: readCloser,
err: smithysync.NewOnceErr(),
done: make(chan struct{}),
payloadBuf: make([]byte, 10*1024),
initialResponseDeserializer: ird,
initialResponse: make(chan interface{}, 1),
}
go w.readEventStream()
return w
}
func (r *subscribeToShardEventStreamReader) Events() <-chan types.SubscribeToShardEventStream {
return r.stream
}
func (r *subscribeToShardEventStreamReader) readEventStream() {
defer r.Close()
defer close(r.stream)
defer close(r.initialResponse)
for {
r.payloadBuf = r.payloadBuf[0:0]
decodedMessage, err := r.decoder.Decode(r.eventStream, r.payloadBuf)
if err != nil {
if err == io.EOF {
return
}
select {
case <-r.done:
return
default:
r.err.SetError(err)
return
}
}
event, err := r.deserializeEventMessage(&decodedMessage)
if err != nil {
r.err.SetError(err)
return
}
switch ev := event.(type) {
case *subscribeToShardEventStreamReadEventInitialResponse:
select {
case r.initialResponse <- ev.Value:
case <-r.done:
return
default:
}
case *subscribeToShardEventStreamReadEventMessage:
select {
case r.stream <- ev.Value:
case <-r.done:
return
}
default:
r.err.SetError(fmt.Errorf("unexpected event wrapper: %T", event))
return
}
}
}
func (r *subscribeToShardEventStreamReader) deserializeEventMessage(msg *eventstream.Message) (subscribeToShardEventStreamReadEvent, error) {
messageType := msg.Headers.Get(eventstreamapi.MessageTypeHeader)
if messageType == nil {
return nil, fmt.Errorf("%s event header not present", eventstreamapi.MessageTypeHeader)
}
switch messageType.String() {
case eventstreamapi.EventMessageType:
eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader)
if eventType == nil {
return nil, fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader)
}
if eventType.String() == "initial-response" {
v, err := r.initialResponseDeserializer(msg)
if err != nil {
return nil, err
}
return &subscribeToShardEventStreamReadEventInitialResponse{Value: v}, nil
}
var v types.SubscribeToShardEventStream
if err := awsAwsjson11_deserializeEventStreamSubscribeToShardEventStream(&v, msg); err != nil {
return nil, err
}
return &subscribeToShardEventStreamReadEventMessage{Value: v}, nil
case eventstreamapi.ExceptionMessageType:
return nil, awsAwsjson11_deserializeEventStreamExceptionSubscribeToShardEventStream(msg)
case eventstreamapi.ErrorMessageType:
errorCode := "UnknownError"
errorMessage := errorCode
if header := msg.Headers.Get(eventstreamapi.ErrorCodeHeader); header != nil {
errorCode = header.String()
}
if header := msg.Headers.Get(eventstreamapi.ErrorMessageHeader); header != nil {
errorMessage = header.String()
}
return nil, &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
default:
mc := msg.Clone()
return nil, &UnknownEventMessageError{
Type: messageType.String(),
Message: &mc,
}
}
}
func (r *subscribeToShardEventStreamReader) ErrorSet() <-chan struct{} {
return r.err.ErrorSet()
}
func (r *subscribeToShardEventStreamReader) Close() error {
r.closeOnce.Do(r.safeClose)
return r.Err()
}
func (r *subscribeToShardEventStreamReader) safeClose() {
close(r.done)
r.eventStream.Close()
}
func (r *subscribeToShardEventStreamReader) Err() error {
return r.err.Err()
}
func (r *subscribeToShardEventStreamReader) Closed() <-chan struct{} {
return r.done
}
type awsAwsjson11_deserializeOpEventStreamSubscribeToShard struct {
LogEventStreamWrites bool
LogEventStreamReads bool
}
func (*awsAwsjson11_deserializeOpEventStreamSubscribeToShard) ID() string {
return "OperationEventStreamDeserializer"
}
func (m *awsAwsjson11_deserializeOpEventStreamSubscribeToShard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
defer func() {
if err == nil {
return
}
m.closeResponseBody(out)
}()
logger := middleware.GetLogger(ctx)
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", in.Request)
}
_ = request
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
deserializeOutput, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse)
}
_ = deserializeOutput
output, ok := out.Result.(*SubscribeToShardOutput)
if out.Result != nil && !ok {
return out, metadata, fmt.Errorf("unexpected output result type: %T", out.Result)
} else if out.Result == nil {
output = &SubscribeToShardOutput{}
out.Result = output
}
eventReader := newSubscribeToShardEventStreamReader(
deserializeOutput.Body,
eventstream.NewDecoder(func(options *eventstream.DecoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamReads
}),
awsAwsjson11_deserializeEventMessageResponseSubscribeToShardOutput,
)
defer func() {
if err == nil {
return
}
_ = eventReader.Close()
}()
ir := <-eventReader.initialResponse
irv, ok := ir.(*SubscribeToShardOutput)
if !ok {
return out, metadata, fmt.Errorf("unexpected output result type: %T", ir)
}
*output = *irv
output.eventStream = NewSubscribeToShardEventStream(func(stream *SubscribeToShardEventStream) {
stream.Reader = eventReader
})
go output.eventStream.waitStreamClose()
return out, metadata, nil
}
func (*awsAwsjson11_deserializeOpEventStreamSubscribeToShard) closeResponseBody(out middleware.DeserializeOutput) {
if resp, ok := out.RawResponse.(*smithyhttp.Response); ok && resp != nil && resp.Body != nil {
_, _ = io.Copy(ioutil.Discard, resp.Body)
_ = resp.Body.Close()
}
}
func addEventStreamSubscribeToShardMiddleware(stack *middleware.Stack, options Options) error {
if err := stack.Deserialize.Insert(&awsAwsjson11_deserializeOpEventStreamSubscribeToShard{
LogEventStreamWrites: options.ClientLogMode.IsRequestEventMessage(),
LogEventStreamReads: options.ClientLogMode.IsResponseEventMessage(),
}, "OperationDeserializer", middleware.Before); err != nil {
return err
}
return nil
}
// UnknownEventMessageError provides an error when a message is received from the stream,
// but the reader is unable to determine what kind of message it is.
type UnknownEventMessageError struct {
Type string
Message *eventstream.Message
}
// Error retruns the error message string.
func (e *UnknownEventMessageError) Error() string {
return "unknown event stream message type, " + e.Type
}
func setSafeEventStreamClientLogMode(o *Options, operation string) {
switch operation {
case "SubscribeToShard":
toggleEventStreamClientLogMode(o, false, true)
return
default:
return
}
}
func toggleEventStreamClientLogMode(o *Options, request, response bool) {
mode := o.ClientLogMode
if request && mode.IsRequestWithBody() {
mode.ClearRequestWithBody()
mode |= aws.LogRequest
}
if response && mode.IsResponseWithBody() {
mode.ClearResponseWithBody()
mode |= aws.LogResponse
}
o.ClientLogMode = mode
}
| 343 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package kinesis
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.17.14"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/kinesis/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"path"
)
type awsAwsjson11_serializeOpAddTagsToStream struct {
}
func (*awsAwsjson11_serializeOpAddTagsToStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddTagsToStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddTagsToStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.AddTagsToStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddTagsToStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateStream struct {
}
func (*awsAwsjson11_serializeOpCreateStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.CreateStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDecreaseStreamRetentionPeriod struct {
}
func (*awsAwsjson11_serializeOpDecreaseStreamRetentionPeriod) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDecreaseStreamRetentionPeriod) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DecreaseStreamRetentionPeriodInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.DecreaseStreamRetentionPeriod")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDecreaseStreamRetentionPeriodInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteStream struct {
}
func (*awsAwsjson11_serializeOpDeleteStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.DeleteStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeregisterStreamConsumer struct {
}
func (*awsAwsjson11_serializeOpDeregisterStreamConsumer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeregisterStreamConsumer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeregisterStreamConsumerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.DeregisterStreamConsumer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeregisterStreamConsumerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeLimits struct {
}
func (*awsAwsjson11_serializeOpDescribeLimits) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeLimits) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeLimitsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.DescribeLimits")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeLimitsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeStream struct {
}
func (*awsAwsjson11_serializeOpDescribeStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.DescribeStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeStreamConsumer struct {
}
func (*awsAwsjson11_serializeOpDescribeStreamConsumer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeStreamConsumer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStreamConsumerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.DescribeStreamConsumer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeStreamConsumerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeStreamSummary struct {
}
func (*awsAwsjson11_serializeOpDescribeStreamSummary) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeStreamSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStreamSummaryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.DescribeStreamSummary")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeStreamSummaryInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDisableEnhancedMonitoring struct {
}
func (*awsAwsjson11_serializeOpDisableEnhancedMonitoring) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDisableEnhancedMonitoring) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DisableEnhancedMonitoringInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.DisableEnhancedMonitoring")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDisableEnhancedMonitoringInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpEnableEnhancedMonitoring struct {
}
func (*awsAwsjson11_serializeOpEnableEnhancedMonitoring) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpEnableEnhancedMonitoring) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*EnableEnhancedMonitoringInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.EnableEnhancedMonitoring")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentEnableEnhancedMonitoringInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetRecords struct {
}
func (*awsAwsjson11_serializeOpGetRecords) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetRecords) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetRecordsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.GetRecords")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetRecordsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetShardIterator struct {
}
func (*awsAwsjson11_serializeOpGetShardIterator) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetShardIterator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetShardIteratorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.GetShardIterator")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetShardIteratorInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpIncreaseStreamRetentionPeriod struct {
}
func (*awsAwsjson11_serializeOpIncreaseStreamRetentionPeriod) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpIncreaseStreamRetentionPeriod) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*IncreaseStreamRetentionPeriodInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.IncreaseStreamRetentionPeriod")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentIncreaseStreamRetentionPeriodInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListShards struct {
}
func (*awsAwsjson11_serializeOpListShards) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListShards) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListShardsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.ListShards")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListShardsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListStreamConsumers struct {
}
func (*awsAwsjson11_serializeOpListStreamConsumers) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListStreamConsumers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListStreamConsumersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.ListStreamConsumers")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListStreamConsumersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListStreams struct {
}
func (*awsAwsjson11_serializeOpListStreams) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListStreams) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListStreamsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.ListStreams")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListStreamsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForStream struct {
}
func (*awsAwsjson11_serializeOpListTagsForStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.ListTagsForStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpMergeShards struct {
}
func (*awsAwsjson11_serializeOpMergeShards) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpMergeShards) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*MergeShardsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.MergeShards")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentMergeShardsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, 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("Kinesis_20131202.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_serializeOpPutRecords struct {
}
func (*awsAwsjson11_serializeOpPutRecords) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutRecords) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutRecordsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.PutRecords")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutRecordsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRegisterStreamConsumer struct {
}
func (*awsAwsjson11_serializeOpRegisterStreamConsumer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRegisterStreamConsumer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RegisterStreamConsumerInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.RegisterStreamConsumer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRegisterStreamConsumerInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRemoveTagsFromStream struct {
}
func (*awsAwsjson11_serializeOpRemoveTagsFromStream) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRemoveTagsFromStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RemoveTagsFromStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.RemoveTagsFromStream")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRemoveTagsFromStreamInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSplitShard struct {
}
func (*awsAwsjson11_serializeOpSplitShard) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSplitShard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SplitShardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.SplitShard")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSplitShardInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStartStreamEncryption struct {
}
func (*awsAwsjson11_serializeOpStartStreamEncryption) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartStreamEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartStreamEncryptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.StartStreamEncryption")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartStreamEncryptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStopStreamEncryption struct {
}
func (*awsAwsjson11_serializeOpStopStreamEncryption) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopStreamEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopStreamEncryptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.StopStreamEncryption")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopStreamEncryptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSubscribeToShard struct {
}
func (*awsAwsjson11_serializeOpSubscribeToShard) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSubscribeToShard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SubscribeToShardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.SubscribeToShard")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSubscribeToShardInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateShardCount struct {
}
func (*awsAwsjson11_serializeOpUpdateShardCount) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateShardCount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateShardCountInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.UpdateShardCount")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateShardCountInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateStreamMode struct {
}
func (*awsAwsjson11_serializeOpUpdateStreamMode) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateStreamMode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateStreamModeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("Kinesis_20131202.UpdateStreamMode")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateStreamModeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if 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_serializeDocumentMetricsNameList(v []types.MetricsName, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentPutRecordsRequestEntry(v *types.PutRecordsRequestEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("Data")
ok.Base64EncodeBytes(v.Data)
}
if v.ExplicitHashKey != nil {
ok := object.Key("ExplicitHashKey")
ok.String(*v.ExplicitHashKey)
}
if v.PartitionKey != nil {
ok := object.Key("PartitionKey")
ok.String(*v.PartitionKey)
}
return nil
}
func awsAwsjson11_serializeDocumentPutRecordsRequestEntryList(v []types.PutRecordsRequestEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentPutRecordsRequestEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentShardFilter(v *types.ShardFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ShardId != nil {
ok := object.Key("ShardId")
ok.String(*v.ShardId)
}
if v.Timestamp != nil {
ok := object.Key("Timestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.Timestamp))
}
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentStartingPosition(v *types.StartingPosition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SequenceNumber != nil {
ok := object.Key("SequenceNumber")
ok.String(*v.SequenceNumber)
}
if v.Timestamp != nil {
ok := object.Key("Timestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.Timestamp))
}
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentStreamModeDetails(v *types.StreamModeDetails, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.StreamMode) > 0 {
ok := object.Key("StreamMode")
ok.String(string(v.StreamMode))
}
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_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 awsAwsjson11_serializeOpDocumentAddTagsToStreamInput(v *AddTagsToStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateStreamInput(v *CreateStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ShardCount != nil {
ok := object.Key("ShardCount")
ok.Integer(*v.ShardCount)
}
if v.StreamModeDetails != nil {
ok := object.Key("StreamModeDetails")
if err := awsAwsjson11_serializeDocumentStreamModeDetails(v.StreamModeDetails, ok); err != nil {
return err
}
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDecreaseStreamRetentionPeriodInput(v *DecreaseStreamRetentionPeriodInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RetentionPeriodHours != nil {
ok := object.Key("RetentionPeriodHours")
ok.Integer(*v.RetentionPeriodHours)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteStreamInput(v *DeleteStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EnforceConsumerDeletion != nil {
ok := object.Key("EnforceConsumerDeletion")
ok.Boolean(*v.EnforceConsumerDeletion)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeregisterStreamConsumerInput(v *DeregisterStreamConsumerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConsumerARN != nil {
ok := object.Key("ConsumerARN")
ok.String(*v.ConsumerARN)
}
if v.ConsumerName != nil {
ok := object.Key("ConsumerName")
ok.String(*v.ConsumerName)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeLimitsInput(v *DescribeLimitsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeStreamConsumerInput(v *DescribeStreamConsumerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConsumerARN != nil {
ok := object.Key("ConsumerARN")
ok.String(*v.ConsumerARN)
}
if v.ConsumerName != nil {
ok := object.Key("ConsumerName")
ok.String(*v.ConsumerName)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeStreamInput(v *DescribeStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExclusiveStartShardId != nil {
ok := object.Key("ExclusiveStartShardId")
ok.String(*v.ExclusiveStartShardId)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeStreamSummaryInput(v *DescribeStreamSummaryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDisableEnhancedMonitoringInput(v *DisableEnhancedMonitoringInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ShardLevelMetrics != nil {
ok := object.Key("ShardLevelMetrics")
if err := awsAwsjson11_serializeDocumentMetricsNameList(v.ShardLevelMetrics, ok); err != nil {
return err
}
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentEnableEnhancedMonitoringInput(v *EnableEnhancedMonitoringInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ShardLevelMetrics != nil {
ok := object.Key("ShardLevelMetrics")
if err := awsAwsjson11_serializeDocumentMetricsNameList(v.ShardLevelMetrics, ok); err != nil {
return err
}
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetRecordsInput(v *GetRecordsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.ShardIterator != nil {
ok := object.Key("ShardIterator")
ok.String(*v.ShardIterator)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetShardIteratorInput(v *GetShardIteratorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ShardId != nil {
ok := object.Key("ShardId")
ok.String(*v.ShardId)
}
if len(v.ShardIteratorType) > 0 {
ok := object.Key("ShardIteratorType")
ok.String(string(v.ShardIteratorType))
}
if v.StartingSequenceNumber != nil {
ok := object.Key("StartingSequenceNumber")
ok.String(*v.StartingSequenceNumber)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
if v.Timestamp != nil {
ok := object.Key("Timestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.Timestamp))
}
return nil
}
func awsAwsjson11_serializeOpDocumentIncreaseStreamRetentionPeriodInput(v *IncreaseStreamRetentionPeriodInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RetentionPeriodHours != nil {
ok := object.Key("RetentionPeriodHours")
ok.Integer(*v.RetentionPeriodHours)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListShardsInput(v *ListShardsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExclusiveStartShardId != nil {
ok := object.Key("ExclusiveStartShardId")
ok.String(*v.ExclusiveStartShardId)
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if v.ShardFilter != nil {
ok := object.Key("ShardFilter")
if err := awsAwsjson11_serializeDocumentShardFilter(v.ShardFilter, ok); err != nil {
return err
}
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamCreationTimestamp != nil {
ok := object.Key("StreamCreationTimestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.StreamCreationTimestamp))
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListStreamConsumersInput(v *ListStreamConsumersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamCreationTimestamp != nil {
ok := object.Key("StreamCreationTimestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.StreamCreationTimestamp))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListStreamsInput(v *ListStreamsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExclusiveStartStreamName != nil {
ok := object.Key("ExclusiveStartStreamName")
ok.String(*v.ExclusiveStartStreamName)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForStreamInput(v *ListTagsForStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExclusiveStartTagKey != nil {
ok := object.Key("ExclusiveStartTagKey")
ok.String(*v.ExclusiveStartTagKey)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentMergeShardsInput(v *MergeShardsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdjacentShardToMerge != nil {
ok := object.Key("AdjacentShardToMerge")
ok.String(*v.AdjacentShardToMerge)
}
if v.ShardToMerge != nil {
ok := object.Key("ShardToMerge")
ok.String(*v.ShardToMerge)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutRecordInput(v *PutRecordInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("Data")
ok.Base64EncodeBytes(v.Data)
}
if v.ExplicitHashKey != nil {
ok := object.Key("ExplicitHashKey")
ok.String(*v.ExplicitHashKey)
}
if v.PartitionKey != nil {
ok := object.Key("PartitionKey")
ok.String(*v.PartitionKey)
}
if v.SequenceNumberForOrdering != nil {
ok := object.Key("SequenceNumberForOrdering")
ok.String(*v.SequenceNumberForOrdering)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutRecordsInput(v *PutRecordsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Records != nil {
ok := object.Key("Records")
if err := awsAwsjson11_serializeDocumentPutRecordsRequestEntryList(v.Records, ok); err != nil {
return err
}
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRegisterStreamConsumerInput(v *RegisterStreamConsumerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConsumerName != nil {
ok := object.Key("ConsumerName")
ok.String(*v.ConsumerName)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRemoveTagsFromStreamInput(v *RemoveTagsFromStreamInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentSplitShardInput(v *SplitShardInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NewStartingHashKey != nil {
ok := object.Key("NewStartingHashKey")
ok.String(*v.NewStartingHashKey)
}
if v.ShardToSplit != nil {
ok := object.Key("ShardToSplit")
ok.String(*v.ShardToSplit)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartStreamEncryptionInput(v *StartStreamEncryptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.EncryptionType) > 0 {
ok := object.Key("EncryptionType")
ok.String(string(v.EncryptionType))
}
if v.KeyId != nil {
ok := object.Key("KeyId")
ok.String(*v.KeyId)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopStreamEncryptionInput(v *StopStreamEncryptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.EncryptionType) > 0 {
ok := object.Key("EncryptionType")
ok.String(string(v.EncryptionType))
}
if v.KeyId != nil {
ok := object.Key("KeyId")
ok.String(*v.KeyId)
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSubscribeToShardInput(v *SubscribeToShardInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConsumerARN != nil {
ok := object.Key("ConsumerARN")
ok.String(*v.ConsumerARN)
}
if v.ShardId != nil {
ok := object.Key("ShardId")
ok.String(*v.ShardId)
}
if v.StartingPosition != nil {
ok := object.Key("StartingPosition")
if err := awsAwsjson11_serializeDocumentStartingPosition(v.StartingPosition, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateShardCountInput(v *UpdateShardCountInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ScalingType) > 0 {
ok := object.Key("ScalingType")
ok.String(string(v.ScalingType))
}
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamName != nil {
ok := object.Key("StreamName")
ok.String(*v.StreamName)
}
if v.TargetShardCount != nil {
ok := object.Key("TargetShardCount")
ok.Integer(*v.TargetShardCount)
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateStreamModeInput(v *UpdateStreamModeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StreamARN != nil {
ok := object.Key("StreamARN")
ok.String(*v.StreamARN)
}
if v.StreamModeDetails != nil {
ok := object.Key("StreamModeDetails")
if err := awsAwsjson11_serializeDocumentStreamModeDetails(v.StreamModeDetails, ok); err != nil {
return err
}
}
return nil
}
| 2,452 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesis
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/kinesis/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAddTagsToStream struct {
}
func (*validateOpAddTagsToStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddTagsToStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddTagsToStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddTagsToStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateStream struct {
}
func (*validateOpCreateStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDecreaseStreamRetentionPeriod struct {
}
func (*validateOpDecreaseStreamRetentionPeriod) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDecreaseStreamRetentionPeriod) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DecreaseStreamRetentionPeriodInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDecreaseStreamRetentionPeriodInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDisableEnhancedMonitoring struct {
}
func (*validateOpDisableEnhancedMonitoring) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDisableEnhancedMonitoring) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DisableEnhancedMonitoringInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDisableEnhancedMonitoringInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpEnableEnhancedMonitoring struct {
}
func (*validateOpEnableEnhancedMonitoring) ID() string {
return "OperationInputValidation"
}
func (m *validateOpEnableEnhancedMonitoring) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*EnableEnhancedMonitoringInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpEnableEnhancedMonitoringInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRecords struct {
}
func (*validateOpGetRecords) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRecords) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRecordsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRecordsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetShardIterator struct {
}
func (*validateOpGetShardIterator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetShardIterator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetShardIteratorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetShardIteratorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpIncreaseStreamRetentionPeriod struct {
}
func (*validateOpIncreaseStreamRetentionPeriod) ID() string {
return "OperationInputValidation"
}
func (m *validateOpIncreaseStreamRetentionPeriod) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*IncreaseStreamRetentionPeriodInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpIncreaseStreamRetentionPeriodInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListShards struct {
}
func (*validateOpListShards) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListShards) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListShardsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListShardsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListStreamConsumers struct {
}
func (*validateOpListStreamConsumers) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListStreamConsumers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListStreamConsumersInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListStreamConsumersInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpMergeShards struct {
}
func (*validateOpMergeShards) ID() string {
return "OperationInputValidation"
}
func (m *validateOpMergeShards) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*MergeShardsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpMergeShardsInput(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 validateOpPutRecords struct {
}
func (*validateOpPutRecords) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutRecords) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutRecordsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutRecordsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRegisterStreamConsumer struct {
}
func (*validateOpRegisterStreamConsumer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRegisterStreamConsumer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RegisterStreamConsumerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRegisterStreamConsumerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveTagsFromStream struct {
}
func (*validateOpRemoveTagsFromStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveTagsFromStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveTagsFromStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveTagsFromStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSplitShard struct {
}
func (*validateOpSplitShard) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSplitShard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SplitShardInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSplitShardInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartStreamEncryption struct {
}
func (*validateOpStartStreamEncryption) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartStreamEncryption) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartStreamEncryptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartStreamEncryptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopStreamEncryption struct {
}
func (*validateOpStopStreamEncryption) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopStreamEncryption) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopStreamEncryptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopStreamEncryptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSubscribeToShard struct {
}
func (*validateOpSubscribeToShard) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSubscribeToShard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SubscribeToShardInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSubscribeToShardInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateShardCount struct {
}
func (*validateOpUpdateShardCount) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateShardCount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateShardCountInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateShardCountInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateStreamMode struct {
}
func (*validateOpUpdateStreamMode) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateStreamMode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateStreamModeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateStreamModeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAddTagsToStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddTagsToStream{}, middleware.After)
}
func addOpCreateStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateStream{}, middleware.After)
}
func addOpDecreaseStreamRetentionPeriodValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDecreaseStreamRetentionPeriod{}, middleware.After)
}
func addOpDisableEnhancedMonitoringValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDisableEnhancedMonitoring{}, middleware.After)
}
func addOpEnableEnhancedMonitoringValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpEnableEnhancedMonitoring{}, middleware.After)
}
func addOpGetRecordsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRecords{}, middleware.After)
}
func addOpGetShardIteratorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetShardIterator{}, middleware.After)
}
func addOpIncreaseStreamRetentionPeriodValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpIncreaseStreamRetentionPeriod{}, middleware.After)
}
func addOpListShardsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListShards{}, middleware.After)
}
func addOpListStreamConsumersValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListStreamConsumers{}, middleware.After)
}
func addOpMergeShardsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpMergeShards{}, middleware.After)
}
func addOpPutRecordValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutRecord{}, middleware.After)
}
func addOpPutRecordsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutRecords{}, middleware.After)
}
func addOpRegisterStreamConsumerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRegisterStreamConsumer{}, middleware.After)
}
func addOpRemoveTagsFromStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveTagsFromStream{}, middleware.After)
}
func addOpSplitShardValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSplitShard{}, middleware.After)
}
func addOpStartStreamEncryptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartStreamEncryption{}, middleware.After)
}
func addOpStopStreamEncryptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopStreamEncryption{}, middleware.After)
}
func addOpSubscribeToShardValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSubscribeToShard{}, middleware.After)
}
func addOpUpdateShardCountValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateShardCount{}, middleware.After)
}
func addOpUpdateStreamModeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateStreamMode{}, middleware.After)
}
func validatePutRecordsRequestEntry(v *types.PutRecordsRequestEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutRecordsRequestEntry"}
if v.Data == nil {
invalidParams.Add(smithy.NewErrParamRequired("Data"))
}
if v.PartitionKey == nil {
invalidParams.Add(smithy.NewErrParamRequired("PartitionKey"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePutRecordsRequestEntryList(v []types.PutRecordsRequestEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutRecordsRequestEntryList"}
for i := range v {
if err := validatePutRecordsRequestEntry(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateShardFilter(v *types.ShardFilter) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ShardFilter"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStartingPosition(v *types.StartingPosition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartingPosition"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStreamModeDetails(v *types.StreamModeDetails) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StreamModeDetails"}
if len(v.StreamMode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("StreamMode"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddTagsToStreamInput(v *AddTagsToStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddTagsToStreamInput"}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateStreamInput(v *CreateStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateStreamInput"}
if v.StreamName == nil {
invalidParams.Add(smithy.NewErrParamRequired("StreamName"))
}
if v.StreamModeDetails != nil {
if err := validateStreamModeDetails(v.StreamModeDetails); err != nil {
invalidParams.AddNested("StreamModeDetails", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDecreaseStreamRetentionPeriodInput(v *DecreaseStreamRetentionPeriodInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DecreaseStreamRetentionPeriodInput"}
if v.RetentionPeriodHours == nil {
invalidParams.Add(smithy.NewErrParamRequired("RetentionPeriodHours"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDisableEnhancedMonitoringInput(v *DisableEnhancedMonitoringInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DisableEnhancedMonitoringInput"}
if v.ShardLevelMetrics == nil {
invalidParams.Add(smithy.NewErrParamRequired("ShardLevelMetrics"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpEnableEnhancedMonitoringInput(v *EnableEnhancedMonitoringInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EnableEnhancedMonitoringInput"}
if v.ShardLevelMetrics == nil {
invalidParams.Add(smithy.NewErrParamRequired("ShardLevelMetrics"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRecordsInput(v *GetRecordsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRecordsInput"}
if v.ShardIterator == nil {
invalidParams.Add(smithy.NewErrParamRequired("ShardIterator"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetShardIteratorInput(v *GetShardIteratorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetShardIteratorInput"}
if v.ShardId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ShardId"))
}
if len(v.ShardIteratorType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ShardIteratorType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpIncreaseStreamRetentionPeriodInput(v *IncreaseStreamRetentionPeriodInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IncreaseStreamRetentionPeriodInput"}
if v.RetentionPeriodHours == nil {
invalidParams.Add(smithy.NewErrParamRequired("RetentionPeriodHours"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListShardsInput(v *ListShardsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListShardsInput"}
if v.ShardFilter != nil {
if err := validateShardFilter(v.ShardFilter); err != nil {
invalidParams.AddNested("ShardFilter", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListStreamConsumersInput(v *ListStreamConsumersInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListStreamConsumersInput"}
if v.StreamARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("StreamARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpMergeShardsInput(v *MergeShardsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MergeShardsInput"}
if v.ShardToMerge == nil {
invalidParams.Add(smithy.NewErrParamRequired("ShardToMerge"))
}
if v.AdjacentShardToMerge == nil {
invalidParams.Add(smithy.NewErrParamRequired("AdjacentShardToMerge"))
}
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.Data == nil {
invalidParams.Add(smithy.NewErrParamRequired("Data"))
}
if v.PartitionKey == nil {
invalidParams.Add(smithy.NewErrParamRequired("PartitionKey"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutRecordsInput(v *PutRecordsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutRecordsInput"}
if v.Records == nil {
invalidParams.Add(smithy.NewErrParamRequired("Records"))
} else if v.Records != nil {
if err := validatePutRecordsRequestEntryList(v.Records); err != nil {
invalidParams.AddNested("Records", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRegisterStreamConsumerInput(v *RegisterStreamConsumerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegisterStreamConsumerInput"}
if v.StreamARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("StreamARN"))
}
if v.ConsumerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConsumerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveTagsFromStreamInput(v *RemoveTagsFromStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveTagsFromStreamInput"}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSplitShardInput(v *SplitShardInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SplitShardInput"}
if v.ShardToSplit == nil {
invalidParams.Add(smithy.NewErrParamRequired("ShardToSplit"))
}
if v.NewStartingHashKey == nil {
invalidParams.Add(smithy.NewErrParamRequired("NewStartingHashKey"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartStreamEncryptionInput(v *StartStreamEncryptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartStreamEncryptionInput"}
if len(v.EncryptionType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("EncryptionType"))
}
if v.KeyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopStreamEncryptionInput(v *StopStreamEncryptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopStreamEncryptionInput"}
if len(v.EncryptionType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("EncryptionType"))
}
if v.KeyId == nil {
invalidParams.Add(smithy.NewErrParamRequired("KeyId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSubscribeToShardInput(v *SubscribeToShardInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SubscribeToShardInput"}
if v.ConsumerARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConsumerARN"))
}
if v.ShardId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ShardId"))
}
if v.StartingPosition == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartingPosition"))
} else if v.StartingPosition != nil {
if err := validateStartingPosition(v.StartingPosition); err != nil {
invalidParams.AddNested("StartingPosition", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateShardCountInput(v *UpdateShardCountInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateShardCountInput"}
if v.TargetShardCount == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetShardCount"))
}
if len(v.ScalingType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ScalingType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateStreamModeInput(v *UpdateStreamModeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateStreamModeInput"}
if v.StreamARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("StreamARN"))
}
if v.StreamModeDetails == nil {
invalidParams.Add(smithy.NewErrParamRequired("StreamModeDetails"))
} else if v.StreamModeDetails != nil {
if err := validateStreamModeDetails(v.StreamModeDetails); err != nil {
invalidParams.AddNested("StreamModeDetails", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 963 |
aws-sdk-go-v2 | aws | Go | package customizations
import (
"time"
)
// ReadTimeoutDuration is the read timeout that will be set for certain kinesis operations.
var ReadTimeoutDuration = 5 * time.Second
| 9 |
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 Kinesis 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: "kinesis.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "kinesis-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesis.{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: "kinesis-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: "kinesis-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: "kinesis-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: "kinesis-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: "kinesis-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "kinesis.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "kinesis-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesis.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesis.{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: "kinesis-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesis.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-isob-east-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesis.{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: "kinesis-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesis.{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: "kinesis.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "kinesis-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesis.{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: "kinesis.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: "kinesis.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{
Hostname: "kinesis.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "kinesis.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesis.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
},
},
},
}
| 515 |
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 | package testing
import (
"bytes"
"context"
"errors"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/service/internal/eventstreamtesting"
"github.com/aws/aws-sdk-go-v2/service/kinesis"
"github.com/aws/aws-sdk-go-v2/service/kinesis/types"
"github.com/aws/smithy-go"
"github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/middleware"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"testing"
)
func removeValidationMiddleware(stack *middleware.Stack) error {
_, err := stack.Initialize.Remove("OperationInputValidation")
return err
}
func TestSubscribeToShard_Read(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("initial-response"),
},
},
Payload: []byte(`{}`),
},
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("SubscribeToShardEvent"),
},
},
Payload: []byte(`{
"ContinuationSequenceNumber": "01234"
}`),
},
},
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := kinesis.NewFromConfig(cfg)
resp, err := svc.SubscribeToShard(context.Background(),
&kinesis.SubscribeToShardInput{}, func(options *kinesis.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
expectEvents := []types.SubscribeToShardEventStream{
&types.SubscribeToShardEventStreamMemberSubscribeToShardEvent{
Value: types.SubscribeToShardEvent{ContinuationSequenceNumber: aws.String("01234")},
},
}
for i := 0; i < len(expectEvents); i++ {
event := <-resp.GetStream().Events()
if event == nil {
t.Errorf("%d, expect event, got nil", i)
}
if diff := cmp.Diff(expectEvents[i], event, cmpopts.IgnoreTypes(document.NoSerde{})); len(diff) > 0 {
t.Errorf("%d, %v", i, diff)
}
}
if err := resp.GetStream().Err(); err != nil {
t.Errorf("expect no error, %v", err)
}
}
func TestSubscribeToShard_ReadClose(t *testing.T) {
sess, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("initial-response"),
},
},
Payload: []byte(`{}`),
},
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("SubscribeToShardEvent"),
},
},
Payload: []byte(`{
"ContinuationSequenceNumber": "01234"
}`),
},
},
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := kinesis.NewFromConfig(sess)
resp, err := svc.SubscribeToShard(context.Background(), &kinesis.SubscribeToShardInput{}, func(options *kinesis.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
// Assert calling Err before close does not close the stream.
resp.GetStream().Err()
select {
case _, ok := <-resp.GetStream().Events():
if !ok {
t.Fatalf("expect stream not to be closed, but was")
}
default:
}
resp.GetStream().Close()
<-resp.GetStream().Events()
if err := resp.GetStream().Err(); err != nil {
t.Errorf("expect no error, %v", err)
}
}
func TestSubscribeToShard_ReadUnknownEvent(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("initial-response"),
},
},
Payload: []byte(`{}`),
},
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("SubscribeToShardEvent"),
},
},
Payload: []byte(`{
"ContinuationSequenceNumber": "01234"
}`),
},
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("UnknownEventName"),
},
},
Payload: []byte(`{}`),
},
},
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := kinesis.NewFromConfig(cfg)
resp, err := svc.SubscribeToShard(context.Background(), &kinesis.SubscribeToShardInput{}, func(options *kinesis.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
expectEvents := []types.SubscribeToShardEventStream{
&types.SubscribeToShardEventStreamMemberSubscribeToShardEvent{
Value: types.SubscribeToShardEvent{ContinuationSequenceNumber: aws.String("01234")},
},
&types.UnknownUnionMember{Tag: "UnknownEventName", Value: func() []byte {
encoder := eventstream.NewEncoder()
buff := bytes.NewBuffer(nil)
encoder.Encode(buff, eventstream.Message{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("UnknownEventName"),
},
},
Payload: []byte(`{}`)})
return buff.Bytes()
}()},
}
for i := 0; i < len(expectEvents); i++ {
event := <-resp.GetStream().Events()
if event == nil {
t.Errorf("%d, expect event, got nil", i)
}
if diff := cmp.Diff(expectEvents[i], event, cmpopts.IgnoreTypes(document.NoSerde{})); len(diff) > 0 {
t.Errorf("%d, %v", i, diff)
}
}
if err := resp.GetStream().Err(); err != nil {
t.Errorf("expect no error, %v", err)
}
}
func TestSubscribeToShard_ReadException(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("initial-response"),
},
},
Payload: []byte(`{}`),
},
{
Headers: eventstream.Headers{
eventstreamtesting.EventExceptionTypeHeader,
{
Name: eventstreamapi.ExceptionTypeHeader,
Value: eventstream.StringValue("InternalFailureException"),
},
},
Payload: []byte(`{
"message": "this is an exception message"
}`),
},
},
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := kinesis.NewFromConfig(cfg)
resp, err := svc.SubscribeToShard(context.Background(), &kinesis.SubscribeToShardInput{}, func(options *kinesis.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
<-resp.GetStream().Events()
err = resp.GetStream().Err()
if err == nil {
t.Fatalf("expect err, got none")
}
var expectedErr *types.InternalFailureException
if !errors.As(err, &expectedErr) {
t.Errorf("expect err type %T", expectedErr)
}
if diff := cmp.Diff(
expectedErr,
&types.InternalFailureException{Message: aws.String("this is an exception message")},
cmpopts.IgnoreTypes(document.NoSerde{}),
); len(diff) > 0 {
t.Errorf(diff)
}
}
func TestSubscribeToShard_ReadUnmodeledException(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("initial-response"),
},
},
Payload: []byte(`{}`),
},
{
Headers: eventstream.Headers{
eventstreamtesting.EventExceptionTypeHeader,
{
Name: eventstreamapi.ExceptionTypeHeader,
Value: eventstream.StringValue("UnmodeledException"),
},
},
Payload: []byte(`{
"Message": "this is an unmodeled exception message"
}`),
},
},
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := kinesis.NewFromConfig(cfg)
resp, err := svc.SubscribeToShard(context.Background(), &kinesis.SubscribeToShardInput{}, func(options *kinesis.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
<-resp.GetStream().Events()
err = resp.GetStream().Err()
if err == nil {
t.Fatalf("expect err, got none")
}
var expectedErr *smithy.GenericAPIError
if !errors.As(err, &expectedErr) {
t.Errorf("expect err type %T", expectedErr)
}
if diff := cmp.Diff(
expectedErr,
&smithy.GenericAPIError{
Code: "UnmodeledException",
Message: "this is an unmodeled exception message",
},
cmpopts.IgnoreTypes(document.NoSerde{}),
); len(diff) > 0 {
t.Errorf(diff)
}
}
func TestSubscribeToShard_ReadErrorEvent(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
Events: []eventstream.Message{
{
Headers: eventstream.Headers{
eventstreamtesting.EventMessageTypeHeader,
{
Name: eventstreamapi.EventTypeHeader,
Value: eventstream.StringValue("initial-response"),
},
},
Payload: []byte(`{}`),
},
{
Headers: eventstream.Headers{
{
Name: eventstreamapi.MessageTypeHeader,
Value: eventstream.StringValue(eventstreamapi.ErrorMessageType),
},
{
Name: eventstreamapi.ErrorCodeHeader,
Value: eventstream.StringValue("AnErrorCode"),
},
{
Name: eventstreamapi.ErrorMessageHeader,
Value: eventstream.StringValue("An error message"),
},
},
},
},
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := kinesis.NewFromConfig(cfg)
resp, err := svc.SubscribeToShard(context.Background(), &kinesis.SubscribeToShardInput{}, func(options *kinesis.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err != nil {
t.Fatalf("expect no error got, %v", err)
}
defer resp.GetStream().Close()
<-resp.GetStream().Events()
err = resp.GetStream().Err()
if err == nil {
t.Fatalf("expect err, got none")
}
var expectedErr *smithy.GenericAPIError
if !errors.As(err, &expectedErr) {
t.Errorf("expect err type %T", expectedErr)
}
if diff := cmp.Diff(
expectedErr,
&smithy.GenericAPIError{
Code: "AnErrorCode",
Message: "An error message",
},
cmpopts.IgnoreTypes(document.NoSerde{}),
); len(diff) > 0 {
t.Errorf(diff)
}
}
func TestSubscribeToShard_ResponseError(t *testing.T) {
cfg, cleanupFn, err := eventstreamtesting.SetupEventStream(t,
eventstreamtesting.ServeEventStream{
T: t,
StaticResponse: &eventstreamtesting.StaticResponse{
StatusCode: 500,
Body: []byte(`{
"Message": "this is an exception message"
}`),
},
},
)
if err != nil {
t.Fatalf("expect no error, %v", err)
}
defer cleanupFn()
svc := kinesis.NewFromConfig(cfg)
_, err = svc.SubscribeToShard(context.Background(), &kinesis.SubscribeToShardInput{}, func(options *kinesis.Options) {
options.APIOptions = append(options.APIOptions, removeValidationMiddleware)
})
if err == nil {
t.Fatal("expect error got nil")
}
var expectedErr *smithy.GenericAPIError
if !errors.As(err, &expectedErr) {
t.Errorf("expect err type %T, got %v", expectedErr, err)
}
if diff := cmp.Diff(
expectedErr,
&smithy.GenericAPIError{
Code: "UnknownError",
Message: "this is an exception message",
},
cmpopts.IgnoreTypes(document.NoSerde{}),
); len(diff) > 0 {
t.Errorf(diff)
}
}
| 488 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package testing
// goModuleVersion is the tagged release for this module
const goModuleVersion = "tip"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type ConsumerStatus string
// Enum values for ConsumerStatus
const (
ConsumerStatusCreating ConsumerStatus = "CREATING"
ConsumerStatusDeleting ConsumerStatus = "DELETING"
ConsumerStatusActive ConsumerStatus = "ACTIVE"
)
// Values returns all known values for ConsumerStatus. 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 (ConsumerStatus) Values() []ConsumerStatus {
return []ConsumerStatus{
"CREATING",
"DELETING",
"ACTIVE",
}
}
type EncryptionType string
// Enum values for EncryptionType
const (
EncryptionTypeNone EncryptionType = "NONE"
EncryptionTypeKms EncryptionType = "KMS"
)
// Values returns all known values for EncryptionType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (EncryptionType) Values() []EncryptionType {
return []EncryptionType{
"NONE",
"KMS",
}
}
type MetricsName string
// Enum values for MetricsName
const (
MetricsNameIncomingBytes MetricsName = "IncomingBytes"
MetricsNameIncomingRecords MetricsName = "IncomingRecords"
MetricsNameOutgoingBytes MetricsName = "OutgoingBytes"
MetricsNameOutgoingRecords MetricsName = "OutgoingRecords"
MetricsNameWriteProvisionedThroughputExceeded MetricsName = "WriteProvisionedThroughputExceeded"
MetricsNameReadProvisionedThroughputExceeded MetricsName = "ReadProvisionedThroughputExceeded"
MetricsNameIteratorAgeMilliseconds MetricsName = "IteratorAgeMilliseconds"
MetricsNameAll MetricsName = "ALL"
)
// Values returns all known values for MetricsName. 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 (MetricsName) Values() []MetricsName {
return []MetricsName{
"IncomingBytes",
"IncomingRecords",
"OutgoingBytes",
"OutgoingRecords",
"WriteProvisionedThroughputExceeded",
"ReadProvisionedThroughputExceeded",
"IteratorAgeMilliseconds",
"ALL",
}
}
type ScalingType string
// Enum values for ScalingType
const (
ScalingTypeUniformScaling ScalingType = "UNIFORM_SCALING"
)
// Values returns all known values for ScalingType. 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 (ScalingType) Values() []ScalingType {
return []ScalingType{
"UNIFORM_SCALING",
}
}
type ShardFilterType string
// Enum values for ShardFilterType
const (
ShardFilterTypeAfterShardId ShardFilterType = "AFTER_SHARD_ID"
ShardFilterTypeAtTrimHorizon ShardFilterType = "AT_TRIM_HORIZON"
ShardFilterTypeFromTrimHorizon ShardFilterType = "FROM_TRIM_HORIZON"
ShardFilterTypeAtLatest ShardFilterType = "AT_LATEST"
ShardFilterTypeAtTimestamp ShardFilterType = "AT_TIMESTAMP"
ShardFilterTypeFromTimestamp ShardFilterType = "FROM_TIMESTAMP"
)
// Values returns all known values for ShardFilterType. 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 (ShardFilterType) Values() []ShardFilterType {
return []ShardFilterType{
"AFTER_SHARD_ID",
"AT_TRIM_HORIZON",
"FROM_TRIM_HORIZON",
"AT_LATEST",
"AT_TIMESTAMP",
"FROM_TIMESTAMP",
}
}
type ShardIteratorType string
// Enum values for ShardIteratorType
const (
ShardIteratorTypeAtSequenceNumber ShardIteratorType = "AT_SEQUENCE_NUMBER"
ShardIteratorTypeAfterSequenceNumber ShardIteratorType = "AFTER_SEQUENCE_NUMBER"
ShardIteratorTypeTrimHorizon ShardIteratorType = "TRIM_HORIZON"
ShardIteratorTypeLatest ShardIteratorType = "LATEST"
ShardIteratorTypeAtTimestamp ShardIteratorType = "AT_TIMESTAMP"
)
// Values returns all known values for ShardIteratorType. 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 (ShardIteratorType) Values() []ShardIteratorType {
return []ShardIteratorType{
"AT_SEQUENCE_NUMBER",
"AFTER_SEQUENCE_NUMBER",
"TRIM_HORIZON",
"LATEST",
"AT_TIMESTAMP",
}
}
type StreamMode string
// Enum values for StreamMode
const (
StreamModeProvisioned StreamMode = "PROVISIONED"
StreamModeOnDemand StreamMode = "ON_DEMAND"
)
// Values returns all known values for StreamMode. 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 (StreamMode) Values() []StreamMode {
return []StreamMode{
"PROVISIONED",
"ON_DEMAND",
}
}
type StreamStatus string
// Enum values for StreamStatus
const (
StreamStatusCreating StreamStatus = "CREATING"
StreamStatusDeleting StreamStatus = "DELETING"
StreamStatusActive StreamStatus = "ACTIVE"
StreamStatusUpdating StreamStatus = "UPDATING"
)
// Values returns all known values for StreamStatus. 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 (StreamStatus) Values() []StreamStatus {
return []StreamStatus{
"CREATING",
"DELETING",
"ACTIVE",
"UPDATING",
}
}
| 178 |
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"
)
// Specifies that you do not have the permissions required to perform this
// operation.
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 provided iterator exceeds the maximum age allowed.
type ExpiredIteratorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ExpiredIteratorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ExpiredIteratorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ExpiredIteratorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ExpiredIteratorException"
}
return *e.ErrorCodeOverride
}
func (e *ExpiredIteratorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The pagination token passed to the operation is expired.
type ExpiredNextTokenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ExpiredNextTokenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ExpiredNextTokenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ExpiredNextTokenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ExpiredNextTokenException"
}
return *e.ErrorCodeOverride
}
func (e *ExpiredNextTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The processing of the request failed because of an unknown error, exception, or
// failure.
type InternalFailureException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalFailureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalFailureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalFailureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalFailureException"
}
return *e.ErrorCodeOverride
}
func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// A specified parameter exceeds its restrictions, is not supported, or can't be
// used. For more information, see the returned message.
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 }
// The ciphertext references a key that doesn't exist or that you don't have
// access to.
type KMSAccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *KMSAccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSAccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSAccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSAccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *KMSAccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because the specified customer master key (CMK) isn't
// enabled.
type KMSDisabledException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *KMSDisabledException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSDisabledException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSDisabledException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSDisabledException"
}
return *e.ErrorCodeOverride
}
func (e *KMSDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because the state of the specified resource isn't
// valid for this request. For more information, see How Key State Affects Use of
// a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
// in the Amazon Web Services Key Management Service Developer Guide.
type KMSInvalidStateException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *KMSInvalidStateException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSInvalidStateException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSInvalidStateException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSInvalidStateException"
}
return *e.ErrorCodeOverride
}
func (e *KMSInvalidStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because the specified entity or resource can't be
// found.
type KMSNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *KMSNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *KMSNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The Amazon Web Services access key ID needs a subscription for the service.
type KMSOptInRequired struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *KMSOptInRequired) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSOptInRequired) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSOptInRequired) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSOptInRequired"
}
return *e.ErrorCodeOverride
}
func (e *KMSOptInRequired) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was denied due to request throttling. For more information about
// throttling, see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second)
// in the Amazon Web Services Key Management Service Developer Guide.
type KMSThrottlingException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *KMSThrottlingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSThrottlingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSThrottlingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSThrottlingException"
}
return *e.ErrorCodeOverride
}
func (e *KMSThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The requested resource exceeds the maximum number allowed, or the number of
// concurrent stream requests exceeds the maximum number allowed.
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 request rate for the stream is too high, or the requested data is too large
// for the available throughput. Reduce the frequency or size of your requests. For
// more information, see Streams Limits (https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html)
// in the Amazon Kinesis Data Streams Developer Guide, and Error Retries and
// Exponential Backoff in Amazon Web Services (https://docs.aws.amazon.com/general/latest/gr/api-retries.html)
// in the Amazon Web Services General Reference.
type ProvisionedThroughputExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ProvisionedThroughputExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ProvisionedThroughputExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ProvisionedThroughputExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ProvisionedThroughputExceededException"
}
return *e.ErrorCodeOverride
}
func (e *ProvisionedThroughputExceededException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// The resource is not available for this operation. For successful operation, the
// resource must be in the ACTIVE state.
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 requested resource could not be found. The stream might not be specified
// correctly.
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 }
// Specifies that you tried to invoke this API for a data stream with the
// on-demand capacity mode. This API is only supported for data streams with the
// provisioned capacity mode.
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 }
| 448 |
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"
)
// Output parameter of the GetRecords API. The existing child shard of the current
// shard.
type ChildShard struct {
// The range of possible hash key values for the shard, which is a set of ordered
// contiguous positive integers.
//
// This member is required.
HashKeyRange *HashKeyRange
// The current shard that is the parent of the existing child shard.
//
// This member is required.
ParentShards []string
// The shard ID of the existing child shard of the current shard.
//
// This member is required.
ShardId *string
noSmithyDocumentSerde
}
// An object that represents the details of the consumer you registered. This type
// of object is returned by RegisterStreamConsumer .
type Consumer struct {
// When you register a consumer, Kinesis Data Streams generates an ARN for it. You
// need this ARN to be able to call SubscribeToShard . If you delete a consumer and
// then create a new one with the same name, it won't have the same ARN. That's
// because consumer ARNs contain the creation timestamp. This is important to keep
// in mind if you have IAM policies that reference consumer ARNs.
//
// This member is required.
ConsumerARN *string
//
//
// This member is required.
ConsumerCreationTimestamp *time.Time
// The name of the consumer is something you choose when you register the consumer.
//
// This member is required.
ConsumerName *string
// A consumer can't read data while in the CREATING or DELETING states.
//
// This member is required.
ConsumerStatus ConsumerStatus
noSmithyDocumentSerde
}
// An object that represents the details of a registered consumer. This type of
// object is returned by DescribeStreamConsumer .
type ConsumerDescription struct {
// When you register a consumer, Kinesis Data Streams generates an ARN for it. You
// need this ARN to be able to call SubscribeToShard . If you delete a consumer and
// then create a new one with the same name, it won't have the same ARN. That's
// because consumer ARNs contain the creation timestamp. This is important to keep
// in mind if you have IAM policies that reference consumer ARNs.
//
// This member is required.
ConsumerARN *string
//
//
// This member is required.
ConsumerCreationTimestamp *time.Time
// The name of the consumer is something you choose when you register the consumer.
//
// This member is required.
ConsumerName *string
// A consumer can't read data while in the CREATING or DELETING states.
//
// This member is required.
ConsumerStatus ConsumerStatus
// The ARN of the stream with which you registered the consumer.
//
// This member is required.
StreamARN *string
noSmithyDocumentSerde
}
// Represents enhanced metrics types.
type EnhancedMetrics struct {
// List of shard-level metrics. The following are the valid shard-level metrics.
// The value " ALL " enhances every metric.
// - IncomingBytes
// - IncomingRecords
// - OutgoingBytes
// - OutgoingRecords
// - WriteProvisionedThroughputExceeded
// - ReadProvisionedThroughputExceeded
// - IteratorAgeMilliseconds
// - ALL
// For more information, see Monitoring the Amazon Kinesis Data Streams Service
// with Amazon CloudWatch (https://docs.aws.amazon.com/kinesis/latest/dev/monitoring-with-cloudwatch.html)
// in the Amazon Kinesis Data Streams Developer Guide.
ShardLevelMetrics []MetricsName
noSmithyDocumentSerde
}
// The range of possible hash key values for the shard, which is a set of ordered
// contiguous positive integers.
type HashKeyRange struct {
// The ending hash key of the hash key range.
//
// This member is required.
EndingHashKey *string
// The starting hash key of the hash key range.
//
// This member is required.
StartingHashKey *string
noSmithyDocumentSerde
}
// Represents the output for PutRecords .
type PutRecordsRequestEntry struct {
// The data blob to put into the record, which is base64-encoded when the blob is
// serialized. When the data blob (the payload before base64-encoding) is added to
// the partition key size, the total size must not exceed the maximum record size
// (1 MiB).
//
// This member is required.
Data []byte
// Determines which shard in the stream the data record is assigned to. Partition
// keys are Unicode strings with a maximum length limit of 256 characters for each
// key. Amazon Kinesis Data Streams uses the partition key as input to a hash
// function that maps the partition key and associated data to a specific shard.
// Specifically, an MD5 hash function is used to map partition keys to 128-bit
// integer values and to map associated data records to shards. As a result of this
// hashing mechanism, all data records with the same partition key map to the same
// shard within the stream.
//
// This member is required.
PartitionKey *string
// The hash value used to determine explicitly the shard that the data record is
// assigned to by overriding the partition key hash.
ExplicitHashKey *string
noSmithyDocumentSerde
}
// Represents the result of an individual record from a PutRecords request. A
// record that is successfully added to a stream includes SequenceNumber and
// ShardId in the result. A record that fails to be added to the stream includes
// ErrorCode and ErrorMessage in the result.
type PutRecordsResultEntry struct {
// The error code for an individual record result. ErrorCodes can be either
// ProvisionedThroughputExceededException or InternalFailure .
ErrorCode *string
// The error message for an individual record result. An ErrorCode value of
// ProvisionedThroughputExceededException has an error message that includes the
// account ID, stream name, and shard ID. An ErrorCode value of InternalFailure
// has the error message "Internal Service Failure" .
ErrorMessage *string
// The sequence number for an individual record result.
SequenceNumber *string
// The shard ID for an individual record result.
ShardId *string
noSmithyDocumentSerde
}
// The unit of data of the Kinesis data stream, which is composed of a sequence
// number, a partition key, and a data blob.
type Record struct {
// The data blob. The data in the blob is both opaque and immutable to Kinesis
// Data Streams, which does not inspect, interpret, or change the data in the blob
// in any way. When the data blob (the payload before base64-encoding) is added to
// the partition key size, the total size must not exceed the maximum record size
// (1 MiB).
//
// This member is required.
Data []byte
// Identifies which shard in the stream the data record is assigned to.
//
// This member is required.
PartitionKey *string
// The unique identifier of the record within its shard.
//
// This member is required.
SequenceNumber *string
// The approximate time that the record was inserted into the stream.
ApproximateArrivalTimestamp *time.Time
// The encryption type used on the record. This parameter can be one of the
// following values:
// - NONE : Do not encrypt the records in the stream.
// - KMS : Use server-side encryption on the records in the stream using a
// customer-managed Amazon Web Services KMS key.
EncryptionType EncryptionType
noSmithyDocumentSerde
}
// The range of possible sequence numbers for the shard.
type SequenceNumberRange struct {
// The starting sequence number for the range.
//
// This member is required.
StartingSequenceNumber *string
// The ending sequence number for the range. Shards that are in the OPEN state
// have an ending sequence number of null .
EndingSequenceNumber *string
noSmithyDocumentSerde
}
// A uniquely identified group of data records in a Kinesis data stream.
type Shard struct {
// The range of possible hash key values for the shard, which is a set of ordered
// contiguous positive integers.
//
// This member is required.
HashKeyRange *HashKeyRange
// The range of possible sequence numbers for the shard.
//
// This member is required.
SequenceNumberRange *SequenceNumberRange
// The unique identifier of the shard within the stream.
//
// This member is required.
ShardId *string
// The shard ID of the shard adjacent to the shard's parent.
AdjacentParentShardId *string
// The shard ID of the shard's parent.
ParentShardId *string
noSmithyDocumentSerde
}
// The request parameter used to filter out the response of the ListShards API.
type ShardFilter struct {
// The shard type specified in the ShardFilter parameter. This is a required
// property of the ShardFilter parameter. You can specify the following valid
// values:
// - AFTER_SHARD_ID - the response includes all the shards, starting with the
// shard whose ID immediately follows the ShardId that you provided.
// - AT_TRIM_HORIZON - the response includes all the shards that were open at
// TRIM_HORIZON .
// - FROM_TRIM_HORIZON - (default), the response includes all the shards within
// the retention period of the data stream (trim to tip).
// - AT_LATEST - the response includes only the currently open shards of the data
// stream.
// - AT_TIMESTAMP - the response includes all shards whose start timestamp is
// less than or equal to the given timestamp and end timestamp is greater than or
// equal to the given timestamp or still open.
// - FROM_TIMESTAMP - the response incldues all closed shards whose end timestamp
// is greater than or equal to the given timestamp and also all open shards.
// Corrected to TRIM_HORIZON of the data stream if FROM_TIMESTAMP is less than
// the TRIM_HORIZON value.
//
// This member is required.
Type ShardFilterType
// The exclusive start shardID speified in the ShardFilter parameter. This
// property can only be used if the AFTER_SHARD_ID shard type is specified.
ShardId *string
// The timestamps specified in the ShardFilter parameter. A timestamp is a Unix
// epoch date with precision in milliseconds. For example,
// 2016-04-04T19:58:46.480-00:00 or 1459799926.480. This property can only be used
// if FROM_TIMESTAMP or AT_TIMESTAMP shard types are specified.
Timestamp *time.Time
noSmithyDocumentSerde
}
// The starting position in the data stream from which to start streaming.
type StartingPosition struct {
// You can set the starting position to one of the following values:
// AT_SEQUENCE_NUMBER : Start streaming from the position denoted by the sequence
// number specified in the SequenceNumber field. AFTER_SEQUENCE_NUMBER : Start
// streaming right after the position denoted by the sequence number specified in
// the SequenceNumber field. AT_TIMESTAMP : Start streaming from the position
// denoted by the time stamp specified in the Timestamp field. TRIM_HORIZON : Start
// streaming at the last untrimmed record in the shard, which is the oldest data
// record in the shard. LATEST : Start streaming just after the most recent record
// in the shard, so that you always read the most recent data in the shard.
//
// This member is required.
Type ShardIteratorType
// The sequence number of the data record in the shard from which to start
// streaming. To specify a sequence number, set StartingPosition to
// AT_SEQUENCE_NUMBER or AFTER_SEQUENCE_NUMBER .
SequenceNumber *string
// The time stamp of the data record from which to start reading. To specify a
// time stamp, set StartingPosition to Type AT_TIMESTAMP . A time stamp is the Unix
// epoch date with precision in milliseconds. For example,
// 2016-04-04T19:58:46.480-00:00 or 1459799926.480 . If a record with this exact
// time stamp does not exist, records will be streamed from the next (later)
// record. If the time stamp is older than the current trim horizon, records will
// be streamed from the oldest untrimmed data record ( TRIM_HORIZON ).
Timestamp *time.Time
noSmithyDocumentSerde
}
// Represents the output for DescribeStream .
type StreamDescription struct {
// Represents the current enhanced monitoring settings of the stream.
//
// This member is required.
EnhancedMonitoring []EnhancedMetrics
// If set to true , more shards in the stream are available to describe.
//
// This member is required.
HasMoreShards *bool
// The current retention period, in hours. Minimum value of 24. Maximum value of
// 168.
//
// This member is required.
RetentionPeriodHours *int32
// The shards that comprise the stream.
//
// This member is required.
Shards []Shard
// The Amazon Resource Name (ARN) for the stream being described.
//
// This member is required.
StreamARN *string
// The approximate time that the stream was created.
//
// This member is required.
StreamCreationTimestamp *time.Time
// The name of the stream being described.
//
// This member is required.
StreamName *string
// The current status of the stream being described. The stream status is one of
// the following states:
// - CREATING - The stream is being created. Kinesis Data Streams immediately
// returns and sets StreamStatus to CREATING .
// - DELETING - The stream is being deleted. The specified stream is in the
// DELETING state until Kinesis Data Streams completes the deletion.
// - ACTIVE - The stream exists and is ready for read and write operations or
// deletion. You should perform read and write operations only on an ACTIVE
// stream.
// - UPDATING - Shards in the stream are being merged or split. Read and write
// operations continue to work while the stream is in the UPDATING state.
//
// This member is required.
StreamStatus StreamStatus
// The server-side encryption type used on the stream. This parameter can be one
// of the following values:
// - NONE : Do not encrypt the records in the stream.
// - KMS : Use server-side encryption on the records in the stream using a
// customer-managed Amazon Web Services KMS key.
EncryptionType EncryptionType
// The GUID for the customer-managed Amazon Web Services KMS key to use for
// encryption. This value can be a globally unique identifier, a fully specified
// ARN to either an alias or a key, or an alias name prefixed by "alias/".You can
// also use a master key owned by Kinesis Data Streams by specifying the alias
// aws/kinesis .
// - Key ARN example:
// arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
// - Alias ARN example: arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
// - Globally unique key ID example: 12345678-1234-1234-1234-123456789012
// - Alias name example: alias/MyAliasName
// - Master key owned by Kinesis Data Streams: alias/aws/kinesis
KeyId *string
// Specifies the capacity mode to which you want to set your data stream.
// Currently, in Kinesis Data Streams, you can choose between an on-demand capacity
// mode and a provisioned capacity mode for your data streams.
StreamModeDetails *StreamModeDetails
noSmithyDocumentSerde
}
// Represents the output for DescribeStreamSummary
type StreamDescriptionSummary struct {
// Represents the current enhanced monitoring settings of the stream.
//
// This member is required.
EnhancedMonitoring []EnhancedMetrics
// The number of open shards in the stream.
//
// This member is required.
OpenShardCount *int32
// The current retention period, in hours.
//
// This member is required.
RetentionPeriodHours *int32
// The Amazon Resource Name (ARN) for the stream being described.
//
// This member is required.
StreamARN *string
// The approximate time that the stream was created.
//
// This member is required.
StreamCreationTimestamp *time.Time
// The name of the stream being described.
//
// This member is required.
StreamName *string
// The current status of the stream being described. The stream status is one of
// the following states:
// - CREATING - The stream is being created. Kinesis Data Streams immediately
// returns and sets StreamStatus to CREATING .
// - DELETING - The stream is being deleted. The specified stream is in the
// DELETING state until Kinesis Data Streams completes the deletion.
// - ACTIVE - The stream exists and is ready for read and write operations or
// deletion. You should perform read and write operations only on an ACTIVE
// stream.
// - UPDATING - Shards in the stream are being merged or split. Read and write
// operations continue to work while the stream is in the UPDATING state.
//
// This member is required.
StreamStatus StreamStatus
// The number of enhanced fan-out consumers registered with the stream.
ConsumerCount *int32
// The encryption type used. This value is one of the following:
// - KMS
// - NONE
EncryptionType EncryptionType
// The GUID for the customer-managed Amazon Web Services KMS key to use for
// encryption. This value can be a globally unique identifier, a fully specified
// ARN to either an alias or a key, or an alias name prefixed by "alias/".You can
// also use a master key owned by Kinesis Data Streams by specifying the alias
// aws/kinesis .
// - Key ARN example:
// arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
// - Alias ARN example: arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
// - Globally unique key ID example: 12345678-1234-1234-1234-123456789012
// - Alias name example: alias/MyAliasName
// - Master key owned by Kinesis Data Streams: alias/aws/kinesis
KeyId *string
// Specifies the capacity mode to which you want to set your data stream.
// Currently, in Kinesis Data Streams, you can choose between an on-demand
// ycapacity mode and a provisioned capacity mode for your data streams.
StreamModeDetails *StreamModeDetails
noSmithyDocumentSerde
}
// Specifies the capacity mode to which you want to set your data stream.
// Currently, in Kinesis Data Streams, you can choose between an on-demand capacity
// mode and a provisioned capacity mode for your data streams.
type StreamModeDetails struct {
// Specifies the capacity mode to which you want to set your data stream.
// Currently, in Kinesis Data Streams, you can choose between an on-demand capacity
// mode and a provisioned capacity mode for your data streams.
//
// This member is required.
StreamMode StreamMode
noSmithyDocumentSerde
}
// The summary of a stream.
type StreamSummary struct {
// The ARN of the stream.
//
// This member is required.
StreamARN *string
// The name of a stream.
//
// This member is required.
StreamName *string
// The status of the stream.
//
// This member is required.
StreamStatus StreamStatus
// The timestamp at which the stream was created.
StreamCreationTimestamp *time.Time
// Specifies the capacity mode to which you want to set your data stream.
// Currently, in Kinesis Data Streams, you can choose between an on-demand capacity
// mode and a provisioned capacity mode for your data streams.
StreamModeDetails *StreamModeDetails
noSmithyDocumentSerde
}
// After you call SubscribeToShard , Kinesis Data Streams sends events of this type
// over an HTTP/2 connection to your consumer.
type SubscribeToShardEvent struct {
// Use this as SequenceNumber in the next call to SubscribeToShard , with
// StartingPosition set to AT_SEQUENCE_NUMBER or AFTER_SEQUENCE_NUMBER . Use
// ContinuationSequenceNumber for checkpointing because it captures your shard
// progress even when no data is written to the shard.
//
// This member is required.
ContinuationSequenceNumber *string
// The number of milliseconds the read records are from the tip of the stream,
// indicating how far behind current time the consumer is. A value of zero
// indicates that record processing is caught up, and there are no new records to
// process at this moment.
//
// This member is required.
MillisBehindLatest *int64
//
//
// This member is required.
Records []Record
// The list of the child shards of the current shard, returned only at the end of
// the current shard.
ChildShards []ChildShard
noSmithyDocumentSerde
}
// This is a tagged union for all of the types of events an enhanced fan-out
// consumer can receive over HTTP/2 after a call to SubscribeToShard .
//
// The following types satisfy this interface:
//
// SubscribeToShardEventStreamMemberSubscribeToShardEvent
type SubscribeToShardEventStream interface {
isSubscribeToShardEventStream()
}
// After you call SubscribeToShard , Kinesis Data Streams sends events of this type
// to your consumer. For an example of how to handle these events, see Enhanced
// Fan-Out Using the Kinesis Data Streams API .
type SubscribeToShardEventStreamMemberSubscribeToShardEvent struct {
Value SubscribeToShardEvent
noSmithyDocumentSerde
}
func (*SubscribeToShardEventStreamMemberSubscribeToShardEvent) isSubscribeToShardEventStream() {}
// Metadata assigned to the 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, typically used to describe or define the tag. Maximum
// length: 256 characters. Valid characters: Unicode letters, digits, white space,
// _ . / = + - % @
Value *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
// UnknownUnionMember is returned when a union member is returned over the wire,
// but has an unknown tag.
type UnknownUnionMember struct {
Tag string
Value []byte
noSmithyDocumentSerde
}
func (*UnknownUnionMember) isSubscribeToShardEventStream() {}
| 628 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types_test
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/service/kinesis/types"
)
func ExampleSubscribeToShardEventStream_outputUsage() {
var union types.SubscribeToShardEventStream
// type switches can be used to check the union value
switch v := union.(type) {
case *types.SubscribeToShardEventStreamMemberSubscribeToShardEvent:
_ = v.Value // Value is types.SubscribeToShardEvent
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.SubscribeToShardEvent
| 27 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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 = "Kinesis Analytics"
const ServiceAPIVersion = "2015-08-14"
// Client provides the API client to make operations call for Amazon Kinesis
// Analytics.
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, "kinesisanalytics", 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 kinesisanalytics
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 kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Adds a CloudWatch log stream to monitor
// application configuration errors. For more information about using CloudWatch
// log streams with Amazon Kinesis Analytics applications, see Working with Amazon
// CloudWatch Logs (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/cloudwatch-logs.html)
// .
func (c *Client) AddApplicationCloudWatchLoggingOption(ctx context.Context, params *AddApplicationCloudWatchLoggingOptionInput, optFns ...func(*Options)) (*AddApplicationCloudWatchLoggingOptionOutput, error) {
if params == nil {
params = &AddApplicationCloudWatchLoggingOptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationCloudWatchLoggingOption", params, optFns, c.addOperationAddApplicationCloudWatchLoggingOptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationCloudWatchLoggingOptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationCloudWatchLoggingOptionInput struct {
// The Kinesis Analytics application name.
//
// This member is required.
ApplicationName *string
// Provides the CloudWatch log stream Amazon Resource Name (ARN) and the IAM role
// ARN. Note: To write application messages to CloudWatch, the IAM role that is
// used must have the PutLogEvents policy action enabled.
//
// This member is required.
CloudWatchLoggingOption *types.CloudWatchLoggingOption
// The version ID of the Kinesis Analytics application.
//
// This member is required.
CurrentApplicationVersionId *int64
noSmithyDocumentSerde
}
type AddApplicationCloudWatchLoggingOptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationCloudWatchLoggingOptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationCloudWatchLoggingOption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationCloudWatchLoggingOption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationCloudWatchLoggingOptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationCloudWatchLoggingOption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationCloudWatchLoggingOption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationCloudWatchLoggingOption",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Adds a streaming source to your Amazon Kinesis
// application. For conceptual information, see Configuring Application Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html)
// . You can add a streaming source either when you create an application or you
// can use this operation to add a streaming source after you create an
// application. For more information, see CreateApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_CreateApplication.html)
// . Any configuration update, including adding a streaming source using this
// operation, results in a new version of the application. You can use the
// DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to find the current application version. This operation requires
// permissions to perform the kinesisanalytics:AddApplicationInput action.
func (c *Client) AddApplicationInput(ctx context.Context, params *AddApplicationInputInput, optFns ...func(*Options)) (*AddApplicationInputOutput, error) {
if params == nil {
params = &AddApplicationInputInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationInput", params, optFns, c.addOperationAddApplicationInputMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationInputOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationInputInput struct {
// Name of your existing Amazon Kinesis Analytics application to which you want to
// add the streaming source.
//
// This member is required.
ApplicationName *string
// Current version of your Amazon Kinesis Analytics application. You can use the
// DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to find the current application version.
//
// This member is required.
CurrentApplicationVersionId *int64
// The Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_Input.html)
// to add.
//
// This member is required.
Input *types.Input
noSmithyDocumentSerde
}
type AddApplicationInputOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationInputMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationInput{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationInput{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationInputValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationInput(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationInput(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationInput",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Adds an InputProcessingConfiguration (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputProcessingConfiguration.html)
// to an application. An input processor preprocesses records on the input stream
// before the application's SQL code executes. Currently, the only input processor
// available is AWS Lambda (https://docs.aws.amazon.com/lambda/) .
func (c *Client) AddApplicationInputProcessingConfiguration(ctx context.Context, params *AddApplicationInputProcessingConfigurationInput, optFns ...func(*Options)) (*AddApplicationInputProcessingConfigurationOutput, error) {
if params == nil {
params = &AddApplicationInputProcessingConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationInputProcessingConfiguration", params, optFns, c.addOperationAddApplicationInputProcessingConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationInputProcessingConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationInputProcessingConfigurationInput struct {
// Name of the application to which you want to add the input processing
// configuration.
//
// This member is required.
ApplicationName *string
// Version of the application to which you want to add the input processing
// configuration. You can use the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to get the current application version. If the version specified is
// not the current version, the ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// The ID of the input configuration to add the input processing configuration to.
// You can get a list of the input IDs for an application using the
// DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation.
//
// This member is required.
InputId *string
// The InputProcessingConfiguration (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputProcessingConfiguration.html)
// to add to the application.
//
// This member is required.
InputProcessingConfiguration *types.InputProcessingConfiguration
noSmithyDocumentSerde
}
type AddApplicationInputProcessingConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationInputProcessingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationInputProcessingConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationInputProcessingConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationInputProcessingConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationInputProcessingConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationInputProcessingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationInputProcessingConfiguration",
}
}
| 150 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Adds an external destination to your Amazon
// Kinesis Analytics application. If you want Amazon Kinesis Analytics to deliver
// data from an in-application stream within your application to an external
// destination (such as an Amazon Kinesis stream, an Amazon Kinesis Firehose
// delivery stream, or an AWS Lambda function), you add the relevant configuration
// to your application using this operation. You can configure one or more outputs
// for your application. Each output configuration maps an in-application stream
// and an external destination. You can use one of the output configurations to
// deliver data from your in-application error stream to an external destination so
// that you can analyze the errors. For more information, see Understanding
// Application Output (Destination) (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-output.html)
// . Any configuration update, including adding a streaming source using this
// operation, results in a new version of the application. You can use the
// DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to find the current application version. For the limits on the number
// of application inputs and outputs you can configure, see Limits (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/limits.html)
// . This operation requires permissions to perform the
// kinesisanalytics:AddApplicationOutput action.
func (c *Client) AddApplicationOutput(ctx context.Context, params *AddApplicationOutputInput, optFns ...func(*Options)) (*AddApplicationOutputOutput, error) {
if params == nil {
params = &AddApplicationOutputInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationOutput", params, optFns, c.addOperationAddApplicationOutputMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationOutputOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationOutputInput struct {
// Name of the application to which you want to add the output configuration.
//
// This member is required.
ApplicationName *string
// Version of the application to which you want to add the output configuration.
// You can use the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to get the current application version. If the version specified is
// not the current version, the ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// An array of objects, each describing one output configuration. In the output
// configuration, you specify the name of an in-application stream, a destination
// (that is, an Amazon Kinesis stream, an Amazon Kinesis Firehose delivery stream,
// or an AWS Lambda function), and record the formation to use when writing to the
// destination.
//
// This member is required.
Output *types.Output
noSmithyDocumentSerde
}
type AddApplicationOutputOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationOutputMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationOutput{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationOutput{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationOutputValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationOutput(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationOutput(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationOutput",
}
}
| 158 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Adds a reference data source to an existing
// application. Amazon Kinesis Analytics reads reference data (that is, an Amazon
// S3 object) and creates an in-application table within your application. In the
// request, you provide the source (S3 bucket name and object key name), name of
// the in-application table to create, and the necessary mapping information that
// describes how data in Amazon S3 object maps to columns in the resulting
// in-application table. For conceptual information, see Configuring Application
// Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html)
// . For the limits on data sources you can add to your application, see Limits (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/limits.html)
// . This operation requires permissions to perform the
// kinesisanalytics:AddApplicationOutput action.
func (c *Client) AddApplicationReferenceDataSource(ctx context.Context, params *AddApplicationReferenceDataSourceInput, optFns ...func(*Options)) (*AddApplicationReferenceDataSourceOutput, error) {
if params == nil {
params = &AddApplicationReferenceDataSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationReferenceDataSource", params, optFns, c.addOperationAddApplicationReferenceDataSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationReferenceDataSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationReferenceDataSourceInput struct {
// Name of an existing application.
//
// This member is required.
ApplicationName *string
// Version of the application for which you are adding the reference data source.
// You can use the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to get the current application version. If the version specified is
// not the current version, the ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// The reference data source can be an object in your Amazon S3 bucket. Amazon
// Kinesis Analytics reads the object and copies the data into the in-application
// table that is created. You provide an S3 bucket, object key name, and the
// resulting in-application table that is created. You must also provide an IAM
// role with the necessary permissions that Amazon Kinesis Analytics can assume to
// read the object from your S3 bucket on your behalf.
//
// This member is required.
ReferenceDataSource *types.ReferenceDataSource
noSmithyDocumentSerde
}
type AddApplicationReferenceDataSourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationReferenceDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationReferenceDataSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationReferenceDataSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationReferenceDataSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationReferenceDataSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationReferenceDataSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationReferenceDataSource",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Creates an Amazon Kinesis Analytics
// application. You can configure each application with one streaming source as
// input, application code to process the input, and up to three destinations where
// you want Amazon Kinesis Analytics to write the output data from your
// application. For an overview, see How it Works (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works.html)
// . In the input configuration, you map the streaming source to an in-application
// stream, which you can think of as a constantly updating table. In the mapping,
// you must provide a schema for the in-application stream and map each data column
// in the in-application stream to a data element in the streaming source. Your
// application code is one or more SQL statements that read input data, transform
// it, and generate output. Your application code can create one or more SQL
// artifacts like SQL streams or pumps. In the output configuration, you can
// configure the application to write data from in-application streams created in
// your applications to up to three destinations. To read data from your source
// stream or write data to destination streams, Amazon Kinesis Analytics needs your
// permissions. You grant these permissions by creating IAM roles. This operation
// requires permissions to perform the kinesisanalytics:CreateApplication action.
// For introductory exercises to create an Amazon Kinesis Analytics application,
// see Getting Started (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/getting-started.html)
// .
func (c *Client) CreateApplication(ctx context.Context, params *CreateApplicationInput, optFns ...func(*Options)) (*CreateApplicationOutput, error) {
if params == nil {
params = &CreateApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateApplication", params, optFns, c.addOperationCreateApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
// TBD
type CreateApplicationInput struct {
// Name of your Amazon Kinesis Analytics application (for example, sample-app ).
//
// This member is required.
ApplicationName *string
// One or more SQL statements that read input data, transform it, and generate
// output. For example, you can write a SQL statement that reads data from one
// in-application stream, generates a running average of the number of
// advertisement clicks by vendor, and insert resulting rows in another
// in-application stream using pumps. For more information about the typical
// pattern, see Application Code (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-app-code.html)
// . You can provide such series of SQL statements, where output of one statement
// can be used as the input for the next statement. You store intermediate results
// by creating in-application streams and pumps. Note that the application code
// must create the streams with names specified in the Outputs . For example, if
// your Outputs defines output streams named ExampleOutputStream1 and
// ExampleOutputStream2 , then your application code must create these streams.
ApplicationCode *string
// Summary description of the application.
ApplicationDescription *string
// Use this parameter to configure a CloudWatch log stream to monitor application
// configuration errors. For more information, see Working with Amazon CloudWatch
// Logs (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/cloudwatch-logs.html)
// .
CloudWatchLoggingOptions []types.CloudWatchLoggingOption
// Use this parameter to configure the application input. You can configure your
// application to receive input from a single streaming source. In this
// configuration, you map this streaming source to an in-application stream that is
// created. Your application code can then query the in-application stream like a
// table (you can think of it as a constantly updating table). For the streaming
// source, you provide its Amazon Resource Name (ARN) and format of data on the
// stream (for example, JSON, CSV, etc.). You also must provide an IAM role that
// Amazon Kinesis Analytics can assume to read this stream on your behalf. To
// create the in-application stream, you need to specify a schema to transform your
// data into a schematized version used in SQL. In the schema, you provide the
// necessary mapping of the data elements in the streaming source to record columns
// in the in-app stream.
Inputs []types.Input
// You can configure application output to write data from any of the
// in-application streams to up to three destinations. These destinations can be
// Amazon Kinesis streams, Amazon Kinesis Firehose delivery streams, AWS Lambda
// destinations, or any combination of the three. In the configuration, you specify
// the in-application stream name, the destination stream or Lambda function Amazon
// Resource Name (ARN), and the format to use when writing data. You must also
// provide an IAM role that Amazon Kinesis Analytics can assume to write to the
// destination stream or Lambda function on your behalf. In the output
// configuration, you also provide the output stream or Lambda function ARN. For
// stream destinations, you provide the format of data in the stream (for example,
// JSON, CSV). You also must provide an IAM role that Amazon Kinesis Analytics can
// assume to write to the stream or Lambda function on your behalf.
Outputs []types.Output
// A list of one or more tags to assign to the application. A tag is a key-value
// pair that identifies an application. Note that the maximum number of application
// tags includes system tags. The maximum number of user-defined application tags
// is 50. For more information, see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
// TBD
type CreateApplicationOutput struct {
// In response to your CreateApplication request, Amazon Kinesis Analytics returns
// a response with a summary of the application it created, including the
// application Amazon Resource Name (ARN), name, and status.
//
// This member is required.
ApplicationSummary *types.ApplicationSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "CreateApplication",
}
}
| 211 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Deletes the specified application. Amazon
// Kinesis Analytics halts application execution and deletes the application,
// including any application artifacts (such as in-application streams, reference
// table, and application code). This operation requires permissions to perform the
// kinesisanalytics:DeleteApplication action.
func (c *Client) DeleteApplication(ctx context.Context, params *DeleteApplicationInput, optFns ...func(*Options)) (*DeleteApplicationOutput, error) {
if params == nil {
params = &DeleteApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplication", params, optFns, c.addOperationDeleteApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationInput struct {
// Name of the Amazon Kinesis Analytics application to delete.
//
// This member is required.
ApplicationName *string
// You can use the DescribeApplication operation to get this value.
//
// This member is required.
CreateTimestamp *time.Time
noSmithyDocumentSerde
}
type DeleteApplicationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplication",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Deletes a CloudWatch log stream from an
// application. For more information about using CloudWatch log streams with Amazon
// Kinesis Analytics applications, see Working with Amazon CloudWatch Logs (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/cloudwatch-logs.html)
// .
func (c *Client) DeleteApplicationCloudWatchLoggingOption(ctx context.Context, params *DeleteApplicationCloudWatchLoggingOptionInput, optFns ...func(*Options)) (*DeleteApplicationCloudWatchLoggingOptionOutput, error) {
if params == nil {
params = &DeleteApplicationCloudWatchLoggingOptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationCloudWatchLoggingOption", params, optFns, c.addOperationDeleteApplicationCloudWatchLoggingOptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationCloudWatchLoggingOptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationCloudWatchLoggingOptionInput struct {
// The Kinesis Analytics application name.
//
// This member is required.
ApplicationName *string
// The CloudWatchLoggingOptionId of the CloudWatch logging option to delete. You
// can get the CloudWatchLoggingOptionId by using the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation.
//
// This member is required.
CloudWatchLoggingOptionId *string
// The version ID of the Kinesis Analytics application.
//
// This member is required.
CurrentApplicationVersionId *int64
noSmithyDocumentSerde
}
type DeleteApplicationCloudWatchLoggingOptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationCloudWatchLoggingOptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationCloudWatchLoggingOption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationCloudWatchLoggingOption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationCloudWatchLoggingOptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationCloudWatchLoggingOption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationCloudWatchLoggingOption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationCloudWatchLoggingOption",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Deletes an InputProcessingConfiguration (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputProcessingConfiguration.html)
// from an input.
func (c *Client) DeleteApplicationInputProcessingConfiguration(ctx context.Context, params *DeleteApplicationInputProcessingConfigurationInput, optFns ...func(*Options)) (*DeleteApplicationInputProcessingConfigurationOutput, error) {
if params == nil {
params = &DeleteApplicationInputProcessingConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationInputProcessingConfiguration", params, optFns, c.addOperationDeleteApplicationInputProcessingConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationInputProcessingConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationInputProcessingConfigurationInput struct {
// The Kinesis Analytics application name.
//
// This member is required.
ApplicationName *string
// The version ID of the Kinesis Analytics application.
//
// This member is required.
CurrentApplicationVersionId *int64
// The ID of the input configuration from which to delete the input processing
// configuration. You can get a list of the input IDs for an application by using
// the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation.
//
// This member is required.
InputId *string
noSmithyDocumentSerde
}
type DeleteApplicationInputProcessingConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationInputProcessingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationInputProcessingConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationInputProcessingConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationInputProcessingConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationInputProcessingConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationInputProcessingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationInputProcessingConfiguration",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Deletes output destination configuration from
// your application configuration. Amazon Kinesis Analytics will no longer write
// data from the corresponding in-application stream to the external output
// destination. This operation requires permissions to perform the
// kinesisanalytics:DeleteApplicationOutput action.
func (c *Client) DeleteApplicationOutput(ctx context.Context, params *DeleteApplicationOutputInput, optFns ...func(*Options)) (*DeleteApplicationOutputOutput, error) {
if params == nil {
params = &DeleteApplicationOutputInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationOutput", params, optFns, c.addOperationDeleteApplicationOutputMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationOutputOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationOutputInput struct {
// Amazon Kinesis Analytics application name.
//
// This member is required.
ApplicationName *string
// Amazon Kinesis Analytics application version. You can use the
// DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to get the current application version. If the version specified is
// not the current version, the ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// The ID of the configuration to delete. Each output configuration that is added
// to the application, either when the application is created or later using the
// AddApplicationOutput (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_AddApplicationOutput.html)
// operation, has a unique ID. You need to provide the ID to uniquely identify the
// output configuration that you want to delete from the application configuration.
// You can use the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to get the specific OutputId .
//
// This member is required.
OutputId *string
noSmithyDocumentSerde
}
type DeleteApplicationOutputOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationOutputMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationOutput{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationOutput{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationOutputValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationOutput(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationOutput(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationOutput",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Deletes a reference data source configuration
// from the specified application configuration. If the application is running,
// Amazon Kinesis Analytics immediately removes the in-application table that you
// created using the AddApplicationReferenceDataSource (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_AddApplicationReferenceDataSource.html)
// operation. This operation requires permissions to perform the
// kinesisanalytics.DeleteApplicationReferenceDataSource action.
func (c *Client) DeleteApplicationReferenceDataSource(ctx context.Context, params *DeleteApplicationReferenceDataSourceInput, optFns ...func(*Options)) (*DeleteApplicationReferenceDataSourceOutput, error) {
if params == nil {
params = &DeleteApplicationReferenceDataSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationReferenceDataSource", params, optFns, c.addOperationDeleteApplicationReferenceDataSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationReferenceDataSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationReferenceDataSourceInput struct {
// Name of an existing application.
//
// This member is required.
ApplicationName *string
// Version of the application. You can use the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to get the current application version. If the version specified is
// not the current version, the ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// ID of the reference data source. When you add a reference data source to your
// application using the AddApplicationReferenceDataSource (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_AddApplicationReferenceDataSource.html)
// , Amazon Kinesis Analytics assigns an ID. You can use the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to get the reference ID.
//
// This member is required.
ReferenceId *string
noSmithyDocumentSerde
}
type DeleteApplicationReferenceDataSourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationReferenceDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationReferenceDataSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationReferenceDataSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationReferenceDataSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationReferenceDataSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationReferenceDataSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationReferenceDataSource",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Returns information about a specific Amazon
// Kinesis Analytics application. If you want to retrieve a list of all
// applications in your account, use the ListApplications (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_ListApplications.html)
// operation. This operation requires permissions to perform the
// kinesisanalytics:DescribeApplication action. You can use DescribeApplication to
// get the current application versionId, which you need to call other operations
// such as Update .
func (c *Client) DescribeApplication(ctx context.Context, params *DescribeApplicationInput, optFns ...func(*Options)) (*DescribeApplicationOutput, error) {
if params == nil {
params = &DescribeApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeApplication", params, optFns, c.addOperationDescribeApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeApplicationInput struct {
// Name of the application.
//
// This member is required.
ApplicationName *string
noSmithyDocumentSerde
}
type DescribeApplicationOutput struct {
// Provides a description of the application, such as the application Amazon
// Resource Name (ARN), status, latest version, and input and output configuration
// details.
//
// This member is required.
ApplicationDetail *types.ApplicationDetail
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DescribeApplication",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Infers a schema by evaluating sample records on
// the specified streaming source (Amazon Kinesis stream or Amazon Kinesis Firehose
// delivery stream) or S3 object. In the response, the operation returns the
// inferred schema and also the sample records that the operation used to infer the
// schema. You can use the inferred schema when configuring a streaming source for
// your application. For conceptual information, see Configuring Application Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html)
// . Note that when you create an application using the Amazon Kinesis Analytics
// console, the console uses this operation to infer a schema and show it in the
// console user interface. This operation requires permissions to perform the
// kinesisanalytics:DiscoverInputSchema action.
func (c *Client) DiscoverInputSchema(ctx context.Context, params *DiscoverInputSchemaInput, optFns ...func(*Options)) (*DiscoverInputSchemaOutput, error) {
if params == nil {
params = &DiscoverInputSchemaInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DiscoverInputSchema", params, optFns, c.addOperationDiscoverInputSchemaMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DiscoverInputSchemaOutput)
out.ResultMetadata = metadata
return out, nil
}
type DiscoverInputSchemaInput struct {
// The InputProcessingConfiguration (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputProcessingConfiguration.html)
// to use to preprocess the records before discovering the schema of the records.
InputProcessingConfiguration *types.InputProcessingConfiguration
// Point at which you want Amazon Kinesis Analytics to start reading records from
// the specified streaming source discovery purposes.
InputStartingPositionConfiguration *types.InputStartingPositionConfiguration
// Amazon Resource Name (ARN) of the streaming source.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream on your behalf.
RoleARN *string
// Specify this parameter to discover a schema from data in an Amazon S3 object.
S3Configuration *types.S3Configuration
noSmithyDocumentSerde
}
type DiscoverInputSchemaOutput struct {
// Schema inferred from the streaming source. It identifies the format of the data
// in the streaming source and how each data element maps to corresponding columns
// in the in-application stream that you can create.
InputSchema *types.SourceSchema
// An array of elements, where each element corresponds to a row in a stream
// record (a stream record can have more than one row).
ParsedInputRecords [][]string
// Stream data that was modified by the processor specified in the
// InputProcessingConfiguration parameter.
ProcessedInputRecords []string
// Raw stream data that was sampled to infer the schema.
RawInputRecords []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDiscoverInputSchemaMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDiscoverInputSchema{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDiscoverInputSchema{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDiscoverInputSchemaValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDiscoverInputSchema(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDiscoverInputSchema(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DiscoverInputSchema",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Returns a list of Amazon Kinesis Analytics
// applications in your account. For each application, the response includes the
// application name, Amazon Resource Name (ARN), and status. If the response
// returns the HasMoreApplications value as true,
//
// you can send another request by adding the ExclusiveStartApplicationName in the
// request body, and set the value of this to the last application name from the
// previous response. If you want detailed information about a specific
// application, use DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// . This operation requires permissions to perform the
// kinesisanalytics:ListApplications action.
func (c *Client) ListApplications(ctx context.Context, params *ListApplicationsInput, optFns ...func(*Options)) (*ListApplicationsOutput, error) {
if params == nil {
params = &ListApplicationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListApplications", params, optFns, c.addOperationListApplicationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListApplicationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListApplicationsInput struct {
// Name of the application to start the list with. When using pagination to
// retrieve the list, you don't need to specify this parameter in the first
// request. However, in subsequent requests, you add the last application name from
// the previous response to get the next page of applications.
ExclusiveStartApplicationName *string
// Maximum number of applications to list.
Limit *int32
noSmithyDocumentSerde
}
type ListApplicationsOutput struct {
// List of ApplicationSummary objects.
//
// This member is required.
ApplicationSummaries []types.ApplicationSummary
// Returns true if there are more applications to retrieve.
//
// This member is required.
HasMoreApplications *bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListApplications{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListApplications{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListApplications(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "ListApplications",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the list of key-value tags assigned to the application. For more
// information, see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-tagging.html)
// .
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The ARN of the application for which to retrieve tags.
//
// This member is required.
ResourceARN *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The key-value tags assigned to the application.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "ListTagsForResource",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Starts the specified Amazon Kinesis Analytics
// application. After creating an application, you must exclusively call this
// operation to start your application. After the application starts, it begins
// consuming the input data, processes it, and writes the output to the configured
// destination. The application status must be READY for you to start an
// application. You can get the application status in the console or using the
// DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation. After you start the application, you can stop the application from
// processing the input by calling the StopApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_StopApplication.html)
// operation. This operation requires permissions to perform the
// kinesisanalytics:StartApplication action.
func (c *Client) StartApplication(ctx context.Context, params *StartApplicationInput, optFns ...func(*Options)) (*StartApplicationOutput, error) {
if params == nil {
params = &StartApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartApplication", params, optFns, c.addOperationStartApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartApplicationInput struct {
// Name of the application.
//
// This member is required.
ApplicationName *string
// Identifies the specific input, by ID, that the application starts consuming.
// Amazon Kinesis Analytics starts reading the streaming source associated with the
// input. You can also specify where in the streaming source you want Amazon
// Kinesis Analytics to start reading.
//
// This member is required.
InputConfigurations []types.InputConfiguration
noSmithyDocumentSerde
}
type StartApplicationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStartApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "StartApplication",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Stops the application from processing input
// data. You can stop an application only if it is in the running state. You can
// use the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to find the application state. After the application is stopped,
// Amazon Kinesis Analytics stops reading data from the input, the application
// stops processing data, and there is no output written to the destination. This
// operation requires permissions to perform the kinesisanalytics:StopApplication
// action.
func (c *Client) StopApplication(ctx context.Context, params *StopApplicationInput, optFns ...func(*Options)) (*StopApplicationOutput, error) {
if params == nil {
params = &StopApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopApplication", params, optFns, c.addOperationStopApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopApplicationInput struct {
// Name of the running application to stop.
//
// This member is required.
ApplicationName *string
noSmithyDocumentSerde
}
type StopApplicationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStopApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "StopApplication",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds one or more key-value tags to a Kinesis Analytics application. Note that
// the maximum number of application tags includes system tags. The maximum number
// of user-defined application tags is 50. For more information, see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-tagging.html)
// .
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The ARN of the application to assign the tags.
//
// This member is required.
ResourceARN *string
// The key-value tags to assign to the application.
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "TagResource",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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 one or more tags from a Kinesis Analytics application. For more
// information, see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-tagging.html)
// .
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The ARN of the Kinesis Analytics application from which to remove the tags.
//
// This member is required.
ResourceARN *string
// A list of keys of tags to remove from the specified application.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "UntagResource",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Updates an existing Amazon Kinesis Analytics
// application. Using this API, you can update application code, input
// configuration, and output configuration. Note that Amazon Kinesis Analytics
// updates the CurrentApplicationVersionId each time you update your application.
// This operation requires permission for the kinesisanalytics:UpdateApplication
// action.
func (c *Client) UpdateApplication(ctx context.Context, params *UpdateApplicationInput, optFns ...func(*Options)) (*UpdateApplicationOutput, error) {
if params == nil {
params = &UpdateApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateApplication", params, optFns, c.addOperationUpdateApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateApplicationInput struct {
// Name of the Amazon Kinesis Analytics application to update.
//
// This member is required.
ApplicationName *string
// Describes application updates.
//
// This member is required.
ApplicationUpdate *types.ApplicationUpdate
// The current application version ID. You can use the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to get this value.
//
// This member is required.
CurrentApplicationVersionId *int64
noSmithyDocumentSerde
}
type UpdateApplicationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "UpdateApplication",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/kinesisanalytics/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsAwsjson11_deserializeOpAddApplicationCloudWatchLoggingOption struct {
}
func (*awsAwsjson11_deserializeOpAddApplicationCloudWatchLoggingOption) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddApplicationCloudWatchLoggingOption) 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_deserializeOpErrorAddApplicationCloudWatchLoggingOption(response, &metadata)
}
output := &AddApplicationCloudWatchLoggingOptionOutput{}
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_deserializeOpDocumentAddApplicationCloudWatchLoggingOptionOutput(&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_deserializeOpErrorAddApplicationCloudWatchLoggingOption(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAddApplicationInput struct {
}
func (*awsAwsjson11_deserializeOpAddApplicationInput) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddApplicationInput) 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_deserializeOpErrorAddApplicationInput(response, &metadata)
}
output := &AddApplicationInputOutput{}
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_deserializeOpDocumentAddApplicationInputOutput(&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_deserializeOpErrorAddApplicationInput(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("CodeValidationException", errorCode):
return awsAwsjson11_deserializeErrorCodeValidationException(response, errorBody)
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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAddApplicationInputProcessingConfiguration struct {
}
func (*awsAwsjson11_deserializeOpAddApplicationInputProcessingConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddApplicationInputProcessingConfiguration) 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_deserializeOpErrorAddApplicationInputProcessingConfiguration(response, &metadata)
}
output := &AddApplicationInputProcessingConfigurationOutput{}
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_deserializeOpDocumentAddApplicationInputProcessingConfigurationOutput(&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_deserializeOpErrorAddApplicationInputProcessingConfiguration(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAddApplicationOutput struct {
}
func (*awsAwsjson11_deserializeOpAddApplicationOutput) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddApplicationOutput) 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_deserializeOpErrorAddApplicationOutput(response, &metadata)
}
output := &AddApplicationOutputOutput{}
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_deserializeOpDocumentAddApplicationOutputOutput(&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_deserializeOpErrorAddApplicationOutput(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAddApplicationReferenceDataSource struct {
}
func (*awsAwsjson11_deserializeOpAddApplicationReferenceDataSource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddApplicationReferenceDataSource) 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_deserializeOpErrorAddApplicationReferenceDataSource(response, &metadata)
}
output := &AddApplicationReferenceDataSourceOutput{}
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_deserializeOpDocumentAddApplicationReferenceDataSourceOutput(&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_deserializeOpErrorAddApplicationReferenceDataSource(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateApplication struct {
}
func (*awsAwsjson11_deserializeOpCreateApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateApplication) 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_deserializeOpErrorCreateApplication(response, &metadata)
}
output := &CreateApplicationOutput{}
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_deserializeOpDocumentCreateApplicationOutput(&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_deserializeOpErrorCreateApplication(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("CodeValidationException", errorCode):
return awsAwsjson11_deserializeErrorCodeValidationException(response, errorBody)
case strings.EqualFold("ConcurrentModificationException", errorCode):
return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody)
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("TooManyTagsException", errorCode):
return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteApplication struct {
}
func (*awsAwsjson11_deserializeOpDeleteApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteApplication) 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_deserializeOpErrorDeleteApplication(response, &metadata)
}
output := &DeleteApplicationOutput{}
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_deserializeOpDocumentDeleteApplicationOutput(&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_deserializeOpErrorDeleteApplication(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("ResourceInUseException", errorCode):
return awsAwsjson11_deserializeErrorResourceInUseException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteApplicationCloudWatchLoggingOption struct {
}
func (*awsAwsjson11_deserializeOpDeleteApplicationCloudWatchLoggingOption) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteApplicationCloudWatchLoggingOption) 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_deserializeOpErrorDeleteApplicationCloudWatchLoggingOption(response, &metadata)
}
output := &DeleteApplicationCloudWatchLoggingOptionOutput{}
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_deserializeOpDocumentDeleteApplicationCloudWatchLoggingOptionOutput(&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_deserializeOpErrorDeleteApplicationCloudWatchLoggingOption(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteApplicationInputProcessingConfiguration struct {
}
func (*awsAwsjson11_deserializeOpDeleteApplicationInputProcessingConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteApplicationInputProcessingConfiguration) 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_deserializeOpErrorDeleteApplicationInputProcessingConfiguration(response, &metadata)
}
output := &DeleteApplicationInputProcessingConfigurationOutput{}
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_deserializeOpDocumentDeleteApplicationInputProcessingConfigurationOutput(&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_deserializeOpErrorDeleteApplicationInputProcessingConfiguration(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteApplicationOutput struct {
}
func (*awsAwsjson11_deserializeOpDeleteApplicationOutput) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteApplicationOutput) 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_deserializeOpErrorDeleteApplicationOutput(response, &metadata)
}
output := &DeleteApplicationOutputOutput{}
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_deserializeOpDocumentDeleteApplicationOutputOutput(&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_deserializeOpErrorDeleteApplicationOutput(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteApplicationReferenceDataSource struct {
}
func (*awsAwsjson11_deserializeOpDeleteApplicationReferenceDataSource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteApplicationReferenceDataSource) 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_deserializeOpErrorDeleteApplicationReferenceDataSource(response, &metadata)
}
output := &DeleteApplicationReferenceDataSourceOutput{}
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_deserializeOpDocumentDeleteApplicationReferenceDataSourceOutput(&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_deserializeOpErrorDeleteApplicationReferenceDataSource(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeApplication struct {
}
func (*awsAwsjson11_deserializeOpDescribeApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeApplication) 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_deserializeOpErrorDescribeApplication(response, &metadata)
}
output := &DescribeApplicationOutput{}
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_deserializeOpDocumentDescribeApplicationOutput(&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_deserializeOpErrorDescribeApplication(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDiscoverInputSchema struct {
}
func (*awsAwsjson11_deserializeOpDiscoverInputSchema) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDiscoverInputSchema) 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_deserializeOpErrorDiscoverInputSchema(response, &metadata)
}
output := &DiscoverInputSchemaOutput{}
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_deserializeOpDocumentDiscoverInputSchemaOutput(&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_deserializeOpErrorDiscoverInputSchema(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("ResourceProvisionedThroughputExceededException", errorCode):
return awsAwsjson11_deserializeErrorResourceProvisionedThroughputExceededException(response, errorBody)
case strings.EqualFold("ServiceUnavailableException", errorCode):
return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody)
case strings.EqualFold("UnableToDetectSchemaException", errorCode):
return awsAwsjson11_deserializeErrorUnableToDetectSchemaException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListApplications struct {
}
func (*awsAwsjson11_deserializeOpListApplications) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListApplications) 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_deserializeOpErrorListApplications(response, &metadata)
}
output := &ListApplicationsOutput{}
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_deserializeOpDocumentListApplicationsOutput(&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_deserializeOpErrorListApplications(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_deserializeOpListTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ConcurrentModificationException", errorCode):
return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("InvalidArgumentException", errorCode):
return awsAwsjson11_deserializeErrorInvalidArgumentException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStartApplication struct {
}
func (*awsAwsjson11_deserializeOpStartApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStartApplication) 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_deserializeOpErrorStartApplication(response, &metadata)
}
output := &StartApplicationOutput{}
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_deserializeOpDocumentStartApplicationOutput(&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_deserializeOpErrorStartApplication(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("InvalidApplicationConfigurationException", errorCode):
return awsAwsjson11_deserializeErrorInvalidApplicationConfigurationException(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStopApplication struct {
}
func (*awsAwsjson11_deserializeOpStopApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStopApplication) 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_deserializeOpErrorStopApplication(response, &metadata)
}
output := &StopApplicationOutput{}
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_deserializeOpDocumentStopApplicationOutput(&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_deserializeOpErrorStopApplication(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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTagResource struct {
}
func (*awsAwsjson11_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("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)
case strings.EqualFold("TooManyTagsException", errorCode):
return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUntagResource struct {
}
func (*awsAwsjson11_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("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)
case strings.EqualFold("TooManyTagsException", errorCode):
return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateApplication struct {
}
func (*awsAwsjson11_deserializeOpUpdateApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateApplication) 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_deserializeOpErrorUpdateApplication(response, &metadata)
}
output := &UpdateApplicationOutput{}
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_deserializeOpDocumentUpdateApplicationOutput(&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_deserializeOpErrorUpdateApplication(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("CodeValidationException", errorCode):
return awsAwsjson11_deserializeErrorCodeValidationException(response, errorBody)
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)
case strings.EqualFold("UnsupportedOperationException", errorCode):
return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorCodeValidationException(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.CodeValidationException{}
err := awsAwsjson11_deserializeDocumentCodeValidationException(&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_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_deserializeErrorInvalidApplicationConfigurationException(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.InvalidApplicationConfigurationException{}
err := awsAwsjson11_deserializeDocumentInvalidApplicationConfigurationException(&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_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_deserializeErrorResourceProvisionedThroughputExceededException(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.ResourceProvisionedThroughputExceededException{}
err := awsAwsjson11_deserializeDocumentResourceProvisionedThroughputExceededException(&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_deserializeErrorTooManyTagsException(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.TooManyTagsException{}
err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorUnableToDetectSchemaException(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.UnableToDetectSchemaException{}
err := awsAwsjson11_deserializeDocumentUnableToDetectSchemaException(&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_deserializeErrorUnsupportedOperationException(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.UnsupportedOperationException{}
err := awsAwsjson11_deserializeDocumentUnsupportedOperationException(&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_deserializeDocumentApplicationDetail(v **types.ApplicationDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ApplicationDetail
if *v == nil {
sv = &types.ApplicationDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ApplicationARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value)
}
sv.ApplicationARN = ptr.String(jtv)
}
case "ApplicationCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApplicationCode to be of type string, got %T instead", value)
}
sv.ApplicationCode = ptr.String(jtv)
}
case "ApplicationDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApplicationDescription to be of type string, got %T instead", value)
}
sv.ApplicationDescription = ptr.String(jtv)
}
case "ApplicationName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value)
}
sv.ApplicationName = ptr.String(jtv)
}
case "ApplicationStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApplicationStatus to be of type string, got %T instead", value)
}
sv.ApplicationStatus = types.ApplicationStatus(jtv)
}
case "ApplicationVersionId":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ApplicationVersionId to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ApplicationVersionId = ptr.Int64(i64)
}
case "CloudWatchLoggingOptionDescriptions":
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptionDescriptions(&sv.CloudWatchLoggingOptionDescriptions, value); err != nil {
return err
}
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 "InputDescriptions":
if err := awsAwsjson11_deserializeDocumentInputDescriptions(&sv.InputDescriptions, value); err != nil {
return err
}
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 "OutputDescriptions":
if err := awsAwsjson11_deserializeDocumentOutputDescriptions(&sv.OutputDescriptions, value); err != nil {
return err
}
case "ReferenceDataSourceDescriptions":
if err := awsAwsjson11_deserializeDocumentReferenceDataSourceDescriptions(&sv.ReferenceDataSourceDescriptions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentApplicationSummaries(v *[]types.ApplicationSummary, 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.ApplicationSummary
if *v == nil {
cv = []types.ApplicationSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ApplicationSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentApplicationSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentApplicationSummary(v **types.ApplicationSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ApplicationSummary
if *v == nil {
sv = &types.ApplicationSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ApplicationARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value)
}
sv.ApplicationARN = ptr.String(jtv)
}
case "ApplicationName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApplicationName to be of type string, got %T instead", value)
}
sv.ApplicationName = ptr.String(jtv)
}
case "ApplicationStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ApplicationStatus to be of type string, got %T instead", value)
}
sv.ApplicationStatus = types.ApplicationStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCloudWatchLoggingOptionDescription(v **types.CloudWatchLoggingOptionDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CloudWatchLoggingOptionDescription
if *v == nil {
sv = &types.CloudWatchLoggingOptionDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CloudWatchLoggingOptionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.CloudWatchLoggingOptionId = ptr.String(jtv)
}
case "LogStreamARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LogStreamARN to be of type string, got %T instead", value)
}
sv.LogStreamARN = 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_deserializeDocumentCloudWatchLoggingOptionDescriptions(v *[]types.CloudWatchLoggingOptionDescription, 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.CloudWatchLoggingOptionDescription
if *v == nil {
cv = []types.CloudWatchLoggingOptionDescription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CloudWatchLoggingOptionDescription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCloudWatchLoggingOptionDescription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCodeValidationException(v **types.CodeValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CodeValidationException
if *v == nil {
sv = &types.CodeValidationException{}
} 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_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_deserializeDocumentCSVMappingParameters(v **types.CSVMappingParameters, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CSVMappingParameters
if *v == nil {
sv = &types.CSVMappingParameters{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RecordColumnDelimiter":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecordColumnDelimiter to be of type string, got %T instead", value)
}
sv.RecordColumnDelimiter = ptr.String(jtv)
}
case "RecordRowDelimiter":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecordRowDelimiter to be of type string, got %T instead", value)
}
sv.RecordRowDelimiter = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentDestinationSchema(v **types.DestinationSchema, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DestinationSchema
if *v == nil {
sv = &types.DestinationSchema{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RecordFormatType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecordFormatType to be of type string, got %T instead", value)
}
sv.RecordFormatType = types.RecordFormatType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInAppStreamNames(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 InAppStreamName to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInputDescription(v **types.InputDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InputDescription
if *v == nil {
sv = &types.InputDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InAppStreamNames":
if err := awsAwsjson11_deserializeDocumentInAppStreamNames(&sv.InAppStreamNames, value); err != nil {
return err
}
case "InputId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.InputId = ptr.String(jtv)
}
case "InputParallelism":
if err := awsAwsjson11_deserializeDocumentInputParallelism(&sv.InputParallelism, value); err != nil {
return err
}
case "InputProcessingConfigurationDescription":
if err := awsAwsjson11_deserializeDocumentInputProcessingConfigurationDescription(&sv.InputProcessingConfigurationDescription, value); err != nil {
return err
}
case "InputSchema":
if err := awsAwsjson11_deserializeDocumentSourceSchema(&sv.InputSchema, value); err != nil {
return err
}
case "InputStartingPositionConfiguration":
if err := awsAwsjson11_deserializeDocumentInputStartingPositionConfiguration(&sv.InputStartingPositionConfiguration, value); err != nil {
return err
}
case "KinesisFirehoseInputDescription":
if err := awsAwsjson11_deserializeDocumentKinesisFirehoseInputDescription(&sv.KinesisFirehoseInputDescription, value); err != nil {
return err
}
case "KinesisStreamsInputDescription":
if err := awsAwsjson11_deserializeDocumentKinesisStreamsInputDescription(&sv.KinesisStreamsInputDescription, value); err != nil {
return err
}
case "NamePrefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InAppStreamName to be of type string, got %T instead", value)
}
sv.NamePrefix = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInputDescriptions(v *[]types.InputDescription, 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.InputDescription
if *v == nil {
cv = []types.InputDescription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.InputDescription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentInputDescription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInputLambdaProcessorDescription(v **types.InputLambdaProcessorDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InputLambdaProcessorDescription
if *v == nil {
sv = &types.InputLambdaProcessorDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value)
}
sv.ResourceARN = 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_deserializeDocumentInputParallelism(v **types.InputParallelism, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InputParallelism
if *v == nil {
sv = &types.InputParallelism{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Count":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected InputParallelismCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Count = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInputProcessingConfigurationDescription(v **types.InputProcessingConfigurationDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InputProcessingConfigurationDescription
if *v == nil {
sv = &types.InputProcessingConfigurationDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InputLambdaProcessorDescription":
if err := awsAwsjson11_deserializeDocumentInputLambdaProcessorDescription(&sv.InputLambdaProcessorDescription, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInputStartingPositionConfiguration(v **types.InputStartingPositionConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InputStartingPositionConfiguration
if *v == nil {
sv = &types.InputStartingPositionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InputStartingPosition":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InputStartingPosition to be of type string, got %T instead", value)
}
sv.InputStartingPosition = types.InputStartingPosition(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidApplicationConfigurationException(v **types.InvalidApplicationConfigurationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidApplicationConfigurationException
if *v == nil {
sv = &types.InvalidApplicationConfigurationException{}
} 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_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_deserializeDocumentJSONMappingParameters(v **types.JSONMappingParameters, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JSONMappingParameters
if *v == nil {
sv = &types.JSONMappingParameters{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RecordRowPath":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecordRowPath to be of type string, got %T instead", value)
}
sv.RecordRowPath = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentKinesisFirehoseInputDescription(v **types.KinesisFirehoseInputDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KinesisFirehoseInputDescription
if *v == nil {
sv = &types.KinesisFirehoseInputDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value)
}
sv.ResourceARN = 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_deserializeDocumentKinesisFirehoseOutputDescription(v **types.KinesisFirehoseOutputDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KinesisFirehoseOutputDescription
if *v == nil {
sv = &types.KinesisFirehoseOutputDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value)
}
sv.ResourceARN = 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_deserializeDocumentKinesisStreamsInputDescription(v **types.KinesisStreamsInputDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KinesisStreamsInputDescription
if *v == nil {
sv = &types.KinesisStreamsInputDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value)
}
sv.ResourceARN = 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_deserializeDocumentKinesisStreamsOutputDescription(v **types.KinesisStreamsOutputDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KinesisStreamsOutputDescription
if *v == nil {
sv = &types.KinesisStreamsOutputDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value)
}
sv.ResourceARN = 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_deserializeDocumentLambdaOutputDescription(v **types.LambdaOutputDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LambdaOutputDescription
if *v == nil {
sv = &types.LambdaOutputDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ResourceARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceARN to be of type string, got %T instead", value)
}
sv.ResourceARN = 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_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_deserializeDocumentMappingParameters(v **types.MappingParameters, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MappingParameters
if *v == nil {
sv = &types.MappingParameters{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CSVMappingParameters":
if err := awsAwsjson11_deserializeDocumentCSVMappingParameters(&sv.CSVMappingParameters, value); err != nil {
return err
}
case "JSONMappingParameters":
if err := awsAwsjson11_deserializeDocumentJSONMappingParameters(&sv.JSONMappingParameters, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOutputDescription(v **types.OutputDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OutputDescription
if *v == nil {
sv = &types.OutputDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DestinationSchema":
if err := awsAwsjson11_deserializeDocumentDestinationSchema(&sv.DestinationSchema, value); err != nil {
return err
}
case "KinesisFirehoseOutputDescription":
if err := awsAwsjson11_deserializeDocumentKinesisFirehoseOutputDescription(&sv.KinesisFirehoseOutputDescription, value); err != nil {
return err
}
case "KinesisStreamsOutputDescription":
if err := awsAwsjson11_deserializeDocumentKinesisStreamsOutputDescription(&sv.KinesisStreamsOutputDescription, value); err != nil {
return err
}
case "LambdaOutputDescription":
if err := awsAwsjson11_deserializeDocumentLambdaOutputDescription(&sv.LambdaOutputDescription, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InAppStreamName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "OutputId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.OutputId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOutputDescriptions(v *[]types.OutputDescription, 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.OutputDescription
if *v == nil {
cv = []types.OutputDescription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.OutputDescription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentOutputDescription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentParsedInputRecord(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 ParsedInputRecordField to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentParsedInputRecords(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 err := awsAwsjson11_deserializeDocumentParsedInputRecord(&col, value); err != nil {
return err
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentProcessedInputRecords(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 ProcessedInputRecord to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRawInputRecords(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 RawInputRecord to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRecordColumn(v **types.RecordColumn, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RecordColumn
if *v == nil {
sv = &types.RecordColumn{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Mapping":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecordColumnMapping to be of type string, got %T instead", value)
}
sv.Mapping = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecordColumnName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "SqlType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecordColumnSqlType to be of type string, got %T instead", value)
}
sv.SqlType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentRecordColumns(v *[]types.RecordColumn, 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.RecordColumn
if *v == nil {
cv = []types.RecordColumn{}
} else {
cv = *v
}
for _, value := range shape {
var col types.RecordColumn
destAddr := &col
if err := awsAwsjson11_deserializeDocumentRecordColumn(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentRecordFormat(v **types.RecordFormat, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RecordFormat
if *v == nil {
sv = &types.RecordFormat{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MappingParameters":
if err := awsAwsjson11_deserializeDocumentMappingParameters(&sv.MappingParameters, value); err != nil {
return err
}
case "RecordFormatType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecordFormatType to be of type string, got %T instead", value)
}
sv.RecordFormatType = types.RecordFormatType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentReferenceDataSourceDescription(v **types.ReferenceDataSourceDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ReferenceDataSourceDescription
if *v == nil {
sv = &types.ReferenceDataSourceDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ReferenceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Id to be of type string, got %T instead", value)
}
sv.ReferenceId = ptr.String(jtv)
}
case "ReferenceSchema":
if err := awsAwsjson11_deserializeDocumentSourceSchema(&sv.ReferenceSchema, value); err != nil {
return err
}
case "S3ReferenceDataSourceDescription":
if err := awsAwsjson11_deserializeDocumentS3ReferenceDataSourceDescription(&sv.S3ReferenceDataSourceDescription, value); err != nil {
return err
}
case "TableName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InAppTableName to be of type string, got %T instead", value)
}
sv.TableName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentReferenceDataSourceDescriptions(v *[]types.ReferenceDataSourceDescription, 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.ReferenceDataSourceDescription
if *v == nil {
cv = []types.ReferenceDataSourceDescription{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ReferenceDataSourceDescription
destAddr := &col
if err := awsAwsjson11_deserializeDocumentReferenceDataSourceDescription(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
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_deserializeDocumentResourceProvisionedThroughputExceededException(v **types.ResourceProvisionedThroughputExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceProvisionedThroughputExceededException
if *v == nil {
sv = &types.ResourceProvisionedThroughputExceededException{}
} 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_deserializeDocumentS3ReferenceDataSourceDescription(v **types.S3ReferenceDataSourceDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.S3ReferenceDataSourceDescription
if *v == nil {
sv = &types.S3ReferenceDataSourceDescription{}
} 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 "FileKey":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FileKey to be of type string, got %T instead", value)
}
sv.FileKey = ptr.String(jtv)
}
case "ReferenceRoleARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value)
}
sv.ReferenceRoleARN = ptr.String(jtv)
}
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_deserializeDocumentSourceSchema(v **types.SourceSchema, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SourceSchema
if *v == nil {
sv = &types.SourceSchema{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RecordColumns":
if err := awsAwsjson11_deserializeDocumentRecordColumns(&sv.RecordColumns, value); err != nil {
return err
}
case "RecordEncoding":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecordEncoding to be of type string, got %T instead", value)
}
sv.RecordEncoding = ptr.String(jtv)
}
case "RecordFormat":
if err := awsAwsjson11_deserializeDocumentRecordFormat(&sv.RecordFormat, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTags(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TooManyTagsException
if *v == nil {
sv = &types.TooManyTagsException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentUnableToDetectSchemaException(v **types.UnableToDetectSchemaException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.UnableToDetectSchemaException
if *v == nil {
sv = &types.UnableToDetectSchemaException{}
} 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)
}
case "ProcessedInputRecords":
if err := awsAwsjson11_deserializeDocumentProcessedInputRecords(&sv.ProcessedInputRecords, value); err != nil {
return err
}
case "RawInputRecords":
if err := awsAwsjson11_deserializeDocumentRawInputRecords(&sv.RawInputRecords, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentUnsupportedOperationException(v **types.UnsupportedOperationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.UnsupportedOperationException
if *v == nil {
sv = &types.UnsupportedOperationException{}
} 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_deserializeOpDocumentAddApplicationCloudWatchLoggingOptionOutput(v **AddApplicationCloudWatchLoggingOptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddApplicationCloudWatchLoggingOptionOutput
if *v == nil {
sv = &AddApplicationCloudWatchLoggingOptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddApplicationInputOutput(v **AddApplicationInputOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddApplicationInputOutput
if *v == nil {
sv = &AddApplicationInputOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddApplicationInputProcessingConfigurationOutput(v **AddApplicationInputProcessingConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddApplicationInputProcessingConfigurationOutput
if *v == nil {
sv = &AddApplicationInputProcessingConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddApplicationOutputOutput(v **AddApplicationOutputOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddApplicationOutputOutput
if *v == nil {
sv = &AddApplicationOutputOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddApplicationReferenceDataSourceOutput(v **AddApplicationReferenceDataSourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddApplicationReferenceDataSourceOutput
if *v == nil {
sv = &AddApplicationReferenceDataSourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateApplicationOutput(v **CreateApplicationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateApplicationOutput
if *v == nil {
sv = &CreateApplicationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ApplicationSummary":
if err := awsAwsjson11_deserializeDocumentApplicationSummary(&sv.ApplicationSummary, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteApplicationCloudWatchLoggingOptionOutput(v **DeleteApplicationCloudWatchLoggingOptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteApplicationCloudWatchLoggingOptionOutput
if *v == nil {
sv = &DeleteApplicationCloudWatchLoggingOptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteApplicationInputProcessingConfigurationOutput(v **DeleteApplicationInputProcessingConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteApplicationInputProcessingConfigurationOutput
if *v == nil {
sv = &DeleteApplicationInputProcessingConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteApplicationOutput(v **DeleteApplicationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteApplicationOutput
if *v == nil {
sv = &DeleteApplicationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteApplicationOutputOutput(v **DeleteApplicationOutputOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteApplicationOutputOutput
if *v == nil {
sv = &DeleteApplicationOutputOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteApplicationReferenceDataSourceOutput(v **DeleteApplicationReferenceDataSourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteApplicationReferenceDataSourceOutput
if *v == nil {
sv = &DeleteApplicationReferenceDataSourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeApplicationOutput(v **DescribeApplicationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeApplicationOutput
if *v == nil {
sv = &DescribeApplicationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ApplicationDetail":
if err := awsAwsjson11_deserializeDocumentApplicationDetail(&sv.ApplicationDetail, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDiscoverInputSchemaOutput(v **DiscoverInputSchemaOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DiscoverInputSchemaOutput
if *v == nil {
sv = &DiscoverInputSchemaOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InputSchema":
if err := awsAwsjson11_deserializeDocumentSourceSchema(&sv.InputSchema, value); err != nil {
return err
}
case "ParsedInputRecords":
if err := awsAwsjson11_deserializeDocumentParsedInputRecords(&sv.ParsedInputRecords, value); err != nil {
return err
}
case "ProcessedInputRecords":
if err := awsAwsjson11_deserializeDocumentProcessedInputRecords(&sv.ProcessedInputRecords, value); err != nil {
return err
}
case "RawInputRecords":
if err := awsAwsjson11_deserializeDocumentRawInputRecords(&sv.RawInputRecords, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListApplicationsOutput(v **ListApplicationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListApplicationsOutput
if *v == nil {
sv = &ListApplicationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ApplicationSummaries":
if err := awsAwsjson11_deserializeDocumentApplicationSummaries(&sv.ApplicationSummaries, value); err != nil {
return err
}
case "HasMoreApplications":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.HasMoreApplications = ptr.Bool(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Tags":
if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStartApplicationOutput(v **StartApplicationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartApplicationOutput
if *v == nil {
sv = &StartApplicationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStopApplicationOutput(v **StopApplicationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StopApplicationOutput
if *v == nil {
sv = &StopApplicationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagResourceOutput
if *v == nil {
sv = &TagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagResourceOutput
if *v == nil {
sv = &UntagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUpdateApplicationOutput(v **UpdateApplicationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateApplicationOutput
if *v == nil {
sv = &UpdateApplicationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 5,754 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package kinesisanalytics provides the API client, operations, and parameter
// types for Amazon Kinesis Analytics.
//
// Amazon Kinesis Analytics Overview This documentation is for version 1 of the
// Amazon Kinesis Data Analytics API, which only supports SQL applications. Version
// 2 of the API supports SQL and Java applications. For more information about
// version 2, see Amazon Kinesis Data Analytics API V2 Documentation . This is the
// Amazon Kinesis Analytics v1 API Reference. The Amazon Kinesis Analytics
// Developer Guide provides additional information.
package kinesisanalytics
| 13 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
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/kinesisanalytics/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 = "kinesisanalytics"
}
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 kinesisanalytics
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.14.15"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/kinesisanalytics/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"path"
)
type awsAwsjson11_serializeOpAddApplicationCloudWatchLoggingOption struct {
}
func (*awsAwsjson11_serializeOpAddApplicationCloudWatchLoggingOption) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddApplicationCloudWatchLoggingOption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddApplicationCloudWatchLoggingOptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.AddApplicationCloudWatchLoggingOption")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddApplicationCloudWatchLoggingOptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpAddApplicationInput struct {
}
func (*awsAwsjson11_serializeOpAddApplicationInput) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddApplicationInput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddApplicationInputInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.AddApplicationInput")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddApplicationInputInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpAddApplicationInputProcessingConfiguration struct {
}
func (*awsAwsjson11_serializeOpAddApplicationInputProcessingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddApplicationInputProcessingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddApplicationInputProcessingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.AddApplicationInputProcessingConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddApplicationInputProcessingConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpAddApplicationOutput struct {
}
func (*awsAwsjson11_serializeOpAddApplicationOutput) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddApplicationOutput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddApplicationOutputInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.AddApplicationOutput")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddApplicationOutputInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpAddApplicationReferenceDataSource struct {
}
func (*awsAwsjson11_serializeOpAddApplicationReferenceDataSource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddApplicationReferenceDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddApplicationReferenceDataSourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.AddApplicationReferenceDataSource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddApplicationReferenceDataSourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateApplication struct {
}
func (*awsAwsjson11_serializeOpCreateApplication) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.CreateApplication")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateApplicationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteApplication struct {
}
func (*awsAwsjson11_serializeOpDeleteApplication) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.DeleteApplication")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteApplicationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteApplicationCloudWatchLoggingOption struct {
}
func (*awsAwsjson11_serializeOpDeleteApplicationCloudWatchLoggingOption) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteApplicationCloudWatchLoggingOption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteApplicationCloudWatchLoggingOptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.DeleteApplicationCloudWatchLoggingOption")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteApplicationCloudWatchLoggingOptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteApplicationInputProcessingConfiguration struct {
}
func (*awsAwsjson11_serializeOpDeleteApplicationInputProcessingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteApplicationInputProcessingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteApplicationInputProcessingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.DeleteApplicationInputProcessingConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteApplicationInputProcessingConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteApplicationOutput struct {
}
func (*awsAwsjson11_serializeOpDeleteApplicationOutput) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteApplicationOutput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteApplicationOutputInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.DeleteApplicationOutput")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteApplicationOutputInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteApplicationReferenceDataSource struct {
}
func (*awsAwsjson11_serializeOpDeleteApplicationReferenceDataSource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteApplicationReferenceDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteApplicationReferenceDataSourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.DeleteApplicationReferenceDataSource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteApplicationReferenceDataSourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeApplication struct {
}
func (*awsAwsjson11_serializeOpDescribeApplication) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.DescribeApplication")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeApplicationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDiscoverInputSchema struct {
}
func (*awsAwsjson11_serializeOpDiscoverInputSchema) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDiscoverInputSchema) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DiscoverInputSchemaInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.DiscoverInputSchema")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDiscoverInputSchemaInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListApplications struct {
}
func (*awsAwsjson11_serializeOpListApplications) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListApplications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListApplicationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.ListApplications")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListApplicationsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStartApplication struct {
}
func (*awsAwsjson11_serializeOpStartApplication) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.StartApplication")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartApplicationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStopApplication struct {
}
func (*awsAwsjson11_serializeOpStopApplication) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.StopApplication")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopApplicationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTagResource struct {
}
func (*awsAwsjson11_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.TagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUntagResource struct {
}
func (*awsAwsjson11_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.UntagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateApplication struct {
}
func (*awsAwsjson11_serializeOpUpdateApplication) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("KinesisAnalytics_20150814.UpdateApplication")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateApplicationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if 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_serializeDocumentApplicationUpdate(v *types.ApplicationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationCodeUpdate != nil {
ok := object.Key("ApplicationCodeUpdate")
ok.String(*v.ApplicationCodeUpdate)
}
if v.CloudWatchLoggingOptionUpdates != nil {
ok := object.Key("CloudWatchLoggingOptionUpdates")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptionUpdates(v.CloudWatchLoggingOptionUpdates, ok); err != nil {
return err
}
}
if v.InputUpdates != nil {
ok := object.Key("InputUpdates")
if err := awsAwsjson11_serializeDocumentInputUpdates(v.InputUpdates, ok); err != nil {
return err
}
}
if v.OutputUpdates != nil {
ok := object.Key("OutputUpdates")
if err := awsAwsjson11_serializeDocumentOutputUpdates(v.OutputUpdates, ok); err != nil {
return err
}
}
if v.ReferenceDataSourceUpdates != nil {
ok := object.Key("ReferenceDataSourceUpdates")
if err := awsAwsjson11_serializeDocumentReferenceDataSourceUpdates(v.ReferenceDataSourceUpdates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCloudWatchLoggingOption(v *types.CloudWatchLoggingOption, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogStreamARN != nil {
ok := object.Key("LogStreamARN")
ok.String(*v.LogStreamARN)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v []types.CloudWatchLoggingOption, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOption(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCloudWatchLoggingOptionUpdate(v *types.CloudWatchLoggingOptionUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchLoggingOptionId != nil {
ok := object.Key("CloudWatchLoggingOptionId")
ok.String(*v.CloudWatchLoggingOptionId)
}
if v.LogStreamARNUpdate != nil {
ok := object.Key("LogStreamARNUpdate")
ok.String(*v.LogStreamARNUpdate)
}
if v.RoleARNUpdate != nil {
ok := object.Key("RoleARNUpdate")
ok.String(*v.RoleARNUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentCloudWatchLoggingOptionUpdates(v []types.CloudWatchLoggingOptionUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptionUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCSVMappingParameters(v *types.CSVMappingParameters, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RecordColumnDelimiter != nil {
ok := object.Key("RecordColumnDelimiter")
ok.String(*v.RecordColumnDelimiter)
}
if v.RecordRowDelimiter != nil {
ok := object.Key("RecordRowDelimiter")
ok.String(*v.RecordRowDelimiter)
}
return nil
}
func awsAwsjson11_serializeDocumentDestinationSchema(v *types.DestinationSchema, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.RecordFormatType) > 0 {
ok := object.Key("RecordFormatType")
ok.String(string(v.RecordFormatType))
}
return nil
}
func awsAwsjson11_serializeDocumentInput(v *types.Input, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InputParallelism != nil {
ok := object.Key("InputParallelism")
if err := awsAwsjson11_serializeDocumentInputParallelism(v.InputParallelism, ok); err != nil {
return err
}
}
if v.InputProcessingConfiguration != nil {
ok := object.Key("InputProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentInputProcessingConfiguration(v.InputProcessingConfiguration, ok); err != nil {
return err
}
}
if v.InputSchema != nil {
ok := object.Key("InputSchema")
if err := awsAwsjson11_serializeDocumentSourceSchema(v.InputSchema, ok); err != nil {
return err
}
}
if v.KinesisFirehoseInput != nil {
ok := object.Key("KinesisFirehoseInput")
if err := awsAwsjson11_serializeDocumentKinesisFirehoseInput(v.KinesisFirehoseInput, ok); err != nil {
return err
}
}
if v.KinesisStreamsInput != nil {
ok := object.Key("KinesisStreamsInput")
if err := awsAwsjson11_serializeDocumentKinesisStreamsInput(v.KinesisStreamsInput, ok); err != nil {
return err
}
}
if v.NamePrefix != nil {
ok := object.Key("NamePrefix")
ok.String(*v.NamePrefix)
}
return nil
}
func awsAwsjson11_serializeDocumentInputConfiguration(v *types.InputConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.InputStartingPositionConfiguration != nil {
ok := object.Key("InputStartingPositionConfiguration")
if err := awsAwsjson11_serializeDocumentInputStartingPositionConfiguration(v.InputStartingPositionConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInputConfigurations(v []types.InputConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentInputConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInputLambdaProcessor(v *types.InputLambdaProcessor, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentInputLambdaProcessorUpdate(v *types.InputLambdaProcessorUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARNUpdate != nil {
ok := object.Key("ResourceARNUpdate")
ok.String(*v.ResourceARNUpdate)
}
if v.RoleARNUpdate != nil {
ok := object.Key("RoleARNUpdate")
ok.String(*v.RoleARNUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentInputParallelism(v *types.InputParallelism, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Count != nil {
ok := object.Key("Count")
ok.Integer(*v.Count)
}
return nil
}
func awsAwsjson11_serializeDocumentInputParallelismUpdate(v *types.InputParallelismUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CountUpdate != nil {
ok := object.Key("CountUpdate")
ok.Integer(*v.CountUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentInputProcessingConfiguration(v *types.InputProcessingConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InputLambdaProcessor != nil {
ok := object.Key("InputLambdaProcessor")
if err := awsAwsjson11_serializeDocumentInputLambdaProcessor(v.InputLambdaProcessor, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInputProcessingConfigurationUpdate(v *types.InputProcessingConfigurationUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InputLambdaProcessorUpdate != nil {
ok := object.Key("InputLambdaProcessorUpdate")
if err := awsAwsjson11_serializeDocumentInputLambdaProcessorUpdate(v.InputLambdaProcessorUpdate, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInputs(v []types.Input, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentInput(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInputSchemaUpdate(v *types.InputSchemaUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RecordColumnUpdates != nil {
ok := object.Key("RecordColumnUpdates")
if err := awsAwsjson11_serializeDocumentRecordColumns(v.RecordColumnUpdates, ok); err != nil {
return err
}
}
if v.RecordEncodingUpdate != nil {
ok := object.Key("RecordEncodingUpdate")
ok.String(*v.RecordEncodingUpdate)
}
if v.RecordFormatUpdate != nil {
ok := object.Key("RecordFormatUpdate")
if err := awsAwsjson11_serializeDocumentRecordFormat(v.RecordFormatUpdate, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInputStartingPositionConfiguration(v *types.InputStartingPositionConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.InputStartingPosition) > 0 {
ok := object.Key("InputStartingPosition")
ok.String(string(v.InputStartingPosition))
}
return nil
}
func awsAwsjson11_serializeDocumentInputUpdate(v *types.InputUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InputId != nil {
ok := object.Key("InputId")
ok.String(*v.InputId)
}
if v.InputParallelismUpdate != nil {
ok := object.Key("InputParallelismUpdate")
if err := awsAwsjson11_serializeDocumentInputParallelismUpdate(v.InputParallelismUpdate, ok); err != nil {
return err
}
}
if v.InputProcessingConfigurationUpdate != nil {
ok := object.Key("InputProcessingConfigurationUpdate")
if err := awsAwsjson11_serializeDocumentInputProcessingConfigurationUpdate(v.InputProcessingConfigurationUpdate, ok); err != nil {
return err
}
}
if v.InputSchemaUpdate != nil {
ok := object.Key("InputSchemaUpdate")
if err := awsAwsjson11_serializeDocumentInputSchemaUpdate(v.InputSchemaUpdate, ok); err != nil {
return err
}
}
if v.KinesisFirehoseInputUpdate != nil {
ok := object.Key("KinesisFirehoseInputUpdate")
if err := awsAwsjson11_serializeDocumentKinesisFirehoseInputUpdate(v.KinesisFirehoseInputUpdate, ok); err != nil {
return err
}
}
if v.KinesisStreamsInputUpdate != nil {
ok := object.Key("KinesisStreamsInputUpdate")
if err := awsAwsjson11_serializeDocumentKinesisStreamsInputUpdate(v.KinesisStreamsInputUpdate, ok); err != nil {
return err
}
}
if v.NamePrefixUpdate != nil {
ok := object.Key("NamePrefixUpdate")
ok.String(*v.NamePrefixUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentInputUpdates(v []types.InputUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentInputUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentJSONMappingParameters(v *types.JSONMappingParameters, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RecordRowPath != nil {
ok := object.Key("RecordRowPath")
ok.String(*v.RecordRowPath)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisFirehoseInput(v *types.KinesisFirehoseInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisFirehoseInputUpdate(v *types.KinesisFirehoseInputUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARNUpdate != nil {
ok := object.Key("ResourceARNUpdate")
ok.String(*v.ResourceARNUpdate)
}
if v.RoleARNUpdate != nil {
ok := object.Key("RoleARNUpdate")
ok.String(*v.RoleARNUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisFirehoseOutput(v *types.KinesisFirehoseOutput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisFirehoseOutputUpdate(v *types.KinesisFirehoseOutputUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARNUpdate != nil {
ok := object.Key("ResourceARNUpdate")
ok.String(*v.ResourceARNUpdate)
}
if v.RoleARNUpdate != nil {
ok := object.Key("RoleARNUpdate")
ok.String(*v.RoleARNUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisStreamsInput(v *types.KinesisStreamsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisStreamsInputUpdate(v *types.KinesisStreamsInputUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARNUpdate != nil {
ok := object.Key("ResourceARNUpdate")
ok.String(*v.ResourceARNUpdate)
}
if v.RoleARNUpdate != nil {
ok := object.Key("RoleARNUpdate")
ok.String(*v.RoleARNUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisStreamsOutput(v *types.KinesisStreamsOutput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentKinesisStreamsOutputUpdate(v *types.KinesisStreamsOutputUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARNUpdate != nil {
ok := object.Key("ResourceARNUpdate")
ok.String(*v.ResourceARNUpdate)
}
if v.RoleARNUpdate != nil {
ok := object.Key("RoleARNUpdate")
ok.String(*v.RoleARNUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentLambdaOutput(v *types.LambdaOutput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentLambdaOutputUpdate(v *types.LambdaOutputUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARNUpdate != nil {
ok := object.Key("ResourceARNUpdate")
ok.String(*v.ResourceARNUpdate)
}
if v.RoleARNUpdate != nil {
ok := object.Key("RoleARNUpdate")
ok.String(*v.RoleARNUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentMappingParameters(v *types.MappingParameters, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CSVMappingParameters != nil {
ok := object.Key("CSVMappingParameters")
if err := awsAwsjson11_serializeDocumentCSVMappingParameters(v.CSVMappingParameters, ok); err != nil {
return err
}
}
if v.JSONMappingParameters != nil {
ok := object.Key("JSONMappingParameters")
if err := awsAwsjson11_serializeDocumentJSONMappingParameters(v.JSONMappingParameters, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentOutput(v *types.Output, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DestinationSchema != nil {
ok := object.Key("DestinationSchema")
if err := awsAwsjson11_serializeDocumentDestinationSchema(v.DestinationSchema, ok); err != nil {
return err
}
}
if v.KinesisFirehoseOutput != nil {
ok := object.Key("KinesisFirehoseOutput")
if err := awsAwsjson11_serializeDocumentKinesisFirehoseOutput(v.KinesisFirehoseOutput, ok); err != nil {
return err
}
}
if v.KinesisStreamsOutput != nil {
ok := object.Key("KinesisStreamsOutput")
if err := awsAwsjson11_serializeDocumentKinesisStreamsOutput(v.KinesisStreamsOutput, ok); err != nil {
return err
}
}
if v.LambdaOutput != nil {
ok := object.Key("LambdaOutput")
if err := awsAwsjson11_serializeDocumentLambdaOutput(v.LambdaOutput, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeDocumentOutputs(v []types.Output, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentOutput(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentOutputUpdate(v *types.OutputUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DestinationSchemaUpdate != nil {
ok := object.Key("DestinationSchemaUpdate")
if err := awsAwsjson11_serializeDocumentDestinationSchema(v.DestinationSchemaUpdate, ok); err != nil {
return err
}
}
if v.KinesisFirehoseOutputUpdate != nil {
ok := object.Key("KinesisFirehoseOutputUpdate")
if err := awsAwsjson11_serializeDocumentKinesisFirehoseOutputUpdate(v.KinesisFirehoseOutputUpdate, ok); err != nil {
return err
}
}
if v.KinesisStreamsOutputUpdate != nil {
ok := object.Key("KinesisStreamsOutputUpdate")
if err := awsAwsjson11_serializeDocumentKinesisStreamsOutputUpdate(v.KinesisStreamsOutputUpdate, ok); err != nil {
return err
}
}
if v.LambdaOutputUpdate != nil {
ok := object.Key("LambdaOutputUpdate")
if err := awsAwsjson11_serializeDocumentLambdaOutputUpdate(v.LambdaOutputUpdate, ok); err != nil {
return err
}
}
if v.NameUpdate != nil {
ok := object.Key("NameUpdate")
ok.String(*v.NameUpdate)
}
if v.OutputId != nil {
ok := object.Key("OutputId")
ok.String(*v.OutputId)
}
return nil
}
func awsAwsjson11_serializeDocumentOutputUpdates(v []types.OutputUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentOutputUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRecordColumn(v *types.RecordColumn, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Mapping != nil {
ok := object.Key("Mapping")
ok.String(*v.Mapping)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.SqlType != nil {
ok := object.Key("SqlType")
ok.String(*v.SqlType)
}
return nil
}
func awsAwsjson11_serializeDocumentRecordColumns(v []types.RecordColumn, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentRecordColumn(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentRecordFormat(v *types.RecordFormat, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MappingParameters != nil {
ok := object.Key("MappingParameters")
if err := awsAwsjson11_serializeDocumentMappingParameters(v.MappingParameters, ok); err != nil {
return err
}
}
if len(v.RecordFormatType) > 0 {
ok := object.Key("RecordFormatType")
ok.String(string(v.RecordFormatType))
}
return nil
}
func awsAwsjson11_serializeDocumentReferenceDataSource(v *types.ReferenceDataSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ReferenceSchema != nil {
ok := object.Key("ReferenceSchema")
if err := awsAwsjson11_serializeDocumentSourceSchema(v.ReferenceSchema, ok); err != nil {
return err
}
}
if v.S3ReferenceDataSource != nil {
ok := object.Key("S3ReferenceDataSource")
if err := awsAwsjson11_serializeDocumentS3ReferenceDataSource(v.S3ReferenceDataSource, ok); err != nil {
return err
}
}
if v.TableName != nil {
ok := object.Key("TableName")
ok.String(*v.TableName)
}
return nil
}
func awsAwsjson11_serializeDocumentReferenceDataSourceUpdate(v *types.ReferenceDataSourceUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ReferenceId != nil {
ok := object.Key("ReferenceId")
ok.String(*v.ReferenceId)
}
if v.ReferenceSchemaUpdate != nil {
ok := object.Key("ReferenceSchemaUpdate")
if err := awsAwsjson11_serializeDocumentSourceSchema(v.ReferenceSchemaUpdate, ok); err != nil {
return err
}
}
if v.S3ReferenceDataSourceUpdate != nil {
ok := object.Key("S3ReferenceDataSourceUpdate")
if err := awsAwsjson11_serializeDocumentS3ReferenceDataSourceUpdate(v.S3ReferenceDataSourceUpdate, ok); err != nil {
return err
}
}
if v.TableNameUpdate != nil {
ok := object.Key("TableNameUpdate")
ok.String(*v.TableNameUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentReferenceDataSourceUpdates(v []types.ReferenceDataSourceUpdate, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentReferenceDataSourceUpdate(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentS3Configuration(v *types.S3Configuration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketARN != nil {
ok := object.Key("BucketARN")
ok.String(*v.BucketARN)
}
if v.FileKey != nil {
ok := object.Key("FileKey")
ok.String(*v.FileKey)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentS3ReferenceDataSource(v *types.S3ReferenceDataSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketARN != nil {
ok := object.Key("BucketARN")
ok.String(*v.BucketARN)
}
if v.FileKey != nil {
ok := object.Key("FileKey")
ok.String(*v.FileKey)
}
if v.ReferenceRoleARN != nil {
ok := object.Key("ReferenceRoleARN")
ok.String(*v.ReferenceRoleARN)
}
return nil
}
func awsAwsjson11_serializeDocumentS3ReferenceDataSourceUpdate(v *types.S3ReferenceDataSourceUpdate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BucketARNUpdate != nil {
ok := object.Key("BucketARNUpdate")
ok.String(*v.BucketARNUpdate)
}
if v.FileKeyUpdate != nil {
ok := object.Key("FileKeyUpdate")
ok.String(*v.FileKeyUpdate)
}
if v.ReferenceRoleARNUpdate != nil {
ok := object.Key("ReferenceRoleARNUpdate")
ok.String(*v.ReferenceRoleARNUpdate)
}
return nil
}
func awsAwsjson11_serializeDocumentSourceSchema(v *types.SourceSchema, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RecordColumns != nil {
ok := object.Key("RecordColumns")
if err := awsAwsjson11_serializeDocumentRecordColumns(v.RecordColumns, ok); err != nil {
return err
}
}
if v.RecordEncoding != nil {
ok := object.Key("RecordEncoding")
ok.String(*v.RecordEncoding)
}
if v.RecordFormat != nil {
ok := object.Key("RecordFormat")
if err := awsAwsjson11_serializeDocumentRecordFormat(v.RecordFormat, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentTagKeys(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentTags(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddApplicationCloudWatchLoggingOptionInput(v *AddApplicationCloudWatchLoggingOptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CloudWatchLoggingOption != nil {
ok := object.Key("CloudWatchLoggingOption")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOption(v.CloudWatchLoggingOption, ok); err != nil {
return err
}
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddApplicationInputInput(v *AddApplicationInputInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
if v.Input != nil {
ok := object.Key("Input")
if err := awsAwsjson11_serializeDocumentInput(v.Input, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddApplicationInputProcessingConfigurationInput(v *AddApplicationInputProcessingConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
if v.InputId != nil {
ok := object.Key("InputId")
ok.String(*v.InputId)
}
if v.InputProcessingConfiguration != nil {
ok := object.Key("InputProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentInputProcessingConfiguration(v.InputProcessingConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddApplicationOutputInput(v *AddApplicationOutputInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
if v.Output != nil {
ok := object.Key("Output")
if err := awsAwsjson11_serializeDocumentOutput(v.Output, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddApplicationReferenceDataSourceInput(v *AddApplicationReferenceDataSourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
if v.ReferenceDataSource != nil {
ok := object.Key("ReferenceDataSource")
if err := awsAwsjson11_serializeDocumentReferenceDataSource(v.ReferenceDataSource, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateApplicationInput(v *CreateApplicationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationCode != nil {
ok := object.Key("ApplicationCode")
ok.String(*v.ApplicationCode)
}
if v.ApplicationDescription != nil {
ok := object.Key("ApplicationDescription")
ok.String(*v.ApplicationDescription)
}
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CloudWatchLoggingOptions != nil {
ok := object.Key("CloudWatchLoggingOptions")
if err := awsAwsjson11_serializeDocumentCloudWatchLoggingOptions(v.CloudWatchLoggingOptions, ok); err != nil {
return err
}
}
if v.Inputs != nil {
ok := object.Key("Inputs")
if err := awsAwsjson11_serializeDocumentInputs(v.Inputs, ok); err != nil {
return err
}
}
if v.Outputs != nil {
ok := object.Key("Outputs")
if err := awsAwsjson11_serializeDocumentOutputs(v.Outputs, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteApplicationCloudWatchLoggingOptionInput(v *DeleteApplicationCloudWatchLoggingOptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CloudWatchLoggingOptionId != nil {
ok := object.Key("CloudWatchLoggingOptionId")
ok.String(*v.CloudWatchLoggingOptionId)
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteApplicationInput(v *DeleteApplicationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CreateTimestamp != nil {
ok := object.Key("CreateTimestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.CreateTimestamp))
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteApplicationInputProcessingConfigurationInput(v *DeleteApplicationInputProcessingConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
if v.InputId != nil {
ok := object.Key("InputId")
ok.String(*v.InputId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteApplicationOutputInput(v *DeleteApplicationOutputInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
if v.OutputId != nil {
ok := object.Key("OutputId")
ok.String(*v.OutputId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteApplicationReferenceDataSourceInput(v *DeleteApplicationReferenceDataSourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
if v.ReferenceId != nil {
ok := object.Key("ReferenceId")
ok.String(*v.ReferenceId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeApplicationInput(v *DescribeApplicationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDiscoverInputSchemaInput(v *DiscoverInputSchemaInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InputProcessingConfiguration != nil {
ok := object.Key("InputProcessingConfiguration")
if err := awsAwsjson11_serializeDocumentInputProcessingConfiguration(v.InputProcessingConfiguration, ok); err != nil {
return err
}
}
if v.InputStartingPositionConfiguration != nil {
ok := object.Key("InputStartingPositionConfiguration")
if err := awsAwsjson11_serializeDocumentInputStartingPositionConfiguration(v.InputStartingPositionConfiguration, ok); err != nil {
return err
}
}
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.RoleARN != nil {
ok := object.Key("RoleARN")
ok.String(*v.RoleARN)
}
if v.S3Configuration != nil {
ok := object.Key("S3Configuration")
if err := awsAwsjson11_serializeDocumentS3Configuration(v.S3Configuration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentListApplicationsInput(v *ListApplicationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExclusiveStartApplicationName != nil {
ok := object.Key("ExclusiveStartApplicationName")
ok.String(*v.ExclusiveStartApplicationName)
}
if v.Limit != nil {
ok := object.Key("Limit")
ok.Integer(*v.Limit)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartApplicationInput(v *StartApplicationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.InputConfigurations != nil {
ok := object.Key("InputConfigurations")
if err := awsAwsjson11_serializeDocumentInputConfigurations(v.InputConfigurations, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopApplicationInput(v *StopApplicationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceARN != nil {
ok := object.Key("ResourceARN")
ok.String(*v.ResourceARN)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeys(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateApplicationInput(v *UpdateApplicationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationName != nil {
ok := object.Key("ApplicationName")
ok.String(*v.ApplicationName)
}
if v.ApplicationUpdate != nil {
ok := object.Key("ApplicationUpdate")
if err := awsAwsjson11_serializeDocumentApplicationUpdate(v.ApplicationUpdate, ok); err != nil {
return err
}
}
if v.CurrentApplicationVersionId != nil {
ok := object.Key("CurrentApplicationVersionId")
ok.Long(*v.CurrentApplicationVersionId)
}
return nil
}
| 2,555 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalytics
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/kinesisanalytics/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAddApplicationCloudWatchLoggingOption struct {
}
func (*validateOpAddApplicationCloudWatchLoggingOption) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddApplicationCloudWatchLoggingOption) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddApplicationCloudWatchLoggingOptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddApplicationCloudWatchLoggingOptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddApplicationInput struct {
}
func (*validateOpAddApplicationInput) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddApplicationInput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddApplicationInputInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddApplicationInputInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddApplicationInputProcessingConfiguration struct {
}
func (*validateOpAddApplicationInputProcessingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddApplicationInputProcessingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddApplicationInputProcessingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddApplicationInputProcessingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddApplicationOutput struct {
}
func (*validateOpAddApplicationOutput) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddApplicationOutput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddApplicationOutputInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddApplicationOutputInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddApplicationReferenceDataSource struct {
}
func (*validateOpAddApplicationReferenceDataSource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddApplicationReferenceDataSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddApplicationReferenceDataSourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddApplicationReferenceDataSourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateApplication struct {
}
func (*validateOpCreateApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteApplicationCloudWatchLoggingOption struct {
}
func (*validateOpDeleteApplicationCloudWatchLoggingOption) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteApplicationCloudWatchLoggingOption) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteApplicationCloudWatchLoggingOptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteApplicationCloudWatchLoggingOptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteApplication struct {
}
func (*validateOpDeleteApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteApplicationInputProcessingConfiguration struct {
}
func (*validateOpDeleteApplicationInputProcessingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteApplicationInputProcessingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteApplicationInputProcessingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteApplicationInputProcessingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteApplicationOutput struct {
}
func (*validateOpDeleteApplicationOutput) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteApplicationOutput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteApplicationOutputInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteApplicationOutputInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteApplicationReferenceDataSource struct {
}
func (*validateOpDeleteApplicationReferenceDataSource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteApplicationReferenceDataSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteApplicationReferenceDataSourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteApplicationReferenceDataSourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeApplication struct {
}
func (*validateOpDescribeApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDiscoverInputSchema struct {
}
func (*validateOpDiscoverInputSchema) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDiscoverInputSchema) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DiscoverInputSchemaInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDiscoverInputSchemaInput(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 validateOpStartApplication struct {
}
func (*validateOpStartApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopApplication struct {
}
func (*validateOpStopApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopApplicationInput(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 validateOpUpdateApplication struct {
}
func (*validateOpUpdateApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAddApplicationCloudWatchLoggingOptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddApplicationCloudWatchLoggingOption{}, middleware.After)
}
func addOpAddApplicationInputValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddApplicationInput{}, middleware.After)
}
func addOpAddApplicationInputProcessingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddApplicationInputProcessingConfiguration{}, middleware.After)
}
func addOpAddApplicationOutputValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddApplicationOutput{}, middleware.After)
}
func addOpAddApplicationReferenceDataSourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddApplicationReferenceDataSource{}, middleware.After)
}
func addOpCreateApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateApplication{}, middleware.After)
}
func addOpDeleteApplicationCloudWatchLoggingOptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteApplicationCloudWatchLoggingOption{}, middleware.After)
}
func addOpDeleteApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteApplication{}, middleware.After)
}
func addOpDeleteApplicationInputProcessingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteApplicationInputProcessingConfiguration{}, middleware.After)
}
func addOpDeleteApplicationOutputValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteApplicationOutput{}, middleware.After)
}
func addOpDeleteApplicationReferenceDataSourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteApplicationReferenceDataSource{}, middleware.After)
}
func addOpDescribeApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeApplication{}, middleware.After)
}
func addOpDiscoverInputSchemaValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDiscoverInputSchema{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpStartApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartApplication{}, middleware.After)
}
func addOpStopApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopApplication{}, 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 addOpUpdateApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateApplication{}, middleware.After)
}
func validateApplicationUpdate(v *types.ApplicationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ApplicationUpdate"}
if v.InputUpdates != nil {
if err := validateInputUpdates(v.InputUpdates); err != nil {
invalidParams.AddNested("InputUpdates", err.(smithy.InvalidParamsError))
}
}
if v.OutputUpdates != nil {
if err := validateOutputUpdates(v.OutputUpdates); err != nil {
invalidParams.AddNested("OutputUpdates", err.(smithy.InvalidParamsError))
}
}
if v.ReferenceDataSourceUpdates != nil {
if err := validateReferenceDataSourceUpdates(v.ReferenceDataSourceUpdates); err != nil {
invalidParams.AddNested("ReferenceDataSourceUpdates", err.(smithy.InvalidParamsError))
}
}
if v.CloudWatchLoggingOptionUpdates != nil {
if err := validateCloudWatchLoggingOptionUpdates(v.CloudWatchLoggingOptionUpdates); err != nil {
invalidParams.AddNested("CloudWatchLoggingOptionUpdates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchLoggingOption(v *types.CloudWatchLoggingOption) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchLoggingOption"}
if v.LogStreamARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogStreamARN"))
}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchLoggingOptions(v []types.CloudWatchLoggingOption) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchLoggingOptions"}
for i := range v {
if err := validateCloudWatchLoggingOption(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchLoggingOptionUpdate(v *types.CloudWatchLoggingOptionUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchLoggingOptionUpdate"}
if v.CloudWatchLoggingOptionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CloudWatchLoggingOptionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchLoggingOptionUpdates(v []types.CloudWatchLoggingOptionUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchLoggingOptionUpdates"}
for i := range v {
if err := validateCloudWatchLoggingOptionUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCSVMappingParameters(v *types.CSVMappingParameters) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CSVMappingParameters"}
if v.RecordRowDelimiter == nil {
invalidParams.Add(smithy.NewErrParamRequired("RecordRowDelimiter"))
}
if v.RecordColumnDelimiter == nil {
invalidParams.Add(smithy.NewErrParamRequired("RecordColumnDelimiter"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDestinationSchema(v *types.DestinationSchema) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DestinationSchema"}
if len(v.RecordFormatType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("RecordFormatType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInput(v *types.Input) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Input"}
if v.NamePrefix == nil {
invalidParams.Add(smithy.NewErrParamRequired("NamePrefix"))
}
if v.InputProcessingConfiguration != nil {
if err := validateInputProcessingConfiguration(v.InputProcessingConfiguration); err != nil {
invalidParams.AddNested("InputProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.KinesisStreamsInput != nil {
if err := validateKinesisStreamsInput(v.KinesisStreamsInput); err != nil {
invalidParams.AddNested("KinesisStreamsInput", err.(smithy.InvalidParamsError))
}
}
if v.KinesisFirehoseInput != nil {
if err := validateKinesisFirehoseInput(v.KinesisFirehoseInput); err != nil {
invalidParams.AddNested("KinesisFirehoseInput", err.(smithy.InvalidParamsError))
}
}
if v.InputSchema == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputSchema"))
} else if v.InputSchema != nil {
if err := validateSourceSchema(v.InputSchema); err != nil {
invalidParams.AddNested("InputSchema", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputConfiguration(v *types.InputConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputConfiguration"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.InputStartingPositionConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputStartingPositionConfiguration"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputConfigurations(v []types.InputConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputConfigurations"}
for i := range v {
if err := validateInputConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputLambdaProcessor(v *types.InputLambdaProcessor) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputLambdaProcessor"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputProcessingConfiguration(v *types.InputProcessingConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputProcessingConfiguration"}
if v.InputLambdaProcessor == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputLambdaProcessor"))
} else if v.InputLambdaProcessor != nil {
if err := validateInputLambdaProcessor(v.InputLambdaProcessor); err != nil {
invalidParams.AddNested("InputLambdaProcessor", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputProcessingConfigurationUpdate(v *types.InputProcessingConfigurationUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputProcessingConfigurationUpdate"}
if v.InputLambdaProcessorUpdate == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputLambdaProcessorUpdate"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputs(v []types.Input) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Inputs"}
for i := range v {
if err := validateInput(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputSchemaUpdate(v *types.InputSchemaUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputSchemaUpdate"}
if v.RecordFormatUpdate != nil {
if err := validateRecordFormat(v.RecordFormatUpdate); err != nil {
invalidParams.AddNested("RecordFormatUpdate", err.(smithy.InvalidParamsError))
}
}
if v.RecordColumnUpdates != nil {
if err := validateRecordColumns(v.RecordColumnUpdates); err != nil {
invalidParams.AddNested("RecordColumnUpdates", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputUpdate(v *types.InputUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputUpdate"}
if v.InputId == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputId"))
}
if v.InputProcessingConfigurationUpdate != nil {
if err := validateInputProcessingConfigurationUpdate(v.InputProcessingConfigurationUpdate); err != nil {
invalidParams.AddNested("InputProcessingConfigurationUpdate", err.(smithy.InvalidParamsError))
}
}
if v.InputSchemaUpdate != nil {
if err := validateInputSchemaUpdate(v.InputSchemaUpdate); err != nil {
invalidParams.AddNested("InputSchemaUpdate", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputUpdates(v []types.InputUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputUpdates"}
for i := range v {
if err := validateInputUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJSONMappingParameters(v *types.JSONMappingParameters) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JSONMappingParameters"}
if v.RecordRowPath == nil {
invalidParams.Add(smithy.NewErrParamRequired("RecordRowPath"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKinesisFirehoseInput(v *types.KinesisFirehoseInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KinesisFirehoseInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKinesisFirehoseOutput(v *types.KinesisFirehoseOutput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KinesisFirehoseOutput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKinesisStreamsInput(v *types.KinesisStreamsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KinesisStreamsInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKinesisStreamsOutput(v *types.KinesisStreamsOutput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KinesisStreamsOutput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLambdaOutput(v *types.LambdaOutput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LambdaOutput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMappingParameters(v *types.MappingParameters) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MappingParameters"}
if v.JSONMappingParameters != nil {
if err := validateJSONMappingParameters(v.JSONMappingParameters); err != nil {
invalidParams.AddNested("JSONMappingParameters", err.(smithy.InvalidParamsError))
}
}
if v.CSVMappingParameters != nil {
if err := validateCSVMappingParameters(v.CSVMappingParameters); err != nil {
invalidParams.AddNested("CSVMappingParameters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOutput(v *types.Output) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Output"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.KinesisStreamsOutput != nil {
if err := validateKinesisStreamsOutput(v.KinesisStreamsOutput); err != nil {
invalidParams.AddNested("KinesisStreamsOutput", err.(smithy.InvalidParamsError))
}
}
if v.KinesisFirehoseOutput != nil {
if err := validateKinesisFirehoseOutput(v.KinesisFirehoseOutput); err != nil {
invalidParams.AddNested("KinesisFirehoseOutput", err.(smithy.InvalidParamsError))
}
}
if v.LambdaOutput != nil {
if err := validateLambdaOutput(v.LambdaOutput); err != nil {
invalidParams.AddNested("LambdaOutput", err.(smithy.InvalidParamsError))
}
}
if v.DestinationSchema == nil {
invalidParams.Add(smithy.NewErrParamRequired("DestinationSchema"))
} else if v.DestinationSchema != nil {
if err := validateDestinationSchema(v.DestinationSchema); err != nil {
invalidParams.AddNested("DestinationSchema", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOutputs(v []types.Output) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Outputs"}
for i := range v {
if err := validateOutput(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOutputUpdate(v *types.OutputUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OutputUpdate"}
if v.OutputId == nil {
invalidParams.Add(smithy.NewErrParamRequired("OutputId"))
}
if v.DestinationSchemaUpdate != nil {
if err := validateDestinationSchema(v.DestinationSchemaUpdate); err != nil {
invalidParams.AddNested("DestinationSchemaUpdate", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOutputUpdates(v []types.OutputUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OutputUpdates"}
for i := range v {
if err := validateOutputUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRecordColumn(v *types.RecordColumn) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RecordColumn"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SqlType == nil {
invalidParams.Add(smithy.NewErrParamRequired("SqlType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRecordColumns(v []types.RecordColumn) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RecordColumns"}
for i := range v {
if err := validateRecordColumn(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRecordFormat(v *types.RecordFormat) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RecordFormat"}
if len(v.RecordFormatType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("RecordFormatType"))
}
if v.MappingParameters != nil {
if err := validateMappingParameters(v.MappingParameters); err != nil {
invalidParams.AddNested("MappingParameters", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReferenceDataSource(v *types.ReferenceDataSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReferenceDataSource"}
if v.TableName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TableName"))
}
if v.S3ReferenceDataSource != nil {
if err := validateS3ReferenceDataSource(v.S3ReferenceDataSource); err != nil {
invalidParams.AddNested("S3ReferenceDataSource", err.(smithy.InvalidParamsError))
}
}
if v.ReferenceSchema == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReferenceSchema"))
} else if v.ReferenceSchema != nil {
if err := validateSourceSchema(v.ReferenceSchema); err != nil {
invalidParams.AddNested("ReferenceSchema", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReferenceDataSourceUpdate(v *types.ReferenceDataSourceUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReferenceDataSourceUpdate"}
if v.ReferenceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReferenceId"))
}
if v.ReferenceSchemaUpdate != nil {
if err := validateSourceSchema(v.ReferenceSchemaUpdate); err != nil {
invalidParams.AddNested("ReferenceSchemaUpdate", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateReferenceDataSourceUpdates(v []types.ReferenceDataSourceUpdate) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ReferenceDataSourceUpdates"}
for i := range v {
if err := validateReferenceDataSourceUpdate(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3Configuration(v *types.S3Configuration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3Configuration"}
if v.RoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleARN"))
}
if v.BucketARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketARN"))
}
if v.FileKey == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileKey"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3ReferenceDataSource(v *types.S3ReferenceDataSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3ReferenceDataSource"}
if v.BucketARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("BucketARN"))
}
if v.FileKey == nil {
invalidParams.Add(smithy.NewErrParamRequired("FileKey"))
}
if v.ReferenceRoleARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReferenceRoleARN"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSourceSchema(v *types.SourceSchema) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SourceSchema"}
if v.RecordFormat == nil {
invalidParams.Add(smithy.NewErrParamRequired("RecordFormat"))
} else if v.RecordFormat != nil {
if err := validateRecordFormat(v.RecordFormat); err != nil {
invalidParams.AddNested("RecordFormat", err.(smithy.InvalidParamsError))
}
}
if v.RecordColumns == nil {
invalidParams.Add(smithy.NewErrParamRequired("RecordColumns"))
} else if v.RecordColumns != nil {
if err := validateRecordColumns(v.RecordColumns); err != nil {
invalidParams.AddNested("RecordColumns", 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 validateTags(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tags"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddApplicationCloudWatchLoggingOptionInput(v *AddApplicationCloudWatchLoggingOptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddApplicationCloudWatchLoggingOptionInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.CloudWatchLoggingOption == nil {
invalidParams.Add(smithy.NewErrParamRequired("CloudWatchLoggingOption"))
} else if v.CloudWatchLoggingOption != nil {
if err := validateCloudWatchLoggingOption(v.CloudWatchLoggingOption); err != nil {
invalidParams.AddNested("CloudWatchLoggingOption", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddApplicationInputInput(v *AddApplicationInputInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddApplicationInputInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.Input == nil {
invalidParams.Add(smithy.NewErrParamRequired("Input"))
} else if v.Input != nil {
if err := validateInput(v.Input); err != nil {
invalidParams.AddNested("Input", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddApplicationInputProcessingConfigurationInput(v *AddApplicationInputProcessingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddApplicationInputProcessingConfigurationInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.InputId == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputId"))
}
if v.InputProcessingConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputProcessingConfiguration"))
} else if v.InputProcessingConfiguration != nil {
if err := validateInputProcessingConfiguration(v.InputProcessingConfiguration); err != nil {
invalidParams.AddNested("InputProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddApplicationOutputInput(v *AddApplicationOutputInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddApplicationOutputInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.Output == nil {
invalidParams.Add(smithy.NewErrParamRequired("Output"))
} else if v.Output != nil {
if err := validateOutput(v.Output); err != nil {
invalidParams.AddNested("Output", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddApplicationReferenceDataSourceInput(v *AddApplicationReferenceDataSourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddApplicationReferenceDataSourceInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.ReferenceDataSource == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReferenceDataSource"))
} else if v.ReferenceDataSource != nil {
if err := validateReferenceDataSource(v.ReferenceDataSource); err != nil {
invalidParams.AddNested("ReferenceDataSource", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateApplicationInput(v *CreateApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateApplicationInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.Inputs != nil {
if err := validateInputs(v.Inputs); err != nil {
invalidParams.AddNested("Inputs", err.(smithy.InvalidParamsError))
}
}
if v.Outputs != nil {
if err := validateOutputs(v.Outputs); err != nil {
invalidParams.AddNested("Outputs", err.(smithy.InvalidParamsError))
}
}
if v.CloudWatchLoggingOptions != nil {
if err := validateCloudWatchLoggingOptions(v.CloudWatchLoggingOptions); err != nil {
invalidParams.AddNested("CloudWatchLoggingOptions", err.(smithy.InvalidParamsError))
}
}
if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteApplicationCloudWatchLoggingOptionInput(v *DeleteApplicationCloudWatchLoggingOptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationCloudWatchLoggingOptionInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.CloudWatchLoggingOptionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CloudWatchLoggingOptionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteApplicationInput(v *DeleteApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CreateTimestamp == nil {
invalidParams.Add(smithy.NewErrParamRequired("CreateTimestamp"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteApplicationInputProcessingConfigurationInput(v *DeleteApplicationInputProcessingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationInputProcessingConfigurationInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.InputId == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteApplicationOutputInput(v *DeleteApplicationOutputInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationOutputInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.OutputId == nil {
invalidParams.Add(smithy.NewErrParamRequired("OutputId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteApplicationReferenceDataSourceInput(v *DeleteApplicationReferenceDataSourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationReferenceDataSourceInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.ReferenceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReferenceId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeApplicationInput(v *DescribeApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeApplicationInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDiscoverInputSchemaInput(v *DiscoverInputSchemaInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DiscoverInputSchemaInput"}
if v.S3Configuration != nil {
if err := validateS3Configuration(v.S3Configuration); err != nil {
invalidParams.AddNested("S3Configuration", err.(smithy.InvalidParamsError))
}
}
if v.InputProcessingConfiguration != nil {
if err := validateInputProcessingConfiguration(v.InputProcessingConfiguration); err != nil {
invalidParams.AddNested("InputProcessingConfiguration", err.(smithy.InvalidParamsError))
}
}
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 validateOpStartApplicationInput(v *StartApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartApplicationInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.InputConfigurations == nil {
invalidParams.Add(smithy.NewErrParamRequired("InputConfigurations"))
} else if v.InputConfigurations != nil {
if err := validateInputConfigurations(v.InputConfigurations); err != nil {
invalidParams.AddNested("InputConfigurations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopApplicationInput(v *StopApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopApplicationInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} else if v.Tags != nil {
if err := validateTags(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceARN == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceARN"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateApplicationInput(v *UpdateApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateApplicationInput"}
if v.ApplicationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationName"))
}
if v.CurrentApplicationVersionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersionId"))
}
if v.ApplicationUpdate == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationUpdate"))
} else if v.ApplicationUpdate != nil {
if err := validateApplicationUpdate(v.ApplicationUpdate); err != nil {
invalidParams.AddNested("ApplicationUpdate", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 1,661 |
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 Kinesis Analytics 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: "kinesisanalytics.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesisanalytics-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "kinesisanalytics-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesisanalytics.{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: "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-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "kinesisanalytics.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesisanalytics-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "kinesisanalytics-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesisanalytics.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesisanalytics-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesisanalytics.{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: "kinesisanalytics-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesisanalytics.{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: "kinesisanalytics-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesisanalytics.{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: "kinesisanalytics-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesisanalytics.{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: "kinesisanalytics.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "kinesisanalytics-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "kinesisanalytics-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "kinesisanalytics.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
},
},
}
| 396 |
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 ApplicationStatus string
// Enum values for ApplicationStatus
const (
ApplicationStatusDeleting ApplicationStatus = "DELETING"
ApplicationStatusStarting ApplicationStatus = "STARTING"
ApplicationStatusStopping ApplicationStatus = "STOPPING"
ApplicationStatusReady ApplicationStatus = "READY"
ApplicationStatusRunning ApplicationStatus = "RUNNING"
ApplicationStatusUpdating ApplicationStatus = "UPDATING"
)
// Values returns all known values for ApplicationStatus. 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 (ApplicationStatus) Values() []ApplicationStatus {
return []ApplicationStatus{
"DELETING",
"STARTING",
"STOPPING",
"READY",
"RUNNING",
"UPDATING",
}
}
type InputStartingPosition string
// Enum values for InputStartingPosition
const (
InputStartingPositionNow InputStartingPosition = "NOW"
InputStartingPositionTrimHorizon InputStartingPosition = "TRIM_HORIZON"
InputStartingPositionLastStoppedPoint InputStartingPosition = "LAST_STOPPED_POINT"
)
// Values returns all known values for InputStartingPosition. 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 (InputStartingPosition) Values() []InputStartingPosition {
return []InputStartingPosition{
"NOW",
"TRIM_HORIZON",
"LAST_STOPPED_POINT",
}
}
type RecordFormatType string
// Enum values for RecordFormatType
const (
RecordFormatTypeJson RecordFormatType = "JSON"
RecordFormatTypeCsv RecordFormatType = "CSV"
)
// Values returns all known values for RecordFormatType. 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 (RecordFormatType) Values() []RecordFormatType {
return []RecordFormatType{
"JSON",
"CSV",
}
}
| 68 |
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"
)
// User-provided application code (query) is invalid. This can be a simple syntax
// error.
type CodeValidationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *CodeValidationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *CodeValidationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *CodeValidationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "CodeValidationException"
}
return *e.ErrorCodeOverride
}
func (e *CodeValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Exception thrown as a result of concurrent modification to an application. For
// example, two individuals attempting to edit the same application at the same
// time.
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 }
// User-provided application configuration is not valid.
type InvalidApplicationConfigurationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidApplicationConfigurationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidApplicationConfigurationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidApplicationConfigurationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidApplicationConfigurationException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidApplicationConfigurationException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// Specified input parameter value is invalid.
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 }
// Exceeded the number of applications allowed.
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 }
// Application is 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 }
// Specified application can't be found.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Discovery failed to get a record from the streaming source because of the
// Amazon Kinesis Streams ProvisionedThroughputExceededException. For more
// information, see GetRecords (https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html)
// in the Amazon Kinesis Streams API Reference.
type ResourceProvisionedThroughputExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ResourceProvisionedThroughputExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceProvisionedThroughputExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceProvisionedThroughputExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceProvisionedThroughputExceededException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceProvisionedThroughputExceededException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// The service is unavailable. Back off and retry the operation.
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 }
// Application created with too many tags, or too many tags added to an
// application. Note that the maximum number of application tags includes system
// tags. The maximum number of user-defined application tags is 50.
type TooManyTagsException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *TooManyTagsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TooManyTagsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TooManyTagsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TooManyTagsException"
}
return *e.ErrorCodeOverride
}
func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Data format is not valid. Amazon Kinesis Analytics is not able to detect schema
// for the given streaming source.
type UnableToDetectSchemaException struct {
Message *string
ErrorCodeOverride *string
RawInputRecords []string
ProcessedInputRecords []string
noSmithyDocumentSerde
}
func (e *UnableToDetectSchemaException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnableToDetectSchemaException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnableToDetectSchemaException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnableToDetectSchemaException"
}
return *e.ErrorCodeOverride
}
func (e *UnableToDetectSchemaException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because a specified parameter is not supported or a
// specified resource is not valid for this operation.
type UnsupportedOperationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *UnsupportedOperationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnsupportedOperationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnsupportedOperationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnsupportedOperationException"
}
return *e.ErrorCodeOverride
}
func (e *UnsupportedOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 338 |
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"
)
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Provides a description of the application,
// including the application Amazon Resource Name (ARN), status, latest version,
// and input and output configuration.
type ApplicationDetail struct {
// ARN of the application.
//
// This member is required.
ApplicationARN *string
// Name of the application.
//
// This member is required.
ApplicationName *string
// Status of the application.
//
// This member is required.
ApplicationStatus ApplicationStatus
// Provides the current application version.
//
// This member is required.
ApplicationVersionId *int64
// Returns the application code that you provided to perform data analysis on any
// of the in-application streams in your application.
ApplicationCode *string
// Description of the application.
ApplicationDescription *string
// Describes the CloudWatch log streams that are configured to receive application
// messages. For more information about using CloudWatch log streams with Amazon
// Kinesis Analytics applications, see Working with Amazon CloudWatch Logs (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/cloudwatch-logs.html)
// .
CloudWatchLoggingOptionDescriptions []CloudWatchLoggingOptionDescription
// Time stamp when the application version was created.
CreateTimestamp *time.Time
// Describes the application input configuration. For more information, see
// Configuring Application Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html)
// .
InputDescriptions []InputDescription
// Time stamp when the application was last updated.
LastUpdateTimestamp *time.Time
// Describes the application output configuration. For more information, see
// Configuring Application Output (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-output.html)
// .
OutputDescriptions []OutputDescription
// Describes reference data sources configured for the application. For more
// information, see Configuring Application Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html)
// .
ReferenceDataSourceDescriptions []ReferenceDataSourceDescription
noSmithyDocumentSerde
}
// This documentation is for version 1 of the Amazon Kinesis Data Analytics API,
// which only supports SQL applications. Version 2 of the API supports SQL and Java
// applications. For more information about version 2, see Amazon Kinesis Data
// Analytics API V2 Documentation . Provides application summary information,
// including the application Amazon Resource Name (ARN), name, and status.
type ApplicationSummary struct {
// ARN of the application.
//
// This member is required.
ApplicationARN *string
// Name of the application.
//
// This member is required.
ApplicationName *string
// Status of the application.
//
// This member is required.
ApplicationStatus ApplicationStatus
noSmithyDocumentSerde
}
// Describes updates to apply to an existing Amazon Kinesis Analytics application.
type ApplicationUpdate struct {
// Describes application code updates.
ApplicationCodeUpdate *string
// Describes application CloudWatch logging option updates.
CloudWatchLoggingOptionUpdates []CloudWatchLoggingOptionUpdate
// Describes application input configuration updates.
InputUpdates []InputUpdate
// Describes application output configuration updates.
OutputUpdates []OutputUpdate
// Describes application reference data source updates.
ReferenceDataSourceUpdates []ReferenceDataSourceUpdate
noSmithyDocumentSerde
}
// Provides a description of CloudWatch logging options, including the log stream
// Amazon Resource Name (ARN) and the role ARN.
type CloudWatchLoggingOption struct {
// ARN of the CloudWatch log to receive application messages.
//
// This member is required.
LogStreamARN *string
// IAM ARN of the role to use to send application messages. Note: To write
// application messages to CloudWatch, the IAM role that is used must have the
// PutLogEvents policy action enabled.
//
// This member is required.
RoleARN *string
noSmithyDocumentSerde
}
// Description of the CloudWatch logging option.
type CloudWatchLoggingOptionDescription struct {
// ARN of the CloudWatch log to receive application messages.
//
// This member is required.
LogStreamARN *string
// IAM ARN of the role to use to send application messages. Note: To write
// application messages to CloudWatch, the IAM role used must have the PutLogEvents
// policy action enabled.
//
// This member is required.
RoleARN *string
// ID of the CloudWatch logging option description.
CloudWatchLoggingOptionId *string
noSmithyDocumentSerde
}
// Describes CloudWatch logging option updates.
type CloudWatchLoggingOptionUpdate struct {
// ID of the CloudWatch logging option to update
//
// This member is required.
CloudWatchLoggingOptionId *string
// ARN of the CloudWatch log to receive application messages.
LogStreamARNUpdate *string
// IAM ARN of the role to use to send application messages. Note: To write
// application messages to CloudWatch, the IAM role used must have the PutLogEvents
// policy action enabled.
RoleARNUpdate *string
noSmithyDocumentSerde
}
// Provides additional mapping information when the record format uses delimiters,
// such as CSV. For example, the following sample records use CSV format, where the
// records use the '\n' as the row delimiter and a comma (",") as the column
// delimiter: "name1", "address1"
//
// "name2", "address2"
type CSVMappingParameters struct {
// Column delimiter. For example, in a CSV format, a comma (",") is the typical
// column delimiter.
//
// This member is required.
RecordColumnDelimiter *string
// Row delimiter. For example, in a CSV format, '\n' is the typical row delimiter.
//
// This member is required.
RecordRowDelimiter *string
noSmithyDocumentSerde
}
// Describes the data format when records are written to the destination. For more
// information, see Configuring Application Output (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-output.html)
// .
type DestinationSchema struct {
// Specifies the format of the records on the output stream.
//
// This member is required.
RecordFormatType RecordFormatType
noSmithyDocumentSerde
}
// When you configure the application input, you specify the streaming source, the
// in-application stream name that is created, and the mapping between the two. For
// more information, see Configuring Application Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html)
// .
type Input struct {
// Describes the format of the data in the streaming source, and how each data
// element maps to corresponding columns in the in-application stream that is being
// created. Also used to describe the format of the reference data source.
//
// This member is required.
InputSchema *SourceSchema
// Name prefix to use when creating an in-application stream. Suppose that you
// specify a prefix "MyInApplicationStream." Amazon Kinesis Analytics then creates
// one or more (as per the InputParallelism count you specified) in-application
// streams with names "MyInApplicationStream_001," "MyInApplicationStream_002," and
// so on.
//
// This member is required.
NamePrefix *string
// Describes the number of in-application streams to create. Data from your source
// is routed to these in-application input streams. (see Configuring Application
// Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html)
// .
InputParallelism *InputParallelism
// The InputProcessingConfiguration (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputProcessingConfiguration.html)
// for the input. An input processor transforms records as they are received from
// the stream, before the application's SQL code executes. Currently, the only
// input processing configuration available is InputLambdaProcessor (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputLambdaProcessor.html)
// .
InputProcessingConfiguration *InputProcessingConfiguration
// If the streaming source is an Amazon Kinesis Firehose delivery stream,
// identifies the delivery stream's ARN and an IAM role that enables Amazon Kinesis
// Analytics to access the stream on your behalf. Note: Either KinesisStreamsInput
// or KinesisFirehoseInput is required.
KinesisFirehoseInput *KinesisFirehoseInput
// If the streaming source is an Amazon Kinesis stream, identifies the stream's
// Amazon Resource Name (ARN) and an IAM role that enables Amazon Kinesis Analytics
// to access the stream on your behalf. Note: Either KinesisStreamsInput or
// KinesisFirehoseInput is required.
KinesisStreamsInput *KinesisStreamsInput
noSmithyDocumentSerde
}
// When you start your application, you provide this configuration, which
// identifies the input source and the point in the input source at which you want
// the application to start processing records.
type InputConfiguration struct {
// Input source ID. You can get this ID by calling the DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation.
//
// This member is required.
Id *string
// Point at which you want the application to start processing records from the
// streaming source.
//
// This member is required.
InputStartingPositionConfiguration *InputStartingPositionConfiguration
noSmithyDocumentSerde
}
// Describes the application input configuration. For more information, see
// Configuring Application Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html)
// .
type InputDescription struct {
// Returns the in-application stream names that are mapped to the stream source.
InAppStreamNames []string
// Input ID associated with the application input. This is the ID that Amazon
// Kinesis Analytics assigns to each input configuration you add to your
// application.
InputId *string
// Describes the configured parallelism (number of in-application streams mapped
// to the streaming source).
InputParallelism *InputParallelism
// The description of the preprocessor that executes on records in this input
// before the application's code is run.
InputProcessingConfigurationDescription *InputProcessingConfigurationDescription
// Describes the format of the data in the streaming source, and how each data
// element maps to corresponding columns in the in-application stream that is being
// created.
InputSchema *SourceSchema
// Point at which the application is configured to read from the input stream.
InputStartingPositionConfiguration *InputStartingPositionConfiguration
// If an Amazon Kinesis Firehose delivery stream is configured as a streaming
// source, provides the delivery stream's ARN and an IAM role that enables Amazon
// Kinesis Analytics to access the stream on your behalf.
KinesisFirehoseInputDescription *KinesisFirehoseInputDescription
// If an Amazon Kinesis stream is configured as streaming source, provides Amazon
// Kinesis stream's Amazon Resource Name (ARN) and an IAM role that enables Amazon
// Kinesis Analytics to access the stream on your behalf.
KinesisStreamsInputDescription *KinesisStreamsInputDescription
// In-application name prefix.
NamePrefix *string
noSmithyDocumentSerde
}
// An object that contains the Amazon Resource Name (ARN) of the AWS Lambda (https://docs.aws.amazon.com/lambda/)
// function that is used to preprocess records in the stream, and the ARN of the
// IAM role that is used to access the AWS Lambda function.
type InputLambdaProcessor struct {
// The ARN of the AWS Lambda (https://docs.aws.amazon.com/lambda/) function that
// operates on records in the stream. To specify an earlier version of the Lambda
// function than the latest, include the Lambda function version in the Lambda
// function ARN. For more information about Lambda ARNs, see Example ARNs: AWS
// Lambda
//
// This member is required.
ResourceARN *string
// The ARN of the IAM role that is used to access the AWS Lambda function.
//
// This member is required.
RoleARN *string
noSmithyDocumentSerde
}
// An object that contains the Amazon Resource Name (ARN) of the AWS Lambda (https://docs.aws.amazon.com/lambda/)
// function that is used to preprocess records in the stream, and the ARN of the
// IAM role that is used to access the AWS Lambda expression.
type InputLambdaProcessorDescription struct {
// The ARN of the AWS Lambda (https://docs.aws.amazon.com/lambda/) function that
// is used to preprocess the records in the stream.
ResourceARN *string
// The ARN of the IAM role that is used to access the AWS Lambda function.
RoleARN *string
noSmithyDocumentSerde
}
// Represents an update to the InputLambdaProcessor (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputLambdaProcessor.html)
// that is used to preprocess the records in the stream.
type InputLambdaProcessorUpdate struct {
// The Amazon Resource Name (ARN) of the new AWS Lambda (https://docs.aws.amazon.com/lambda/)
// function that is used to preprocess the records in the stream. To specify an
// earlier version of the Lambda function than the latest, include the Lambda
// function version in the Lambda function ARN. For more information about Lambda
// ARNs, see Example ARNs: AWS Lambda
ResourceARNUpdate *string
// The ARN of the new IAM role that is used to access the AWS Lambda function.
RoleARNUpdate *string
noSmithyDocumentSerde
}
// Describes the number of in-application streams to create for a given streaming
// source. For information about parallelism, see Configuring Application Input (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-input.html)
// .
type InputParallelism struct {
// Number of in-application streams to create. For more information, see Limits (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/limits.html)
// .
Count *int32
noSmithyDocumentSerde
}
// Provides updates to the parallelism count.
type InputParallelismUpdate struct {
// Number of in-application streams to create for the specified streaming source.
CountUpdate *int32
noSmithyDocumentSerde
}
// Provides a description of a processor that is used to preprocess the records in
// the stream before being processed by your application code. Currently, the only
// input processor available is AWS Lambda (https://docs.aws.amazon.com/lambda/) .
type InputProcessingConfiguration struct {
// The InputLambdaProcessor (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputLambdaProcessor.html)
// that is used to preprocess the records in the stream before being processed by
// your application code.
//
// This member is required.
InputLambdaProcessor *InputLambdaProcessor
noSmithyDocumentSerde
}
// Provides configuration information about an input processor. Currently, the
// only input processor available is AWS Lambda (https://docs.aws.amazon.com/lambda/)
// .
type InputProcessingConfigurationDescription struct {
// Provides configuration information about the associated
// InputLambdaProcessorDescription (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputLambdaProcessorDescription.html)
// .
InputLambdaProcessorDescription *InputLambdaProcessorDescription
noSmithyDocumentSerde
}
// Describes updates to an InputProcessingConfiguration (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputProcessingConfiguration.html)
// .
type InputProcessingConfigurationUpdate struct {
// Provides update information for an InputLambdaProcessor (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_InputLambdaProcessor.html)
// .
//
// This member is required.
InputLambdaProcessorUpdate *InputLambdaProcessorUpdate
noSmithyDocumentSerde
}
// Describes updates for the application's input schema.
type InputSchemaUpdate struct {
// A list of RecordColumn objects. Each object describes the mapping of the
// streaming source element to the corresponding column in the in-application
// stream.
RecordColumnUpdates []RecordColumn
// Specifies the encoding of the records in the streaming source. For example,
// UTF-8.
RecordEncodingUpdate *string
// Specifies the format of the records on the streaming source.
RecordFormatUpdate *RecordFormat
noSmithyDocumentSerde
}
// Describes the point at which the application reads from the streaming source.
type InputStartingPositionConfiguration struct {
// The starting position on the stream.
// - NOW - Start reading just after the most recent record in the stream, start
// at the request time stamp that the customer issued.
// - TRIM_HORIZON - Start reading at the last untrimmed record in the stream,
// which is the oldest record available in the stream. This option is not available
// for an Amazon Kinesis Firehose delivery stream.
// - LAST_STOPPED_POINT - Resume reading from where the application last stopped
// reading.
InputStartingPosition InputStartingPosition
noSmithyDocumentSerde
}
// Describes updates to a specific input configuration (identified by the InputId
// of an application).
type InputUpdate struct {
// Input ID of the application input to be updated.
//
// This member is required.
InputId *string
// Describes the parallelism updates (the number in-application streams Amazon
// Kinesis Analytics creates for the specific streaming source).
InputParallelismUpdate *InputParallelismUpdate
// Describes updates for an input processing configuration.
InputProcessingConfigurationUpdate *InputProcessingConfigurationUpdate
// Describes the data format on the streaming source, and how record elements on
// the streaming source map to columns of the in-application stream that is
// created.
InputSchemaUpdate *InputSchemaUpdate
// If an Amazon Kinesis Firehose delivery stream is the streaming source to be
// updated, provides an updated stream ARN and IAM role ARN.
KinesisFirehoseInputUpdate *KinesisFirehoseInputUpdate
// If an Amazon Kinesis stream is the streaming source to be updated, provides an
// updated stream Amazon Resource Name (ARN) and IAM role ARN.
KinesisStreamsInputUpdate *KinesisStreamsInputUpdate
// Name prefix for in-application streams that Amazon Kinesis Analytics creates
// for the specific streaming source.
NamePrefixUpdate *string
noSmithyDocumentSerde
}
// Provides additional mapping information when JSON is the record format on the
// streaming source.
type JSONMappingParameters struct {
// Path to the top-level parent that contains the records.
//
// This member is required.
RecordRowPath *string
noSmithyDocumentSerde
}
// Identifies an Amazon Kinesis Firehose delivery stream as the streaming source.
// You provide the delivery stream's Amazon Resource Name (ARN) and an IAM role ARN
// that enables Amazon Kinesis Analytics to access the stream on your behalf.
type KinesisFirehoseInput struct {
// ARN of the input delivery stream.
//
// This member is required.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream on your behalf. You need to make sure that the role has the necessary
// permissions to access the stream.
//
// This member is required.
RoleARN *string
noSmithyDocumentSerde
}
// Describes the Amazon Kinesis Firehose delivery stream that is configured as the
// streaming source in the application input configuration.
type KinesisFirehoseInputDescription struct {
// Amazon Resource Name (ARN) of the Amazon Kinesis Firehose delivery stream.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics assumes to access the stream.
RoleARN *string
noSmithyDocumentSerde
}
// When updating application input configuration, provides information about an
// Amazon Kinesis Firehose delivery stream as the streaming source.
type KinesisFirehoseInputUpdate struct {
// Amazon Resource Name (ARN) of the input Amazon Kinesis Firehose delivery stream
// to read.
ResourceARNUpdate *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream on your behalf. You need to grant the necessary permissions to this role.
RoleARNUpdate *string
noSmithyDocumentSerde
}
// When configuring application output, identifies an Amazon Kinesis Firehose
// delivery stream as the destination. You provide the stream Amazon Resource Name
// (ARN) and an IAM role that enables Amazon Kinesis Analytics to write to the
// stream on your behalf.
type KinesisFirehoseOutput struct {
// ARN of the destination Amazon Kinesis Firehose delivery stream to write to.
//
// This member is required.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to write to the
// destination stream on your behalf. You need to grant the necessary permissions
// to this role.
//
// This member is required.
RoleARN *string
noSmithyDocumentSerde
}
// For an application output, describes the Amazon Kinesis Firehose delivery
// stream configured as its destination.
type KinesisFirehoseOutputDescription struct {
// Amazon Resource Name (ARN) of the Amazon Kinesis Firehose delivery stream.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream.
RoleARN *string
noSmithyDocumentSerde
}
// When updating an output configuration using the UpdateApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_UpdateApplication.html)
// operation, provides information about an Amazon Kinesis Firehose delivery stream
// configured as the destination.
type KinesisFirehoseOutputUpdate struct {
// Amazon Resource Name (ARN) of the Amazon Kinesis Firehose delivery stream to
// write to.
ResourceARNUpdate *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream on your behalf. You need to grant the necessary permissions to this role.
RoleARNUpdate *string
noSmithyDocumentSerde
}
// Identifies an Amazon Kinesis stream as the streaming source. You provide the
// stream's Amazon Resource Name (ARN) and an IAM role ARN that enables Amazon
// Kinesis Analytics to access the stream on your behalf.
type KinesisStreamsInput struct {
// ARN of the input Amazon Kinesis stream to read.
//
// This member is required.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream on your behalf. You need to grant the necessary permissions to this role.
//
// This member is required.
RoleARN *string
noSmithyDocumentSerde
}
// Describes the Amazon Kinesis stream that is configured as the streaming source
// in the application input configuration.
type KinesisStreamsInputDescription struct {
// Amazon Resource Name (ARN) of the Amazon Kinesis stream.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream.
RoleARN *string
noSmithyDocumentSerde
}
// When updating application input configuration, provides information about an
// Amazon Kinesis stream as the streaming source.
type KinesisStreamsInputUpdate struct {
// Amazon Resource Name (ARN) of the input Amazon Kinesis stream to read.
ResourceARNUpdate *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream on your behalf. You need to grant the necessary permissions to this role.
RoleARNUpdate *string
noSmithyDocumentSerde
}
// When configuring application output, identifies an Amazon Kinesis stream as the
// destination. You provide the stream Amazon Resource Name (ARN) and also an IAM
// role ARN that Amazon Kinesis Analytics can use to write to the stream on your
// behalf.
type KinesisStreamsOutput struct {
// ARN of the destination Amazon Kinesis stream to write to.
//
// This member is required.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to write to the
// destination stream on your behalf. You need to grant the necessary permissions
// to this role.
//
// This member is required.
RoleARN *string
noSmithyDocumentSerde
}
// For an application output, describes the Amazon Kinesis stream configured as
// its destination.
type KinesisStreamsOutputDescription struct {
// Amazon Resource Name (ARN) of the Amazon Kinesis stream.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream.
RoleARN *string
noSmithyDocumentSerde
}
// When updating an output configuration using the UpdateApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_UpdateApplication.html)
// operation, provides information about an Amazon Kinesis stream configured as the
// destination.
type KinesisStreamsOutputUpdate struct {
// Amazon Resource Name (ARN) of the Amazon Kinesis stream where you want to write
// the output.
ResourceARNUpdate *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to access the
// stream on your behalf. You need to grant the necessary permissions to this role.
RoleARNUpdate *string
noSmithyDocumentSerde
}
// When configuring application output, identifies an AWS Lambda function as the
// destination. You provide the function Amazon Resource Name (ARN) and also an IAM
// role ARN that Amazon Kinesis Analytics can use to write to the function on your
// behalf.
type LambdaOutput struct {
// Amazon Resource Name (ARN) of the destination Lambda function to write to. To
// specify an earlier version of the Lambda function than the latest, include the
// Lambda function version in the Lambda function ARN. For more information about
// Lambda ARNs, see Example ARNs: AWS Lambda
//
// This member is required.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to write to the
// destination function on your behalf. You need to grant the necessary permissions
// to this role.
//
// This member is required.
RoleARN *string
noSmithyDocumentSerde
}
// For an application output, describes the AWS Lambda function configured as its
// destination.
type LambdaOutputDescription struct {
// Amazon Resource Name (ARN) of the destination Lambda function.
ResourceARN *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to write to the
// destination function.
RoleARN *string
noSmithyDocumentSerde
}
// When updating an output configuration using the UpdateApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_UpdateApplication.html)
// operation, provides information about an AWS Lambda function configured as the
// destination.
type LambdaOutputUpdate struct {
// Amazon Resource Name (ARN) of the destination Lambda function. To specify an
// earlier version of the Lambda function than the latest, include the Lambda
// function version in the Lambda function ARN. For more information about Lambda
// ARNs, see Example ARNs: AWS Lambda
ResourceARNUpdate *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to write to the
// destination function on your behalf. You need to grant the necessary permissions
// to this role.
RoleARNUpdate *string
noSmithyDocumentSerde
}
// When configuring application input at the time of creating or updating an
// application, provides additional mapping information specific to the record
// format (such as JSON, CSV, or record fields delimited by some delimiter) on the
// streaming source.
type MappingParameters struct {
// Provides additional mapping information when the record format uses delimiters
// (for example, CSV).
CSVMappingParameters *CSVMappingParameters
// Provides additional mapping information when JSON is the record format on the
// streaming source.
JSONMappingParameters *JSONMappingParameters
noSmithyDocumentSerde
}
// Describes application output configuration in which you identify an
// in-application stream and a destination where you want the in-application stream
// data to be written. The destination can be an Amazon Kinesis stream or an Amazon
// Kinesis Firehose delivery stream. For limits on how many destinations an
// application can write and other limitations, see Limits (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/limits.html)
// .
type Output struct {
// Describes the data format when records are written to the destination. For more
// information, see Configuring Application Output (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-output.html)
// .
//
// This member is required.
DestinationSchema *DestinationSchema
// Name of the in-application stream.
//
// This member is required.
Name *string
// Identifies an Amazon Kinesis Firehose delivery stream as the destination.
KinesisFirehoseOutput *KinesisFirehoseOutput
// Identifies an Amazon Kinesis stream as the destination.
KinesisStreamsOutput *KinesisStreamsOutput
// Identifies an AWS Lambda function as the destination.
LambdaOutput *LambdaOutput
noSmithyDocumentSerde
}
// Describes the application output configuration, which includes the
// in-application stream name and the destination where the stream data is written.
// The destination can be an Amazon Kinesis stream or an Amazon Kinesis Firehose
// delivery stream.
type OutputDescription struct {
// Data format used for writing data to the destination.
DestinationSchema *DestinationSchema
// Describes the Amazon Kinesis Firehose delivery stream configured as the
// destination where output is written.
KinesisFirehoseOutputDescription *KinesisFirehoseOutputDescription
// Describes Amazon Kinesis stream configured as the destination where output is
// written.
KinesisStreamsOutputDescription *KinesisStreamsOutputDescription
// Describes the AWS Lambda function configured as the destination where output is
// written.
LambdaOutputDescription *LambdaOutputDescription
// Name of the in-application stream configured as output.
Name *string
// A unique identifier for the output configuration.
OutputId *string
noSmithyDocumentSerde
}
// Describes updates to the output configuration identified by the OutputId .
type OutputUpdate struct {
// Identifies the specific output configuration that you want to update.
//
// This member is required.
OutputId *string
// Describes the data format when records are written to the destination. For more
// information, see Configuring Application Output (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-output.html)
// .
DestinationSchemaUpdate *DestinationSchema
// Describes an Amazon Kinesis Firehose delivery stream as the destination for the
// output.
KinesisFirehoseOutputUpdate *KinesisFirehoseOutputUpdate
// Describes an Amazon Kinesis stream as the destination for the output.
KinesisStreamsOutputUpdate *KinesisStreamsOutputUpdate
// Describes an AWS Lambda function as the destination for the output.
LambdaOutputUpdate *LambdaOutputUpdate
// If you want to specify a different in-application stream for this output
// configuration, use this field to specify the new in-application stream name.
NameUpdate *string
noSmithyDocumentSerde
}
// Describes the mapping of each data element in the streaming source to the
// corresponding column in the in-application stream. Also used to describe the
// format of the reference data source.
type RecordColumn struct {
// Name of the column created in the in-application input stream or reference
// table.
//
// This member is required.
Name *string
// Type of column created in the in-application input stream or reference table.
//
// This member is required.
SqlType *string
// Reference to the data element in the streaming input or the reference data
// source. This element is required if the RecordFormatType (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_RecordFormat.html#analytics-Type-RecordFormat-RecordFormatTypel)
// is JSON .
Mapping *string
noSmithyDocumentSerde
}
// Describes the record format and relevant mapping information that should be
// applied to schematize the records on the stream.
type RecordFormat struct {
// The type of record format.
//
// This member is required.
RecordFormatType RecordFormatType
// When configuring application input at the time of creating or updating an
// application, provides additional mapping information specific to the record
// format (such as JSON, CSV, or record fields delimited by some delimiter) on the
// streaming source.
MappingParameters *MappingParameters
noSmithyDocumentSerde
}
// Describes the reference data source by providing the source information (S3
// bucket name and object key name), the resulting in-application table name that
// is created, and the necessary schema to map the data elements in the Amazon S3
// object to the in-application table.
type ReferenceDataSource struct {
// Describes the format of the data in the streaming source, and how each data
// element maps to corresponding columns created in the in-application stream.
//
// This member is required.
ReferenceSchema *SourceSchema
// Name of the in-application table to create.
//
// This member is required.
TableName *string
// Identifies the S3 bucket and object that contains the reference data. Also
// identifies the IAM role Amazon Kinesis Analytics can assume to read this object
// on your behalf. An Amazon Kinesis Analytics application loads reference data
// only once. If the data changes, you call the UpdateApplication operation to
// trigger reloading of data into your application.
S3ReferenceDataSource *S3ReferenceDataSource
noSmithyDocumentSerde
}
// Describes the reference data source configured for an application.
type ReferenceDataSourceDescription struct {
// ID of the reference data source. This is the ID that Amazon Kinesis Analytics
// assigns when you add the reference data source to your application using the
// AddApplicationReferenceDataSource (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_AddApplicationReferenceDataSource.html)
// operation.
//
// This member is required.
ReferenceId *string
// Provides the S3 bucket name, the object key name that contains the reference
// data. It also provides the Amazon Resource Name (ARN) of the IAM role that
// Amazon Kinesis Analytics can assume to read the Amazon S3 object and populate
// the in-application reference table.
//
// This member is required.
S3ReferenceDataSourceDescription *S3ReferenceDataSourceDescription
// The in-application table name created by the specific reference data source
// configuration.
//
// This member is required.
TableName *string
// Describes the format of the data in the streaming source, and how each data
// element maps to corresponding columns created in the in-application stream.
ReferenceSchema *SourceSchema
noSmithyDocumentSerde
}
// When you update a reference data source configuration for an application, this
// object provides all the updated values (such as the source bucket name and
// object key name), the in-application table name that is created, and updated
// mapping information that maps the data in the Amazon S3 object to the
// in-application reference table that is created.
type ReferenceDataSourceUpdate struct {
// ID of the reference data source being updated. You can use the
// DescribeApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html)
// operation to get this value.
//
// This member is required.
ReferenceId *string
// Describes the format of the data in the streaming source, and how each data
// element maps to corresponding columns created in the in-application stream.
ReferenceSchemaUpdate *SourceSchema
// Describes the S3 bucket name, object key name, and IAM role that Amazon Kinesis
// Analytics can assume to read the Amazon S3 object on your behalf and populate
// the in-application reference table.
S3ReferenceDataSourceUpdate *S3ReferenceDataSourceUpdate
// In-application table name that is created by this update.
TableNameUpdate *string
noSmithyDocumentSerde
}
// Provides a description of an Amazon S3 data source, including the Amazon
// Resource Name (ARN) of the S3 bucket, the ARN of the IAM role that is used to
// access the bucket, and the name of the Amazon S3 object that contains the data.
type S3Configuration struct {
// ARN of the S3 bucket that contains the data.
//
// This member is required.
BucketARN *string
// The name of the object that contains the data.
//
// This member is required.
FileKey *string
// IAM ARN of the role used to access the data.
//
// This member is required.
RoleARN *string
noSmithyDocumentSerde
}
// Identifies the S3 bucket and object that contains the reference data. Also
// identifies the IAM role Amazon Kinesis Analytics can assume to read this object
// on your behalf. An Amazon Kinesis Analytics application loads reference data
// only once. If the data changes, you call the UpdateApplication (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_UpdateApplication.html)
// operation to trigger reloading of data into your application.
type S3ReferenceDataSource struct {
// Amazon Resource Name (ARN) of the S3 bucket.
//
// This member is required.
BucketARN *string
// Object key name containing reference data.
//
// This member is required.
FileKey *string
// ARN of the IAM role that the service can assume to read data on your behalf.
// This role must have permission for the s3:GetObject action on the object and
// trust policy that allows Amazon Kinesis Analytics service principal to assume
// this role.
//
// This member is required.
ReferenceRoleARN *string
noSmithyDocumentSerde
}
// Provides the bucket name and object key name that stores the reference data.
type S3ReferenceDataSourceDescription struct {
// Amazon Resource Name (ARN) of the S3 bucket.
//
// This member is required.
BucketARN *string
// Amazon S3 object key name.
//
// This member is required.
FileKey *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to read the Amazon
// S3 object on your behalf to populate the in-application reference table.
//
// This member is required.
ReferenceRoleARN *string
noSmithyDocumentSerde
}
// Describes the S3 bucket name, object key name, and IAM role that Amazon Kinesis
// Analytics can assume to read the Amazon S3 object on your behalf and populate
// the in-application reference table.
type S3ReferenceDataSourceUpdate struct {
// Amazon Resource Name (ARN) of the S3 bucket.
BucketARNUpdate *string
// Object key name.
FileKeyUpdate *string
// ARN of the IAM role that Amazon Kinesis Analytics can assume to read the Amazon
// S3 object and populate the in-application.
ReferenceRoleARNUpdate *string
noSmithyDocumentSerde
}
// Describes the format of the data in the streaming source, and how each data
// element maps to corresponding columns created in the in-application stream.
type SourceSchema struct {
// A list of RecordColumn objects.
//
// This member is required.
RecordColumns []RecordColumn
// Specifies the format of the records on the streaming source.
//
// This member is required.
RecordFormat *RecordFormat
// Specifies the encoding of the records in the streaming source. For example,
// UTF-8.
RecordEncoding *string
noSmithyDocumentSerde
}
// A key-value pair (the value is optional) that you can define and assign to AWS
// resources. If you specify a tag that already exists, the tag value is replaced
// with the value that you specify in the request. Note that the maximum number of
// application tags includes system tags. The maximum number of user-defined
// application tags is 50. For more information, see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-tagging.html)
// .
type Tag struct {
// The key of the key-value tag.
//
// This member is required.
Key *string
// The value of the key-value tag. The value is optional.
Value *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 1,153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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 = "Kinesis Analytics V2"
const ServiceAPIVersion = "2018-05-23"
// Client provides the API client to make operations call for Amazon Kinesis
// Analytics.
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, "kinesisanalyticsv2", 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 kinesisanalyticsv2
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 kinesisanalyticsv2
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/kinesisanalyticsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds an Amazon CloudWatch log stream to monitor application configuration
// errors.
func (c *Client) AddApplicationCloudWatchLoggingOption(ctx context.Context, params *AddApplicationCloudWatchLoggingOptionInput, optFns ...func(*Options)) (*AddApplicationCloudWatchLoggingOptionOutput, error) {
if params == nil {
params = &AddApplicationCloudWatchLoggingOptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationCloudWatchLoggingOption", params, optFns, c.addOperationAddApplicationCloudWatchLoggingOptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationCloudWatchLoggingOptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationCloudWatchLoggingOptionInput struct {
// The Kinesis Data Analytics application name.
//
// This member is required.
ApplicationName *string
// Provides the Amazon CloudWatch log stream Amazon Resource Name (ARN).
//
// This member is required.
CloudWatchLoggingOption *types.CloudWatchLoggingOption
// A value you use to implement strong concurrency for application updates. You
// must provide the CurrentApplicationVersionId or the ConditionalToken . You get
// the application's current ConditionalToken using DescribeApplication . For
// better concurrency support, use the ConditionalToken parameter instead of
// CurrentApplicationVersionId .
ConditionalToken *string
// The version ID of the Kinesis Data Analytics application. You must provide the
// CurrentApplicationVersionId or the ConditionalToken .You can retrieve the
// application version ID using DescribeApplication . For better concurrency
// support, use the ConditionalToken parameter instead of
// CurrentApplicationVersionId .
CurrentApplicationVersionId *int64
noSmithyDocumentSerde
}
type AddApplicationCloudWatchLoggingOptionOutput struct {
// The application's ARN.
ApplicationARN *string
// The new version ID of the Kinesis Data Analytics application. Kinesis Data
// Analytics updates the ApplicationVersionId each time you change the CloudWatch
// logging options.
ApplicationVersionId *int64
// The descriptions of the current CloudWatch logging options for the Kinesis Data
// Analytics application.
CloudWatchLoggingOptionDescriptions []types.CloudWatchLoggingOptionDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationCloudWatchLoggingOptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationCloudWatchLoggingOption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationCloudWatchLoggingOption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationCloudWatchLoggingOptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationCloudWatchLoggingOption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationCloudWatchLoggingOption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationCloudWatchLoggingOption",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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/kinesisanalyticsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds a streaming source to your SQL-based Kinesis Data Analytics application.
// You can add a streaming source when you create an application, or you can use
// this operation to add a streaming source after you create an application. For
// more information, see CreateApplication . Any configuration update, including
// adding a streaming source using this operation, results in a new version of the
// application. You can use the DescribeApplication operation to find the current
// application version.
func (c *Client) AddApplicationInput(ctx context.Context, params *AddApplicationInputInput, optFns ...func(*Options)) (*AddApplicationInputOutput, error) {
if params == nil {
params = &AddApplicationInputInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationInput", params, optFns, c.addOperationAddApplicationInputMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationInputOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationInputInput struct {
// The name of your existing application to which you want to add the streaming
// source.
//
// This member is required.
ApplicationName *string
// The current version of your application. You must provide the
// ApplicationVersionID or the ConditionalToken .You can use the
// DescribeApplication operation to find the current application version.
//
// This member is required.
CurrentApplicationVersionId *int64
// The Input to add.
//
// This member is required.
Input *types.Input
noSmithyDocumentSerde
}
type AddApplicationInputOutput struct {
// The Amazon Resource Name (ARN) of the application.
ApplicationARN *string
// Provides the current application version.
ApplicationVersionId *int64
// Describes the application input configuration.
InputDescriptions []types.InputDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationInputMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationInput{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationInput{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationInputValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationInput(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationInput(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationInput",
}
}
| 150 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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/kinesisanalyticsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds an InputProcessingConfiguration to a SQL-based Kinesis Data Analytics
// application. An input processor pre-processes records on the input stream before
// the application's SQL code executes. Currently, the only input processor
// available is Amazon Lambda (https://docs.aws.amazon.com/lambda/) .
func (c *Client) AddApplicationInputProcessingConfiguration(ctx context.Context, params *AddApplicationInputProcessingConfigurationInput, optFns ...func(*Options)) (*AddApplicationInputProcessingConfigurationOutput, error) {
if params == nil {
params = &AddApplicationInputProcessingConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationInputProcessingConfiguration", params, optFns, c.addOperationAddApplicationInputProcessingConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationInputProcessingConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationInputProcessingConfigurationInput struct {
// The name of the application to which you want to add the input processing
// configuration.
//
// This member is required.
ApplicationName *string
// The version of the application to which you want to add the input processing
// configuration. You can use the DescribeApplication operation to get the current
// application version. If the version specified is not the current version, the
// ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// The ID of the input configuration to add the input processing configuration to.
// You can get a list of the input IDs for an application using the
// DescribeApplication operation.
//
// This member is required.
InputId *string
// The InputProcessingConfiguration to add to the application.
//
// This member is required.
InputProcessingConfiguration *types.InputProcessingConfiguration
noSmithyDocumentSerde
}
type AddApplicationInputProcessingConfigurationOutput struct {
// The Amazon Resource Name (ARN) of the application.
ApplicationARN *string
// Provides the current application version.
ApplicationVersionId *int64
// The input ID that is associated with the application input. This is the ID that
// Kinesis Data Analytics assigns to each input configuration that you add to your
// application.
InputId *string
// The description of the preprocessor that executes on records in this input
// before the application's code is run.
InputProcessingConfigurationDescription *types.InputProcessingConfigurationDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationInputProcessingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationInputProcessingConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationInputProcessingConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationInputProcessingConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationInputProcessingConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationInputProcessingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationInputProcessingConfiguration",
}
}
| 161 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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/kinesisanalyticsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds an external destination to your SQL-based Kinesis Data Analytics
// application. If you want Kinesis Data Analytics to deliver data from an
// in-application stream within your application to an external destination (such
// as an Kinesis data stream, a Kinesis Data Firehose delivery stream, or an Amazon
// Lambda function), you add the relevant configuration to your application using
// this operation. You can configure one or more outputs for your application. Each
// output configuration maps an in-application stream and an external destination.
// You can use one of the output configurations to deliver data from your
// in-application error stream to an external destination so that you can analyze
// the errors. Any configuration update, including adding a streaming source using
// this operation, results in a new version of the application. You can use the
// DescribeApplication operation to find the current application version.
func (c *Client) AddApplicationOutput(ctx context.Context, params *AddApplicationOutputInput, optFns ...func(*Options)) (*AddApplicationOutputOutput, error) {
if params == nil {
params = &AddApplicationOutputInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationOutput", params, optFns, c.addOperationAddApplicationOutputMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationOutputOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationOutputInput struct {
// The name of the application to which you want to add the output configuration.
//
// This member is required.
ApplicationName *string
// The version of the application to which you want to add the output
// configuration. You can use the DescribeApplication operation to get the current
// application version. If the version specified is not the current version, the
// ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// An array of objects, each describing one output configuration. In the output
// configuration, you specify the name of an in-application stream, a destination
// (that is, a Kinesis data stream, a Kinesis Data Firehose delivery stream, or an
// Amazon Lambda function), and record the formation to use when writing to the
// destination.
//
// This member is required.
Output *types.Output
noSmithyDocumentSerde
}
type AddApplicationOutputOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationARN *string
// The updated application version ID. Kinesis Data Analytics increments this ID
// when the application is updated.
ApplicationVersionId *int64
// Describes the application output configuration. For more information, see
// Configuring Application Output (https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-it-works-output.html)
// .
OutputDescriptions []types.OutputDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationOutputMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationOutput{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationOutput{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationOutputValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationOutput(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationOutput(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationOutput",
}
}
| 162 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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/kinesisanalyticsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds a reference data source to an existing SQL-based Kinesis Data Analytics
// application. Kinesis Data Analytics reads reference data (that is, an Amazon S3
// object) and creates an in-application table within your application. In the
// request, you provide the source (S3 bucket name and object key name), name of
// the in-application table to create, and the necessary mapping information that
// describes how data in an Amazon S3 object maps to columns in the resulting
// in-application table.
func (c *Client) AddApplicationReferenceDataSource(ctx context.Context, params *AddApplicationReferenceDataSourceInput, optFns ...func(*Options)) (*AddApplicationReferenceDataSourceOutput, error) {
if params == nil {
params = &AddApplicationReferenceDataSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationReferenceDataSource", params, optFns, c.addOperationAddApplicationReferenceDataSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationReferenceDataSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationReferenceDataSourceInput struct {
// The name of an existing application.
//
// This member is required.
ApplicationName *string
// The version of the application for which you are adding the reference data
// source. You can use the DescribeApplication operation to get the current
// application version. If the version specified is not the current version, the
// ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// The reference data source can be an object in your Amazon S3 bucket. Kinesis
// Data Analytics reads the object and copies the data into the in-application
// table that is created. You provide an S3 bucket, object key name, and the
// resulting in-application table that is created.
//
// This member is required.
ReferenceDataSource *types.ReferenceDataSource
noSmithyDocumentSerde
}
type AddApplicationReferenceDataSourceOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationARN *string
// The updated application version ID. Kinesis Data Analytics increments this ID
// when the application is updated.
ApplicationVersionId *int64
// Describes reference data sources configured for the application.
ReferenceDataSourceDescriptions []types.ReferenceDataSourceDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationReferenceDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationReferenceDataSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationReferenceDataSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationReferenceDataSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationReferenceDataSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationReferenceDataSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationReferenceDataSource",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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/kinesisanalyticsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds a Virtual Private Cloud (VPC) configuration to the application.
// Applications can use VPCs to store and access resources securely. Note the
// following about VPC configurations for Kinesis Data Analytics applications:
// - VPC configurations are not supported for SQL applications.
// - When a VPC is added to a Kinesis Data Analytics application, the
// application can no longer be accessed from the Internet directly. To enable
// Internet access to the application, add an Internet gateway to your VPC.
func (c *Client) AddApplicationVpcConfiguration(ctx context.Context, params *AddApplicationVpcConfigurationInput, optFns ...func(*Options)) (*AddApplicationVpcConfigurationOutput, error) {
if params == nil {
params = &AddApplicationVpcConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AddApplicationVpcConfiguration", params, optFns, c.addOperationAddApplicationVpcConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AddApplicationVpcConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type AddApplicationVpcConfigurationInput struct {
// The name of an existing application.
//
// This member is required.
ApplicationName *string
// Description of the VPC to add to the application.
//
// This member is required.
VpcConfiguration *types.VpcConfiguration
// A value you use to implement strong concurrency for application updates. You
// must provide the ApplicationVersionID or the ConditionalToken . You get the
// application's current ConditionalToken using DescribeApplication . For better
// concurrency support, use the ConditionalToken parameter instead of
// CurrentApplicationVersionId .
ConditionalToken *string
// The version of the application to which you want to add the VPC configuration.
// You must provide the CurrentApplicationVersionId or the ConditionalToken . You
// can use the DescribeApplication operation to get the current application
// version. If the version specified is not the current version, the
// ConcurrentModificationException is returned. For better concurrency support, use
// the ConditionalToken parameter instead of CurrentApplicationVersionId .
CurrentApplicationVersionId *int64
noSmithyDocumentSerde
}
type AddApplicationVpcConfigurationOutput struct {
// The ARN of the application.
ApplicationARN *string
// Provides the current application version. Kinesis Data Analytics updates the
// ApplicationVersionId each time you update the application.
ApplicationVersionId *int64
// The parameters of the new VPC configuration.
VpcConfigurationDescription *types.VpcConfigurationDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAddApplicationVpcConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddApplicationVpcConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddApplicationVpcConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAddApplicationVpcConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddApplicationVpcConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opAddApplicationVpcConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "AddApplicationVpcConfiguration",
}
}
| 158 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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/kinesisanalyticsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a Kinesis Data Analytics application. For information about creating a
// Kinesis Data Analytics application, see Creating an Application (https://docs.aws.amazon.com/kinesisanalytics/latest/java/getting-started.html)
// .
func (c *Client) CreateApplication(ctx context.Context, params *CreateApplicationInput, optFns ...func(*Options)) (*CreateApplicationOutput, error) {
if params == nil {
params = &CreateApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateApplication", params, optFns, c.addOperationCreateApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateApplicationInput struct {
// The name of your application (for example, sample-app ).
//
// This member is required.
ApplicationName *string
// The runtime environment for the application.
//
// This member is required.
RuntimeEnvironment types.RuntimeEnvironment
// The IAM role used by the application to access Kinesis data streams, Kinesis
// Data Firehose delivery streams, Amazon S3 objects, and other external resources.
//
// This member is required.
ServiceExecutionRole *string
// Use this parameter to configure the application.
ApplicationConfiguration *types.ApplicationConfiguration
// A summary description of the application.
ApplicationDescription *string
// Use the STREAMING mode to create a Kinesis Data Analytics For Flink
// application. To create a Kinesis Data Analytics Studio notebook, use the
// INTERACTIVE mode.
ApplicationMode types.ApplicationMode
// Use this parameter to configure an Amazon CloudWatch log stream to monitor
// application configuration errors.
CloudWatchLoggingOptions []types.CloudWatchLoggingOption
// A list of one or more tags to assign to the application. A tag is a key-value
// pair that identifies an application. Note that the maximum number of application
// tags includes system tags. The maximum number of user-defined application tags
// is 50. For more information, see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/java/how-tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateApplicationOutput struct {
// In response to your CreateApplication request, Kinesis Data Analytics returns a
// response with details of the application it created.
//
// This member is required.
ApplicationDetail *types.ApplicationDetail
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "CreateApplication",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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/kinesisanalyticsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates and returns a URL that you can use to connect to an application's
// extension. The IAM role or user used to call this API defines the permissions to
// access the extension. After the presigned URL is created, no additional
// permission is required to access this URL. IAM authorization policies for this
// API are also enforced for every HTTP request that attempts to connect to the
// extension. You control the amount of time that the URL will be valid using the
// SessionExpirationDurationInSeconds parameter. If you do not provide this
// parameter, the returned URL is valid for twelve hours. The URL that you get from
// a call to CreateApplicationPresignedUrl must be used within 3 minutes to be
// valid. If you first try to use the URL after the 3-minute limit expires, the
// service returns an HTTP 403 Forbidden error.
func (c *Client) CreateApplicationPresignedUrl(ctx context.Context, params *CreateApplicationPresignedUrlInput, optFns ...func(*Options)) (*CreateApplicationPresignedUrlOutput, error) {
if params == nil {
params = &CreateApplicationPresignedUrlInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateApplicationPresignedUrl", params, optFns, c.addOperationCreateApplicationPresignedUrlMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateApplicationPresignedUrlOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateApplicationPresignedUrlInput struct {
// The name of the application.
//
// This member is required.
ApplicationName *string
// The type of the extension for which to create and return a URL. Currently, the
// only valid extension URL type is FLINK_DASHBOARD_URL .
//
// This member is required.
UrlType types.UrlType
// The duration in seconds for which the returned URL will be valid.
SessionExpirationDurationInSeconds *int64
noSmithyDocumentSerde
}
type CreateApplicationPresignedUrlOutput struct {
// The URL of the extension.
AuthorizedUrl *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateApplicationPresignedUrlMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateApplicationPresignedUrl{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateApplicationPresignedUrl{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateApplicationPresignedUrlValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplicationPresignedUrl(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateApplicationPresignedUrl(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "CreateApplicationPresignedUrl",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a snapshot of the application's state data.
func (c *Client) CreateApplicationSnapshot(ctx context.Context, params *CreateApplicationSnapshotInput, optFns ...func(*Options)) (*CreateApplicationSnapshotOutput, error) {
if params == nil {
params = &CreateApplicationSnapshotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateApplicationSnapshot", params, optFns, c.addOperationCreateApplicationSnapshotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateApplicationSnapshotOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateApplicationSnapshotInput struct {
// The name of an existing application
//
// This member is required.
ApplicationName *string
// An identifier for the application snapshot.
//
// This member is required.
SnapshotName *string
noSmithyDocumentSerde
}
type CreateApplicationSnapshotOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateApplicationSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateApplicationSnapshot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateApplicationSnapshot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateApplicationSnapshotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplicationSnapshot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateApplicationSnapshot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "CreateApplicationSnapshot",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Deletes the specified application. Kinesis Data Analytics halts application
// execution and deletes the application.
func (c *Client) DeleteApplication(ctx context.Context, params *DeleteApplicationInput, optFns ...func(*Options)) (*DeleteApplicationOutput, error) {
if params == nil {
params = &DeleteApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplication", params, optFns, c.addOperationDeleteApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationInput struct {
// The name of the application to delete.
//
// This member is required.
ApplicationName *string
// Use the DescribeApplication operation to get this value.
//
// This member is required.
CreateTimestamp *time.Time
noSmithyDocumentSerde
}
type DeleteApplicationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplication",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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/kinesisanalyticsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes an Amazon CloudWatch log stream from an Kinesis Data Analytics
// application.
func (c *Client) DeleteApplicationCloudWatchLoggingOption(ctx context.Context, params *DeleteApplicationCloudWatchLoggingOptionInput, optFns ...func(*Options)) (*DeleteApplicationCloudWatchLoggingOptionOutput, error) {
if params == nil {
params = &DeleteApplicationCloudWatchLoggingOptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationCloudWatchLoggingOption", params, optFns, c.addOperationDeleteApplicationCloudWatchLoggingOptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationCloudWatchLoggingOptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationCloudWatchLoggingOptionInput struct {
// The application name.
//
// This member is required.
ApplicationName *string
// The CloudWatchLoggingOptionId of the Amazon CloudWatch logging option to
// delete. You can get the CloudWatchLoggingOptionId by using the
// DescribeApplication operation.
//
// This member is required.
CloudWatchLoggingOptionId *string
// A value you use to implement strong concurrency for application updates. You
// must provide the CurrentApplicationVersionId or the ConditionalToken . You get
// the application's current ConditionalToken using DescribeApplication . For
// better concurrency support, use the ConditionalToken parameter instead of
// CurrentApplicationVersionId .
ConditionalToken *string
// The version ID of the application. You must provide the
// CurrentApplicationVersionId or the ConditionalToken . You can retrieve the
// application version ID using DescribeApplication . For better concurrency
// support, use the ConditionalToken parameter instead of
// CurrentApplicationVersionId .
CurrentApplicationVersionId *int64
noSmithyDocumentSerde
}
type DeleteApplicationCloudWatchLoggingOptionOutput struct {
// The application's Amazon Resource Name (ARN).
ApplicationARN *string
// The version ID of the application. Kinesis Data Analytics updates the
// ApplicationVersionId each time you change the CloudWatch logging options.
ApplicationVersionId *int64
// The descriptions of the remaining CloudWatch logging options for the
// application.
CloudWatchLoggingOptionDescriptions []types.CloudWatchLoggingOptionDescription
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationCloudWatchLoggingOptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationCloudWatchLoggingOption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationCloudWatchLoggingOption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationCloudWatchLoggingOptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationCloudWatchLoggingOption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationCloudWatchLoggingOption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationCloudWatchLoggingOption",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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 InputProcessingConfiguration from an input.
func (c *Client) DeleteApplicationInputProcessingConfiguration(ctx context.Context, params *DeleteApplicationInputProcessingConfigurationInput, optFns ...func(*Options)) (*DeleteApplicationInputProcessingConfigurationOutput, error) {
if params == nil {
params = &DeleteApplicationInputProcessingConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationInputProcessingConfiguration", params, optFns, c.addOperationDeleteApplicationInputProcessingConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationInputProcessingConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationInputProcessingConfigurationInput struct {
// The name of the application.
//
// This member is required.
ApplicationName *string
// The application version. You can use the DescribeApplication operation to get
// the current application version. If the version specified is not the current
// version, the ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// The ID of the input configuration from which to delete the input processing
// configuration. You can get a list of the input IDs for an application by using
// the DescribeApplication operation.
//
// This member is required.
InputId *string
noSmithyDocumentSerde
}
type DeleteApplicationInputProcessingConfigurationOutput struct {
// The Amazon Resource Name (ARN) of the application.
ApplicationARN *string
// The current application version ID.
ApplicationVersionId *int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationInputProcessingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationInputProcessingConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationInputProcessingConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationInputProcessingConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationInputProcessingConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationInputProcessingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationInputProcessingConfiguration",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the output destination configuration from your SQL-based Kinesis Data
// Analytics application's configuration. Kinesis Data Analytics will no longer
// write data from the corresponding in-application stream to the external output
// destination.
func (c *Client) DeleteApplicationOutput(ctx context.Context, params *DeleteApplicationOutputInput, optFns ...func(*Options)) (*DeleteApplicationOutputOutput, error) {
if params == nil {
params = &DeleteApplicationOutputInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationOutput", params, optFns, c.addOperationDeleteApplicationOutputMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationOutputOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationOutputInput struct {
// The application name.
//
// This member is required.
ApplicationName *string
// The application version. You can use the DescribeApplication operation to get
// the current application version. If the version specified is not the current
// version, the ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// The ID of the configuration to delete. Each output configuration that is added
// to the application (either when the application is created or later) using the
// AddApplicationOutput operation has a unique ID. You need to provide the ID to
// uniquely identify the output configuration that you want to delete from the
// application configuration. You can use the DescribeApplication operation to get
// the specific OutputId .
//
// This member is required.
OutputId *string
noSmithyDocumentSerde
}
type DeleteApplicationOutputOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationARN *string
// The current application version ID.
ApplicationVersionId *int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationOutputMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationOutput{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationOutput{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationOutputValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationOutput(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationOutput(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationOutput",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
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 reference data source configuration from the specified SQL-based
// Kinesis Data Analytics application's configuration. If the application is
// running, Kinesis Data Analytics immediately removes the in-application table
// that you created using the AddApplicationReferenceDataSource operation.
func (c *Client) DeleteApplicationReferenceDataSource(ctx context.Context, params *DeleteApplicationReferenceDataSourceInput, optFns ...func(*Options)) (*DeleteApplicationReferenceDataSourceOutput, error) {
if params == nil {
params = &DeleteApplicationReferenceDataSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationReferenceDataSource", params, optFns, c.addOperationDeleteApplicationReferenceDataSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationReferenceDataSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationReferenceDataSourceInput struct {
// The name of an existing application.
//
// This member is required.
ApplicationName *string
// The current application version. You can use the DescribeApplication operation
// to get the current application version. If the version specified is not the
// current version, the ConcurrentModificationException is returned.
//
// This member is required.
CurrentApplicationVersionId *int64
// The ID of the reference data source. When you add a reference data source to
// your application using the AddApplicationReferenceDataSource , Kinesis Data
// Analytics assigns an ID. You can use the DescribeApplication operation to get
// the reference ID.
//
// This member is required.
ReferenceId *string
noSmithyDocumentSerde
}
type DeleteApplicationReferenceDataSourceOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationARN *string
// The updated version ID of the application.
ApplicationVersionId *int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationReferenceDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationReferenceDataSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationReferenceDataSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationReferenceDataSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationReferenceDataSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationReferenceDataSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationReferenceDataSource",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Deletes a snapshot of application state.
func (c *Client) DeleteApplicationSnapshot(ctx context.Context, params *DeleteApplicationSnapshotInput, optFns ...func(*Options)) (*DeleteApplicationSnapshotOutput, error) {
if params == nil {
params = &DeleteApplicationSnapshotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationSnapshot", params, optFns, c.addOperationDeleteApplicationSnapshotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationSnapshotOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationSnapshotInput struct {
// The name of an existing application.
//
// This member is required.
ApplicationName *string
// The creation timestamp of the application snapshot to delete. You can retrieve
// this value using or .
//
// This member is required.
SnapshotCreationTimestamp *time.Time
// The identifier for the snapshot delete.
//
// This member is required.
SnapshotName *string
noSmithyDocumentSerde
}
type DeleteApplicationSnapshotOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationSnapshot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationSnapshot{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationSnapshotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationSnapshot(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationSnapshot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationSnapshot",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package kinesisanalyticsv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a VPC configuration from a Kinesis Data Analytics application.
func (c *Client) DeleteApplicationVpcConfiguration(ctx context.Context, params *DeleteApplicationVpcConfigurationInput, optFns ...func(*Options)) (*DeleteApplicationVpcConfigurationOutput, error) {
if params == nil {
params = &DeleteApplicationVpcConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationVpcConfiguration", params, optFns, c.addOperationDeleteApplicationVpcConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationVpcConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationVpcConfigurationInput struct {
// The name of an existing application.
//
// This member is required.
ApplicationName *string
// The ID of the VPC configuration to delete.
//
// This member is required.
VpcConfigurationId *string
// A value you use to implement strong concurrency for application updates. You
// must provide the CurrentApplicationVersionId or the ConditionalToken . You get
// the application's current ConditionalToken using DescribeApplication . For
// better concurrency support, use the ConditionalToken parameter instead of
// CurrentApplicationVersionId .
ConditionalToken *string
// The current application version ID. You must provide the
// CurrentApplicationVersionId or the ConditionalToken . You can retrieve the
// application version ID using DescribeApplication . For better concurrency
// support, use the ConditionalToken parameter instead of
// CurrentApplicationVersionId .
CurrentApplicationVersionId *int64
noSmithyDocumentSerde
}
type DeleteApplicationVpcConfigurationOutput struct {
// The ARN of the Kinesis Data Analytics application.
ApplicationARN *string
// The updated version ID of the application.
ApplicationVersionId *int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationVpcConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApplicationVpcConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApplicationVpcConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationVpcConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationVpcConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationVpcConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "kinesisanalytics",
OperationName: "DeleteApplicationVpcConfiguration",
}
}
| 146 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.