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 emr
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"
)
// Provides the details of a security configuration by returning the configuration
// JSON.
func (c *Client) DescribeSecurityConfiguration(ctx context.Context, params *DescribeSecurityConfigurationInput, optFns ...func(*Options)) (*DescribeSecurityConfigurationOutput, error) {
if params == nil {
params = &DescribeSecurityConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSecurityConfiguration", params, optFns, c.addOperationDescribeSecurityConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSecurityConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeSecurityConfigurationInput struct {
// The name of the security configuration.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type DescribeSecurityConfigurationOutput struct {
// The date and time the security configuration was created
CreationDateTime *time.Time
// The name of the security configuration.
Name *string
// The security configuration details in JSON format.
SecurityConfiguration *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSecurityConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeSecurityConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeSecurityConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSecurityConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecurityConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeSecurityConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "DescribeSecurityConfiguration",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/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"
)
// Provides more detail about the cluster step.
func (c *Client) DescribeStep(ctx context.Context, params *DescribeStepInput, optFns ...func(*Options)) (*DescribeStepOutput, error) {
if params == nil {
params = &DescribeStepInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStep", params, optFns, c.addOperationDescribeStepMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeStepOutput)
out.ResultMetadata = metadata
return out, nil
}
// This input determines which step to describe.
type DescribeStepInput struct {
// The identifier of the cluster with steps to describe.
//
// This member is required.
ClusterId *string
// The identifier of the step to describe.
//
// This member is required.
StepId *string
noSmithyDocumentSerde
}
// This output contains the description of the cluster step.
type DescribeStepOutput struct {
// The step details for the requested step identifier.
Step *types.Step
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeStepMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeStep{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeStep{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeStepValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeStep(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// DescribeStepAPIClient is a client that implements the DescribeStep operation.
type DescribeStepAPIClient interface {
DescribeStep(context.Context, *DescribeStepInput, ...func(*Options)) (*DescribeStepOutput, error)
}
var _ DescribeStepAPIClient = (*Client)(nil)
// StepCompleteWaiterOptions are waiter options for StepCompleteWaiter
type StepCompleteWaiterOptions 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,
// StepCompleteWaiter will use default minimum delay of 30 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, StepCompleteWaiter 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, *DescribeStepInput, *DescribeStepOutput, error) (bool, error)
}
// StepCompleteWaiter defines the waiters for StepComplete
type StepCompleteWaiter struct {
client DescribeStepAPIClient
options StepCompleteWaiterOptions
}
// NewStepCompleteWaiter constructs a StepCompleteWaiter.
func NewStepCompleteWaiter(client DescribeStepAPIClient, optFns ...func(*StepCompleteWaiterOptions)) *StepCompleteWaiter {
options := StepCompleteWaiterOptions{}
options.MinDelay = 30 * time.Second
options.MaxDelay = 120 * time.Second
options.Retryable = stepCompleteStateRetryable
for _, fn := range optFns {
fn(&options)
}
return &StepCompleteWaiter{
client: client,
options: options,
}
}
// Wait calls the waiter function for StepComplete waiter. The maxWaitDur is the
// maximum wait duration the waiter will wait. The maxWaitDur is required and must
// be greater than zero.
func (w *StepCompleteWaiter) Wait(ctx context.Context, params *DescribeStepInput, maxWaitDur time.Duration, optFns ...func(*StepCompleteWaiterOptions)) error {
_, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...)
return err
}
// WaitForOutput calls the waiter function for StepComplete 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 *StepCompleteWaiter) WaitForOutput(ctx context.Context, params *DescribeStepInput, maxWaitDur time.Duration, optFns ...func(*StepCompleteWaiterOptions)) (*DescribeStepOutput, 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.DescribeStep(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 StepComplete waiter")
}
func stepCompleteStateRetryable(ctx context.Context, input *DescribeStepInput, output *DescribeStepOutput, err error) (bool, error) {
if err == nil {
pathValue, err := jmespath.Search("Step.Status.State", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "COMPLETED"
value, ok := pathValue.(types.StepState)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.StepState value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, nil
}
}
if err == nil {
pathValue, err := jmespath.Search("Step.Status.State", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "FAILED"
value, ok := pathValue.(types.StepState)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.StepState value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
if err == nil {
pathValue, err := jmespath.Search("Step.Status.State", output)
if err != nil {
return false, fmt.Errorf("error evaluating waiter state: %w", err)
}
expectedValue := "CANCELLED"
value, ok := pathValue.(types.StepState)
if !ok {
return false, fmt.Errorf("waiter comparator expected types.StepState value, got %T", pathValue)
}
if string(value) == expectedValue {
return false, fmt.Errorf("waiter state transitioned to Failure")
}
}
return true, nil
}
func newServiceMetadataMiddleware_opDescribeStep(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "DescribeStep",
}
}
| 337 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns details for the specified Amazon EMR Studio including ID, Name, VPC,
// Studio access URL, and so on.
func (c *Client) DescribeStudio(ctx context.Context, params *DescribeStudioInput, optFns ...func(*Options)) (*DescribeStudioOutput, error) {
if params == nil {
params = &DescribeStudioInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStudio", params, optFns, c.addOperationDescribeStudioMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeStudioOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeStudioInput struct {
// The Amazon EMR Studio ID.
//
// This member is required.
StudioId *string
noSmithyDocumentSerde
}
type DescribeStudioOutput struct {
// The Amazon EMR Studio details.
Studio *types.Studio
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeStudioMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeStudio{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeStudio{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeStudioValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeStudio(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeStudio(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "DescribeStudio",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the auto-termination policy for an Amazon EMR cluster.
func (c *Client) GetAutoTerminationPolicy(ctx context.Context, params *GetAutoTerminationPolicyInput, optFns ...func(*Options)) (*GetAutoTerminationPolicyOutput, error) {
if params == nil {
params = &GetAutoTerminationPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetAutoTerminationPolicy", params, optFns, c.addOperationGetAutoTerminationPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetAutoTerminationPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetAutoTerminationPolicyInput struct {
// Specifies the ID of the Amazon EMR cluster for which the auto-termination
// policy will be fetched.
//
// This member is required.
ClusterId *string
noSmithyDocumentSerde
}
type GetAutoTerminationPolicyOutput struct {
// Specifies the auto-termination policy that is attached to an Amazon EMR cluster.
AutoTerminationPolicy *types.AutoTerminationPolicy
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetAutoTerminationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAutoTerminationPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAutoTerminationPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetAutoTerminationPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAutoTerminationPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetAutoTerminationPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "GetAutoTerminationPolicy",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the Amazon EMR block public access configuration for your Amazon Web
// Services account in the current Region. For more information see Configure
// Block Public Access for Amazon EMR (https://docs.aws.amazon.com/emr/latest/ManagementGuide/configure-block-public-access.html)
// in the Amazon EMR Management Guide.
func (c *Client) GetBlockPublicAccessConfiguration(ctx context.Context, params *GetBlockPublicAccessConfigurationInput, optFns ...func(*Options)) (*GetBlockPublicAccessConfigurationOutput, error) {
if params == nil {
params = &GetBlockPublicAccessConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBlockPublicAccessConfiguration", params, optFns, c.addOperationGetBlockPublicAccessConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBlockPublicAccessConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBlockPublicAccessConfigurationInput struct {
noSmithyDocumentSerde
}
type GetBlockPublicAccessConfigurationOutput struct {
// A configuration for Amazon EMR block public access. The configuration applies
// to all clusters created in your account for the current Region. The
// configuration specifies whether block public access is enabled. If block public
// access is enabled, security groups associated with the cluster cannot have rules
// that allow inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is
// specified as an exception using PermittedPublicSecurityGroupRuleRanges in the
// BlockPublicAccessConfiguration . By default, Port 22 (SSH) is an exception, and
// public access is allowed on this port. You can change this by updating the block
// public access configuration to remove the exception. For accounts that created
// clusters in a Region before November 25, 2019, block public access is disabled
// by default in that Region. To use this feature, you must manually enable and
// configure it. For accounts that did not create an Amazon EMR cluster in a Region
// before this date, block public access is enabled by default in that Region.
//
// This member is required.
BlockPublicAccessConfiguration *types.BlockPublicAccessConfiguration
// Properties that describe the Amazon Web Services principal that created the
// BlockPublicAccessConfiguration using the PutBlockPublicAccessConfiguration
// action as well as the date and time that the configuration was created. Each
// time a configuration for block public access is updated, Amazon EMR updates this
// metadata.
//
// This member is required.
BlockPublicAccessConfigurationMetadata *types.BlockPublicAccessConfigurationMetadata
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBlockPublicAccessConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetBlockPublicAccessConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetBlockPublicAccessConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opGetBlockPublicAccessConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetBlockPublicAccessConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "GetBlockPublicAccessConfiguration",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides temporary, HTTP basic credentials that are associated with a given
// runtime IAM role and used by a cluster with fine-grained access control
// activated. You can use these credentials to connect to cluster endpoints that
// support username and password authentication.
func (c *Client) GetClusterSessionCredentials(ctx context.Context, params *GetClusterSessionCredentialsInput, optFns ...func(*Options)) (*GetClusterSessionCredentialsOutput, error) {
if params == nil {
params = &GetClusterSessionCredentialsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetClusterSessionCredentials", params, optFns, c.addOperationGetClusterSessionCredentialsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetClusterSessionCredentialsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetClusterSessionCredentialsInput struct {
// The unique identifier of the cluster.
//
// This member is required.
ClusterId *string
// The Amazon Resource Name (ARN) of the runtime role for interactive workload
// submission on the cluster. The runtime role can be a cross-account IAM role. The
// runtime role ARN is a combination of account ID, role name, and role type using
// the following format: arn:partition:service:region:account:resource .
//
// This member is required.
ExecutionRoleArn *string
noSmithyDocumentSerde
}
type GetClusterSessionCredentialsOutput struct {
// The credentials that you can use to connect to cluster endpoints that support
// username and password authentication.
Credentials types.Credentials
// The time when the credentials that are returned by the
// GetClusterSessionCredentials API expire.
ExpiresAt *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetClusterSessionCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetClusterSessionCredentials{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetClusterSessionCredentials{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetClusterSessionCredentialsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetClusterSessionCredentials(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetClusterSessionCredentials(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "GetClusterSessionCredentials",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Fetches the attached managed scaling policy for an Amazon EMR cluster.
func (c *Client) GetManagedScalingPolicy(ctx context.Context, params *GetManagedScalingPolicyInput, optFns ...func(*Options)) (*GetManagedScalingPolicyOutput, error) {
if params == nil {
params = &GetManagedScalingPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetManagedScalingPolicy", params, optFns, c.addOperationGetManagedScalingPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetManagedScalingPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetManagedScalingPolicyInput struct {
// Specifies the ID of the cluster for which the managed scaling policy will be
// fetched.
//
// This member is required.
ClusterId *string
noSmithyDocumentSerde
}
type GetManagedScalingPolicyOutput struct {
// Specifies the managed scaling policy that is attached to an Amazon EMR cluster.
ManagedScalingPolicy *types.ManagedScalingPolicy
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetManagedScalingPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetManagedScalingPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetManagedScalingPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetManagedScalingPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetManagedScalingPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetManagedScalingPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "GetManagedScalingPolicy",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Fetches mapping details for the specified Amazon EMR Studio and identity (user
// or group).
func (c *Client) GetStudioSessionMapping(ctx context.Context, params *GetStudioSessionMappingInput, optFns ...func(*Options)) (*GetStudioSessionMappingOutput, error) {
if params == nil {
params = &GetStudioSessionMappingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetStudioSessionMapping", params, optFns, c.addOperationGetStudioSessionMappingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetStudioSessionMappingOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetStudioSessionMappingInput struct {
// Specifies whether the identity to fetch is a user or a group.
//
// This member is required.
IdentityType types.IdentityType
// The ID of the Amazon EMR Studio.
//
// This member is required.
StudioId *string
// The globally unique identifier (GUID) of the user or group. For more
// information, see UserId (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserId)
// and GroupId (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-GroupId)
// in the IAM Identity Center Identity Store API Reference. Either IdentityName or
// IdentityId must be specified.
IdentityId *string
// The name of the user or group to fetch. For more information, see UserName (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserName)
// and DisplayName (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-DisplayName)
// in the IAM Identity Center Identity Store API Reference. Either IdentityName or
// IdentityId must be specified.
IdentityName *string
noSmithyDocumentSerde
}
type GetStudioSessionMappingOutput struct {
// The session mapping details for the specified Amazon EMR Studio and identity,
// including session policy ARN and creation time.
SessionMapping *types.SessionMappingDetail
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetStudioSessionMappingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetStudioSessionMapping{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetStudioSessionMapping{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetStudioSessionMappingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetStudioSessionMapping(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetStudioSessionMapping(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "GetStudioSessionMapping",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides information about the bootstrap actions associated with a cluster.
func (c *Client) ListBootstrapActions(ctx context.Context, params *ListBootstrapActionsInput, optFns ...func(*Options)) (*ListBootstrapActionsOutput, error) {
if params == nil {
params = &ListBootstrapActionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListBootstrapActions", params, optFns, c.addOperationListBootstrapActionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListBootstrapActionsOutput)
out.ResultMetadata = metadata
return out, nil
}
// This input determines which bootstrap actions to retrieve.
type ListBootstrapActionsInput struct {
// The cluster identifier for the bootstrap actions to list.
//
// This member is required.
ClusterId *string
// The pagination token that indicates the next set of results to retrieve.
Marker *string
noSmithyDocumentSerde
}
// This output contains the bootstrap actions detail.
type ListBootstrapActionsOutput struct {
// The bootstrap actions associated with the cluster.
BootstrapActions []types.Command
// The pagination token that indicates the next set of results to retrieve.
Marker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListBootstrapActionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListBootstrapActions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListBootstrapActions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListBootstrapActionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBootstrapActions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListBootstrapActionsAPIClient is a client that implements the
// ListBootstrapActions operation.
type ListBootstrapActionsAPIClient interface {
ListBootstrapActions(context.Context, *ListBootstrapActionsInput, ...func(*Options)) (*ListBootstrapActionsOutput, error)
}
var _ ListBootstrapActionsAPIClient = (*Client)(nil)
// ListBootstrapActionsPaginatorOptions is the paginator options for
// ListBootstrapActions
type ListBootstrapActionsPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListBootstrapActionsPaginator is a paginator for ListBootstrapActions
type ListBootstrapActionsPaginator struct {
options ListBootstrapActionsPaginatorOptions
client ListBootstrapActionsAPIClient
params *ListBootstrapActionsInput
nextToken *string
firstPage bool
}
// NewListBootstrapActionsPaginator returns a new ListBootstrapActionsPaginator
func NewListBootstrapActionsPaginator(client ListBootstrapActionsAPIClient, params *ListBootstrapActionsInput, optFns ...func(*ListBootstrapActionsPaginatorOptions)) *ListBootstrapActionsPaginator {
if params == nil {
params = &ListBootstrapActionsInput{}
}
options := ListBootstrapActionsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListBootstrapActionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListBootstrapActionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListBootstrapActions page.
func (p *ListBootstrapActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBootstrapActionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListBootstrapActions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListBootstrapActions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListBootstrapActions",
}
}
| 213 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides the status of all clusters visible to this Amazon Web Services
// account. Allows you to filter the list of clusters based on certain criteria;
// for example, filtering by cluster creation date and time or by status. This call
// returns a maximum of 50 clusters in unsorted order per call, but returns a
// marker to track the paging of the cluster list across multiple ListClusters
// calls.
func (c *Client) ListClusters(ctx context.Context, params *ListClustersInput, optFns ...func(*Options)) (*ListClustersOutput, error) {
if params == nil {
params = &ListClustersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListClusters", params, optFns, c.addOperationListClustersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListClustersOutput)
out.ResultMetadata = metadata
return out, nil
}
// This input determines how the ListClusters action filters the list of clusters
// that it returns.
type ListClustersInput struct {
// The cluster state filters to apply when listing clusters. Clusters that change
// state while this action runs may be not be returned as expected in the list of
// clusters.
ClusterStates []types.ClusterState
// The creation date and time beginning value filter for listing clusters.
CreatedAfter *time.Time
// The creation date and time end value filter for listing clusters.
CreatedBefore *time.Time
// The pagination token that indicates the next set of results to retrieve.
Marker *string
noSmithyDocumentSerde
}
// This contains a ClusterSummaryList with the cluster details; for example, the
// cluster IDs, names, and status.
type ListClustersOutput struct {
// The list of clusters for the account based on the given filters.
Clusters []types.ClusterSummary
// The pagination token that indicates the next set of results to retrieve.
Marker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListClustersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListClusters{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListClusters{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListClusters(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListClustersAPIClient is a client that implements the ListClusters operation.
type ListClustersAPIClient interface {
ListClusters(context.Context, *ListClustersInput, ...func(*Options)) (*ListClustersOutput, error)
}
var _ ListClustersAPIClient = (*Client)(nil)
// ListClustersPaginatorOptions is the paginator options for ListClusters
type ListClustersPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListClustersPaginator is a paginator for ListClusters
type ListClustersPaginator struct {
options ListClustersPaginatorOptions
client ListClustersAPIClient
params *ListClustersInput
nextToken *string
firstPage bool
}
// NewListClustersPaginator returns a new ListClustersPaginator
func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator {
if params == nil {
params = &ListClustersInput{}
}
options := ListClustersPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListClustersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListClustersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListClusters page.
func (p *ListClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListClusters(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListClusters(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListClusters",
}
}
| 222 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all available details about the instance fleets in a cluster. The
// instance fleet configuration is available only in Amazon EMR releases 4.8.0 and
// later, excluding 5.0.x versions.
func (c *Client) ListInstanceFleets(ctx context.Context, params *ListInstanceFleetsInput, optFns ...func(*Options)) (*ListInstanceFleetsOutput, error) {
if params == nil {
params = &ListInstanceFleetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListInstanceFleets", params, optFns, c.addOperationListInstanceFleetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListInstanceFleetsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListInstanceFleetsInput struct {
// The unique identifier of the cluster.
//
// This member is required.
ClusterId *string
// The pagination token that indicates the next set of results to retrieve.
Marker *string
noSmithyDocumentSerde
}
type ListInstanceFleetsOutput struct {
// The list of instance fleets for the cluster and given filters.
InstanceFleets []types.InstanceFleet
// The pagination token that indicates the next set of results to retrieve.
Marker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListInstanceFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListInstanceFleets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListInstanceFleets{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListInstanceFleetsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInstanceFleets(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListInstanceFleetsAPIClient is a client that implements the ListInstanceFleets
// operation.
type ListInstanceFleetsAPIClient interface {
ListInstanceFleets(context.Context, *ListInstanceFleetsInput, ...func(*Options)) (*ListInstanceFleetsOutput, error)
}
var _ ListInstanceFleetsAPIClient = (*Client)(nil)
// ListInstanceFleetsPaginatorOptions is the paginator options for
// ListInstanceFleets
type ListInstanceFleetsPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListInstanceFleetsPaginator is a paginator for ListInstanceFleets
type ListInstanceFleetsPaginator struct {
options ListInstanceFleetsPaginatorOptions
client ListInstanceFleetsAPIClient
params *ListInstanceFleetsInput
nextToken *string
firstPage bool
}
// NewListInstanceFleetsPaginator returns a new ListInstanceFleetsPaginator
func NewListInstanceFleetsPaginator(client ListInstanceFleetsAPIClient, params *ListInstanceFleetsInput, optFns ...func(*ListInstanceFleetsPaginatorOptions)) *ListInstanceFleetsPaginator {
if params == nil {
params = &ListInstanceFleetsInput{}
}
options := ListInstanceFleetsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListInstanceFleetsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListInstanceFleetsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListInstanceFleets page.
func (p *ListInstanceFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceFleetsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListInstanceFleets(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListInstanceFleets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListInstanceFleets",
}
}
| 213 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides all available details about the instance groups in a cluster.
func (c *Client) ListInstanceGroups(ctx context.Context, params *ListInstanceGroupsInput, optFns ...func(*Options)) (*ListInstanceGroupsOutput, error) {
if params == nil {
params = &ListInstanceGroupsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListInstanceGroups", params, optFns, c.addOperationListInstanceGroupsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListInstanceGroupsOutput)
out.ResultMetadata = metadata
return out, nil
}
// This input determines which instance groups to retrieve.
type ListInstanceGroupsInput struct {
// The identifier of the cluster for which to list the instance groups.
//
// This member is required.
ClusterId *string
// The pagination token that indicates the next set of results to retrieve.
Marker *string
noSmithyDocumentSerde
}
// This input determines which instance groups to retrieve.
type ListInstanceGroupsOutput struct {
// The list of instance groups for the cluster and given filters.
InstanceGroups []types.InstanceGroup
// The pagination token that indicates the next set of results to retrieve.
Marker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListInstanceGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListInstanceGroups{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListInstanceGroups{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListInstanceGroupsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInstanceGroups(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListInstanceGroupsAPIClient is a client that implements the ListInstanceGroups
// operation.
type ListInstanceGroupsAPIClient interface {
ListInstanceGroups(context.Context, *ListInstanceGroupsInput, ...func(*Options)) (*ListInstanceGroupsOutput, error)
}
var _ ListInstanceGroupsAPIClient = (*Client)(nil)
// ListInstanceGroupsPaginatorOptions is the paginator options for
// ListInstanceGroups
type ListInstanceGroupsPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListInstanceGroupsPaginator is a paginator for ListInstanceGroups
type ListInstanceGroupsPaginator struct {
options ListInstanceGroupsPaginatorOptions
client ListInstanceGroupsAPIClient
params *ListInstanceGroupsInput
nextToken *string
firstPage bool
}
// NewListInstanceGroupsPaginator returns a new ListInstanceGroupsPaginator
func NewListInstanceGroupsPaginator(client ListInstanceGroupsAPIClient, params *ListInstanceGroupsInput, optFns ...func(*ListInstanceGroupsPaginatorOptions)) *ListInstanceGroupsPaginator {
if params == nil {
params = &ListInstanceGroupsInput{}
}
options := ListInstanceGroupsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListInstanceGroupsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListInstanceGroupsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListInstanceGroups page.
func (p *ListInstanceGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceGroupsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListInstanceGroups(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListInstanceGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListInstanceGroups",
}
}
| 213 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides information for all active Amazon EC2 instances and Amazon EC2
// instances terminated in the last 30 days, up to a maximum of 2,000. Amazon EC2
// instances in any of the following states are considered active:
// AWAITING_FULFILLMENT, PROVISIONING, BOOTSTRAPPING, RUNNING.
func (c *Client) ListInstances(ctx context.Context, params *ListInstancesInput, optFns ...func(*Options)) (*ListInstancesOutput, error) {
if params == nil {
params = &ListInstancesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListInstances", params, optFns, c.addOperationListInstancesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListInstancesOutput)
out.ResultMetadata = metadata
return out, nil
}
// This input determines which instances to list.
type ListInstancesInput struct {
// The identifier of the cluster for which to list the instances.
//
// This member is required.
ClusterId *string
// The unique identifier of the instance fleet.
InstanceFleetId *string
// The node type of the instance fleet. For example MASTER, CORE, or TASK.
InstanceFleetType types.InstanceFleetType
// The identifier of the instance group for which to list the instances.
InstanceGroupId *string
// The type of instance group for which to list the instances.
InstanceGroupTypes []types.InstanceGroupType
// A list of instance states that will filter the instances returned with this
// request.
InstanceStates []types.InstanceState
// The pagination token that indicates the next set of results to retrieve.
Marker *string
noSmithyDocumentSerde
}
// This output contains the list of instances.
type ListInstancesOutput struct {
// The list of instances for the cluster and given filters.
Instances []types.Instance
// The pagination token that indicates the next set of results to retrieve.
Marker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListInstances{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListInstances{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListInstancesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInstances(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListInstancesAPIClient is a client that implements the ListInstances operation.
type ListInstancesAPIClient interface {
ListInstances(context.Context, *ListInstancesInput, ...func(*Options)) (*ListInstancesOutput, error)
}
var _ ListInstancesAPIClient = (*Client)(nil)
// ListInstancesPaginatorOptions is the paginator options for ListInstances
type ListInstancesPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListInstancesPaginator is a paginator for ListInstances
type ListInstancesPaginator struct {
options ListInstancesPaginatorOptions
client ListInstancesAPIClient
params *ListInstancesInput
nextToken *string
firstPage bool
}
// NewListInstancesPaginator returns a new ListInstancesPaginator
func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator {
if params == nil {
params = &ListInstancesInput{}
}
options := ListInstancesPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListInstancesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListInstancesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListInstances page.
func (p *ListInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstancesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListInstances(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListInstances(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListInstances",
}
}
| 230 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides summaries of all notebook executions. You can filter the list based on
// multiple criteria such as status, time range, and editor id. Returns a maximum
// of 50 notebook executions and a marker to track the paging of a longer notebook
// execution list across multiple ListNotebookExecutions calls.
func (c *Client) ListNotebookExecutions(ctx context.Context, params *ListNotebookExecutionsInput, optFns ...func(*Options)) (*ListNotebookExecutionsOutput, error) {
if params == nil {
params = &ListNotebookExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListNotebookExecutions", params, optFns, c.addOperationListNotebookExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListNotebookExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListNotebookExecutionsInput struct {
// The unique ID of the editor associated with the notebook execution.
EditorId *string
// The unique ID of the execution engine.
ExecutionEngineId *string
// The beginning of time range filter for listing notebook executions. The default
// is the timestamp of 30 days ago.
From *time.Time
// The pagination token, returned by a previous ListNotebookExecutions call, that
// indicates the start of the list for this ListNotebookExecutions call.
Marker *string
// The status filter for listing notebook executions.
// - START_PENDING indicates that the cluster has received the execution request
// but execution has not begun.
// - STARTING indicates that the execution is starting on the cluster.
// - RUNNING indicates that the execution is being processed by the cluster.
// - FINISHING indicates that execution processing is in the final stages.
// - FINISHED indicates that the execution has completed without error.
// - FAILING indicates that the execution is failing and will not finish
// successfully.
// - FAILED indicates that the execution failed.
// - STOP_PENDING indicates that the cluster has received a StopNotebookExecution
// request and the stop is pending.
// - STOPPING indicates that the cluster is in the process of stopping the
// execution as a result of a StopNotebookExecution request.
// - STOPPED indicates that the execution stopped because of a
// StopNotebookExecution request.
Status types.NotebookExecutionStatus
// The end of time range filter for listing notebook executions. The default is
// the current timestamp.
To *time.Time
noSmithyDocumentSerde
}
type ListNotebookExecutionsOutput struct {
// A pagination token that a subsequent ListNotebookExecutions can use to
// determine the next set of results to retrieve.
Marker *string
// A list of notebook executions.
NotebookExecutions []types.NotebookExecutionSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListNotebookExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListNotebookExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListNotebookExecutions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListNotebookExecutions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListNotebookExecutionsAPIClient is a client that implements the
// ListNotebookExecutions operation.
type ListNotebookExecutionsAPIClient interface {
ListNotebookExecutions(context.Context, *ListNotebookExecutionsInput, ...func(*Options)) (*ListNotebookExecutionsOutput, error)
}
var _ ListNotebookExecutionsAPIClient = (*Client)(nil)
// ListNotebookExecutionsPaginatorOptions is the paginator options for
// ListNotebookExecutions
type ListNotebookExecutionsPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListNotebookExecutionsPaginator is a paginator for ListNotebookExecutions
type ListNotebookExecutionsPaginator struct {
options ListNotebookExecutionsPaginatorOptions
client ListNotebookExecutionsAPIClient
params *ListNotebookExecutionsInput
nextToken *string
firstPage bool
}
// NewListNotebookExecutionsPaginator returns a new ListNotebookExecutionsPaginator
func NewListNotebookExecutionsPaginator(client ListNotebookExecutionsAPIClient, params *ListNotebookExecutionsInput, optFns ...func(*ListNotebookExecutionsPaginatorOptions)) *ListNotebookExecutionsPaginator {
if params == nil {
params = &ListNotebookExecutionsInput{}
}
options := ListNotebookExecutionsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListNotebookExecutionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListNotebookExecutionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListNotebookExecutions page.
func (p *ListNotebookExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotebookExecutionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListNotebookExecutions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListNotebookExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListNotebookExecutions",
}
}
| 241 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves release labels of Amazon EMR services in the Region where the API is
// called.
func (c *Client) ListReleaseLabels(ctx context.Context, params *ListReleaseLabelsInput, optFns ...func(*Options)) (*ListReleaseLabelsOutput, error) {
if params == nil {
params = &ListReleaseLabelsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListReleaseLabels", params, optFns, c.addOperationListReleaseLabelsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListReleaseLabelsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListReleaseLabelsInput struct {
// Filters the results of the request. Prefix specifies the prefix of release
// labels to return. Application specifies the application (with/without version)
// of release labels to return.
Filters *types.ReleaseLabelFilter
// Defines the maximum number of release labels to return in a single response.
// The default is 100 .
MaxResults *int32
// Specifies the next page of results. If NextToken is not specified, which is
// usually the case for the first request of ListReleaseLabels, the first page of
// results are determined by other filtering parameters or by the latest version.
// The ListReleaseLabels request fails if the identity (Amazon Web Services
// account ID) and all filtering parameters are different from the original
// request, or if the NextToken is expired or tampered with.
NextToken *string
noSmithyDocumentSerde
}
type ListReleaseLabelsOutput struct {
// Used to paginate the next page of results if specified in the next
// ListReleaseLabels request.
NextToken *string
// The returned release labels.
ReleaseLabels []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListReleaseLabelsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListReleaseLabels{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListReleaseLabels{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListReleaseLabels(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListReleaseLabelsAPIClient is a client that implements the ListReleaseLabels
// operation.
type ListReleaseLabelsAPIClient interface {
ListReleaseLabels(context.Context, *ListReleaseLabelsInput, ...func(*Options)) (*ListReleaseLabelsOutput, error)
}
var _ ListReleaseLabelsAPIClient = (*Client)(nil)
// ListReleaseLabelsPaginatorOptions is the paginator options for ListReleaseLabels
type ListReleaseLabelsPaginatorOptions struct {
// Defines the maximum number of release labels to return in a single response.
// The default is 100 .
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListReleaseLabelsPaginator is a paginator for ListReleaseLabels
type ListReleaseLabelsPaginator struct {
options ListReleaseLabelsPaginatorOptions
client ListReleaseLabelsAPIClient
params *ListReleaseLabelsInput
nextToken *string
firstPage bool
}
// NewListReleaseLabelsPaginator returns a new ListReleaseLabelsPaginator
func NewListReleaseLabelsPaginator(client ListReleaseLabelsAPIClient, params *ListReleaseLabelsInput, optFns ...func(*ListReleaseLabelsPaginatorOptions)) *ListReleaseLabelsPaginator {
if params == nil {
params = &ListReleaseLabelsInput{}
}
options := ListReleaseLabelsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListReleaseLabelsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListReleaseLabelsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListReleaseLabels page.
func (p *ListReleaseLabelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReleaseLabelsOutput, 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.ListReleaseLabels(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_opListReleaseLabels(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListReleaseLabels",
}
}
| 231 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all the security configurations visible to this account, providing their
// creation dates and times, and their names. This call returns a maximum of 50
// clusters per call, but returns a marker to track the paging of the cluster list
// across multiple ListSecurityConfigurations calls.
func (c *Client) ListSecurityConfigurations(ctx context.Context, params *ListSecurityConfigurationsInput, optFns ...func(*Options)) (*ListSecurityConfigurationsOutput, error) {
if params == nil {
params = &ListSecurityConfigurationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSecurityConfigurations", params, optFns, c.addOperationListSecurityConfigurationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSecurityConfigurationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSecurityConfigurationsInput struct {
// The pagination token that indicates the set of results to retrieve.
Marker *string
noSmithyDocumentSerde
}
type ListSecurityConfigurationsOutput struct {
// A pagination token that indicates the next set of results to retrieve. Include
// the marker in the next ListSecurityConfiguration call to retrieve the next page
// of results, if required.
Marker *string
// The creation date and time, and name, of each security configuration.
SecurityConfigurations []types.SecurityConfigurationSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSecurityConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSecurityConfigurations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListSecurityConfigurations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListSecurityConfigurations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSecurityConfigurationsAPIClient is a client that implements the
// ListSecurityConfigurations operation.
type ListSecurityConfigurationsAPIClient interface {
ListSecurityConfigurations(context.Context, *ListSecurityConfigurationsInput, ...func(*Options)) (*ListSecurityConfigurationsOutput, error)
}
var _ ListSecurityConfigurationsAPIClient = (*Client)(nil)
// ListSecurityConfigurationsPaginatorOptions is the paginator options for
// ListSecurityConfigurations
type ListSecurityConfigurationsPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListSecurityConfigurationsPaginator is a paginator for
// ListSecurityConfigurations
type ListSecurityConfigurationsPaginator struct {
options ListSecurityConfigurationsPaginatorOptions
client ListSecurityConfigurationsAPIClient
params *ListSecurityConfigurationsInput
nextToken *string
firstPage bool
}
// NewListSecurityConfigurationsPaginator returns a new
// ListSecurityConfigurationsPaginator
func NewListSecurityConfigurationsPaginator(client ListSecurityConfigurationsAPIClient, params *ListSecurityConfigurationsInput, optFns ...func(*ListSecurityConfigurationsPaginatorOptions)) *ListSecurityConfigurationsPaginator {
if params == nil {
params = &ListSecurityConfigurationsInput{}
}
options := ListSecurityConfigurationsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListSecurityConfigurationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSecurityConfigurationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSecurityConfigurations page.
func (p *ListSecurityConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityConfigurationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListSecurityConfigurations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSecurityConfigurations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListSecurityConfigurations",
}
}
| 210 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of steps for the cluster in reverse order unless you specify
// stepIds with the request or filter by StepStates . You can specify a maximum of
// 10 stepIDs . The CLI automatically paginates results to return a list greater
// than 50 steps. To return more than 50 steps using the CLI, specify a Marker ,
// which is a pagination token that indicates the next set of steps to retrieve.
func (c *Client) ListSteps(ctx context.Context, params *ListStepsInput, optFns ...func(*Options)) (*ListStepsOutput, error) {
if params == nil {
params = &ListStepsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSteps", params, optFns, c.addOperationListStepsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListStepsOutput)
out.ResultMetadata = metadata
return out, nil
}
// This input determines which steps to list.
type ListStepsInput struct {
// The identifier of the cluster for which to list the steps.
//
// This member is required.
ClusterId *string
// The maximum number of steps that a single ListSteps action returns is 50. To
// return a longer list of steps, use multiple ListSteps actions along with the
// Marker parameter, which is a pagination token that indicates the next set of
// results to retrieve.
Marker *string
// The filter to limit the step list based on the identifier of the steps. You can
// specify a maximum of ten Step IDs. The character constraint applies to the
// overall length of the array.
StepIds []string
// The filter to limit the step list based on certain states.
StepStates []types.StepState
noSmithyDocumentSerde
}
// This output contains the list of steps returned in reverse order. This means
// that the last step is the first element in the list.
type ListStepsOutput struct {
// The maximum number of steps that a single ListSteps action returns is 50. To
// return a longer list of steps, use multiple ListSteps actions along with the
// Marker parameter, which is a pagination token that indicates the next set of
// results to retrieve.
Marker *string
// The filtered list of steps for the cluster.
Steps []types.StepSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListStepsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSteps{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListSteps{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListStepsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSteps(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListStepsAPIClient is a client that implements the ListSteps operation.
type ListStepsAPIClient interface {
ListSteps(context.Context, *ListStepsInput, ...func(*Options)) (*ListStepsOutput, error)
}
var _ ListStepsAPIClient = (*Client)(nil)
// ListStepsPaginatorOptions is the paginator options for ListSteps
type ListStepsPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListStepsPaginator is a paginator for ListSteps
type ListStepsPaginator struct {
options ListStepsPaginatorOptions
client ListStepsAPIClient
params *ListStepsInput
nextToken *string
firstPage bool
}
// NewListStepsPaginator returns a new ListStepsPaginator
func NewListStepsPaginator(client ListStepsAPIClient, params *ListStepsInput, optFns ...func(*ListStepsPaginatorOptions)) *ListStepsPaginator {
if params == nil {
params = &ListStepsInput{}
}
options := ListStepsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListStepsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListStepsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSteps page.
func (p *ListStepsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStepsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListSteps(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSteps(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListSteps",
}
}
| 230 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of all Amazon EMR Studios associated with the Amazon Web
// Services account. The list includes details such as ID, Studio Access URL, and
// creation time for each Studio.
func (c *Client) ListStudios(ctx context.Context, params *ListStudiosInput, optFns ...func(*Options)) (*ListStudiosOutput, error) {
if params == nil {
params = &ListStudiosInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListStudios", params, optFns, c.addOperationListStudiosMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListStudiosOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListStudiosInput struct {
// The pagination token that indicates the set of results to retrieve.
Marker *string
noSmithyDocumentSerde
}
type ListStudiosOutput struct {
// The pagination token that indicates the next set of results to retrieve.
Marker *string
// The list of Studio summary objects.
Studios []types.StudioSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListStudiosMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListStudios{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListStudios{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListStudios(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListStudiosAPIClient is a client that implements the ListStudios operation.
type ListStudiosAPIClient interface {
ListStudios(context.Context, *ListStudiosInput, ...func(*Options)) (*ListStudiosOutput, error)
}
var _ ListStudiosAPIClient = (*Client)(nil)
// ListStudiosPaginatorOptions is the paginator options for ListStudios
type ListStudiosPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListStudiosPaginator is a paginator for ListStudios
type ListStudiosPaginator struct {
options ListStudiosPaginatorOptions
client ListStudiosAPIClient
params *ListStudiosInput
nextToken *string
firstPage bool
}
// NewListStudiosPaginator returns a new ListStudiosPaginator
func NewListStudiosPaginator(client ListStudiosAPIClient, params *ListStudiosInput, optFns ...func(*ListStudiosPaginatorOptions)) *ListStudiosPaginator {
if params == nil {
params = &ListStudiosInput{}
}
options := ListStudiosPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListStudiosPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListStudiosPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListStudios page.
func (p *ListStudiosPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStudiosOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListStudios(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListStudios(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListStudios",
}
}
| 203 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of all user or group session mappings for the Amazon EMR Studio
// specified by StudioId .
func (c *Client) ListStudioSessionMappings(ctx context.Context, params *ListStudioSessionMappingsInput, optFns ...func(*Options)) (*ListStudioSessionMappingsOutput, error) {
if params == nil {
params = &ListStudioSessionMappingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListStudioSessionMappings", params, optFns, c.addOperationListStudioSessionMappingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListStudioSessionMappingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListStudioSessionMappingsInput struct {
// Specifies whether to return session mappings for users or groups. If not
// specified, the results include session mapping details for both users and
// groups.
IdentityType types.IdentityType
// The pagination token that indicates the set of results to retrieve.
Marker *string
// The ID of the Amazon EMR Studio.
StudioId *string
noSmithyDocumentSerde
}
type ListStudioSessionMappingsOutput struct {
// The pagination token that indicates the next set of results to retrieve.
Marker *string
// A list of session mapping summary objects. Each object includes session mapping
// details such as creation time, identity type (user or group), and Amazon EMR
// Studio ID.
SessionMappings []types.SessionMappingSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListStudioSessionMappingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListStudioSessionMappings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListStudioSessionMappings{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListStudioSessionMappings(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListStudioSessionMappingsAPIClient is a client that implements the
// ListStudioSessionMappings operation.
type ListStudioSessionMappingsAPIClient interface {
ListStudioSessionMappings(context.Context, *ListStudioSessionMappingsInput, ...func(*Options)) (*ListStudioSessionMappingsOutput, error)
}
var _ ListStudioSessionMappingsAPIClient = (*Client)(nil)
// ListStudioSessionMappingsPaginatorOptions is the paginator options for
// ListStudioSessionMappings
type ListStudioSessionMappingsPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListStudioSessionMappingsPaginator is a paginator for ListStudioSessionMappings
type ListStudioSessionMappingsPaginator struct {
options ListStudioSessionMappingsPaginatorOptions
client ListStudioSessionMappingsAPIClient
params *ListStudioSessionMappingsInput
nextToken *string
firstPage bool
}
// NewListStudioSessionMappingsPaginator returns a new
// ListStudioSessionMappingsPaginator
func NewListStudioSessionMappingsPaginator(client ListStudioSessionMappingsAPIClient, params *ListStudioSessionMappingsInput, optFns ...func(*ListStudioSessionMappingsPaginatorOptions)) *ListStudioSessionMappingsPaginator {
if params == nil {
params = &ListStudioSessionMappingsInput{}
}
options := ListStudioSessionMappingsPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListStudioSessionMappingsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListStudioSessionMappingsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListStudioSessionMappings page.
func (p *ListStudioSessionMappingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStudioSessionMappingsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListStudioSessionMappings(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListStudioSessionMappings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListStudioSessionMappings",
}
}
| 215 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// A list of the instance types that Amazon EMR supports. You can filter the list
// by Amazon Web Services Region and Amazon EMR release.
func (c *Client) ListSupportedInstanceTypes(ctx context.Context, params *ListSupportedInstanceTypesInput, optFns ...func(*Options)) (*ListSupportedInstanceTypesOutput, error) {
if params == nil {
params = &ListSupportedInstanceTypesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSupportedInstanceTypes", params, optFns, c.addOperationListSupportedInstanceTypesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSupportedInstanceTypesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSupportedInstanceTypesInput struct {
// The Amazon EMR release label determines the versions of open-source application
// packages (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-release-app-versions-6.x.html)
// that Amazon EMR has installed on the cluster. Release labels are in the format
// emr-x.x.x , where x.x.x is an Amazon EMR release number such as emr-6.10.0 . For
// more information about Amazon EMR releases and their included application
// versions and features, see the Amazon EMR Release Guide (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-release-components.html)
// .
//
// This member is required.
ReleaseLabel *string
// The pagination token that marks the next set of results to retrieve.
Marker *string
noSmithyDocumentSerde
}
type ListSupportedInstanceTypesOutput struct {
// The pagination token that marks the next set of results to retrieve.
Marker *string
// The list of instance types that the release specified in
// ListSupportedInstanceTypesInput$ReleaseLabel supports, filtered by Amazon Web
// Services Region.
SupportedInstanceTypes []types.SupportedInstanceType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSupportedInstanceTypesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSupportedInstanceTypes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListSupportedInstanceTypes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListSupportedInstanceTypesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSupportedInstanceTypes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSupportedInstanceTypesAPIClient is a client that implements the
// ListSupportedInstanceTypes operation.
type ListSupportedInstanceTypesAPIClient interface {
ListSupportedInstanceTypes(context.Context, *ListSupportedInstanceTypesInput, ...func(*Options)) (*ListSupportedInstanceTypesOutput, error)
}
var _ ListSupportedInstanceTypesAPIClient = (*Client)(nil)
// ListSupportedInstanceTypesPaginatorOptions is the paginator options for
// ListSupportedInstanceTypes
type ListSupportedInstanceTypesPaginatorOptions struct {
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListSupportedInstanceTypesPaginator is a paginator for
// ListSupportedInstanceTypes
type ListSupportedInstanceTypesPaginator struct {
options ListSupportedInstanceTypesPaginatorOptions
client ListSupportedInstanceTypesAPIClient
params *ListSupportedInstanceTypesInput
nextToken *string
firstPage bool
}
// NewListSupportedInstanceTypesPaginator returns a new
// ListSupportedInstanceTypesPaginator
func NewListSupportedInstanceTypesPaginator(client ListSupportedInstanceTypesAPIClient, params *ListSupportedInstanceTypesInput, optFns ...func(*ListSupportedInstanceTypesPaginatorOptions)) *ListSupportedInstanceTypesPaginator {
if params == nil {
params = &ListSupportedInstanceTypesInput{}
}
options := ListSupportedInstanceTypesPaginatorOptions{}
for _, fn := range optFns {
fn(&options)
}
return &ListSupportedInstanceTypesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSupportedInstanceTypesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSupportedInstanceTypes page.
func (p *ListSupportedInstanceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSupportedInstanceTypesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
result, err := p.client.ListSupportedInstanceTypes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.Marker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSupportedInstanceTypes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ListSupportedInstanceTypes",
}
}
| 222 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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"
)
// Modifies the number of steps that can be executed concurrently for the cluster
// specified using ClusterID.
func (c *Client) ModifyCluster(ctx context.Context, params *ModifyClusterInput, optFns ...func(*Options)) (*ModifyClusterOutput, error) {
if params == nil {
params = &ModifyClusterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ModifyCluster", params, optFns, c.addOperationModifyClusterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ModifyClusterOutput)
out.ResultMetadata = metadata
return out, nil
}
type ModifyClusterInput struct {
// The unique identifier of the cluster.
//
// This member is required.
ClusterId *string
// The number of steps that can be executed concurrently. You can specify a
// minimum of 1 step and a maximum of 256 steps. We recommend that you do not
// change this parameter while steps are running or the ActionOnFailure setting
// may not behave as expected. For more information see Step$ActionOnFailure .
StepConcurrencyLevel *int32
noSmithyDocumentSerde
}
type ModifyClusterOutput struct {
// The number of steps that can be executed concurrently.
StepConcurrencyLevel *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationModifyClusterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpModifyCluster{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpModifyCluster{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpModifyClusterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyCluster(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opModifyCluster(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ModifyCluster",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Modifies the target On-Demand and target Spot capacities for the instance fleet
// with the specified InstanceFleetID within the cluster specified using ClusterID.
// The call either succeeds or fails atomically. The instance fleet configuration
// is available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x
// versions.
func (c *Client) ModifyInstanceFleet(ctx context.Context, params *ModifyInstanceFleetInput, optFns ...func(*Options)) (*ModifyInstanceFleetOutput, error) {
if params == nil {
params = &ModifyInstanceFleetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceFleet", params, optFns, c.addOperationModifyInstanceFleetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ModifyInstanceFleetOutput)
out.ResultMetadata = metadata
return out, nil
}
type ModifyInstanceFleetInput struct {
// The unique identifier of the cluster.
//
// This member is required.
ClusterId *string
// The configuration parameters of the instance fleet.
//
// This member is required.
InstanceFleet *types.InstanceFleetModifyConfig
noSmithyDocumentSerde
}
type ModifyInstanceFleetOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationModifyInstanceFleetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpModifyInstanceFleet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpModifyInstanceFleet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpModifyInstanceFleetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceFleet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opModifyInstanceFleet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ModifyInstanceFleet",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// ModifyInstanceGroups modifies the number of nodes and configuration settings of
// an instance group. The input parameters include the new target instance count
// for the group and the instance group ID. The call will either succeed or fail
// atomically.
func (c *Client) ModifyInstanceGroups(ctx context.Context, params *ModifyInstanceGroupsInput, optFns ...func(*Options)) (*ModifyInstanceGroupsOutput, error) {
if params == nil {
params = &ModifyInstanceGroupsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ModifyInstanceGroups", params, optFns, c.addOperationModifyInstanceGroupsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ModifyInstanceGroupsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Change the size of some instance groups.
type ModifyInstanceGroupsInput struct {
// The ID of the cluster to which the instance group belongs.
ClusterId *string
// Instance groups to change.
InstanceGroups []types.InstanceGroupModifyConfig
noSmithyDocumentSerde
}
type ModifyInstanceGroupsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationModifyInstanceGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpModifyInstanceGroups{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpModifyInstanceGroups{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpModifyInstanceGroupsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyInstanceGroups(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opModifyInstanceGroups(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "ModifyInstanceGroups",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates or updates an automatic scaling policy for a core instance group or
// task instance group in an Amazon EMR cluster. The automatic scaling policy
// defines how an instance group dynamically adds and terminates Amazon EC2
// instances in response to the value of a CloudWatch metric.
func (c *Client) PutAutoScalingPolicy(ctx context.Context, params *PutAutoScalingPolicyInput, optFns ...func(*Options)) (*PutAutoScalingPolicyOutput, error) {
if params == nil {
params = &PutAutoScalingPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAutoScalingPolicy", params, optFns, c.addOperationPutAutoScalingPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAutoScalingPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutAutoScalingPolicyInput struct {
// Specifies the definition of the automatic scaling policy.
//
// This member is required.
AutoScalingPolicy *types.AutoScalingPolicy
// Specifies the ID of a cluster. The instance group to which the automatic
// scaling policy is applied is within this cluster.
//
// This member is required.
ClusterId *string
// Specifies the ID of the instance group to which the automatic scaling policy is
// applied.
//
// This member is required.
InstanceGroupId *string
noSmithyDocumentSerde
}
type PutAutoScalingPolicyOutput struct {
// The automatic scaling policy definition.
AutoScalingPolicy *types.AutoScalingPolicyDescription
// The Amazon Resource Name (ARN) of the cluster.
ClusterArn *string
// Specifies the ID of a cluster. The instance group to which the automatic
// scaling policy is applied is within this cluster.
ClusterId *string
// Specifies the ID of the instance group to which the scaling policy is applied.
InstanceGroupId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAutoScalingPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutAutoScalingPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutAutoScalingPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutAutoScalingPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAutoScalingPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutAutoScalingPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "PutAutoScalingPolicy",
}
}
| 150 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Auto-termination is supported in Amazon EMR releases 5.30.0 and 6.1.0 and
// later. For more information, see Using an auto-termination policy (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-auto-termination-policy.html)
// . Creates or updates an auto-termination policy for an Amazon EMR cluster. An
// auto-termination policy defines the amount of idle time in seconds after which a
// cluster automatically terminates. For alternative cluster termination options,
// see Control cluster termination (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-termination.html)
// .
func (c *Client) PutAutoTerminationPolicy(ctx context.Context, params *PutAutoTerminationPolicyInput, optFns ...func(*Options)) (*PutAutoTerminationPolicyOutput, error) {
if params == nil {
params = &PutAutoTerminationPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAutoTerminationPolicy", params, optFns, c.addOperationPutAutoTerminationPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAutoTerminationPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutAutoTerminationPolicyInput struct {
// Specifies the ID of the Amazon EMR cluster to which the auto-termination policy
// will be attached.
//
// This member is required.
ClusterId *string
// Specifies the auto-termination policy to attach to the cluster.
AutoTerminationPolicy *types.AutoTerminationPolicy
noSmithyDocumentSerde
}
type PutAutoTerminationPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAutoTerminationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutAutoTerminationPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutAutoTerminationPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutAutoTerminationPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAutoTerminationPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutAutoTerminationPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "PutAutoTerminationPolicy",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates or updates an Amazon EMR block public access configuration for your
// Amazon Web Services account in the current Region. For more information see
// Configure Block Public Access for Amazon EMR (https://docs.aws.amazon.com/emr/latest/ManagementGuide/configure-block-public-access.html)
// in the Amazon EMR Management Guide.
func (c *Client) PutBlockPublicAccessConfiguration(ctx context.Context, params *PutBlockPublicAccessConfigurationInput, optFns ...func(*Options)) (*PutBlockPublicAccessConfigurationOutput, error) {
if params == nil {
params = &PutBlockPublicAccessConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutBlockPublicAccessConfiguration", params, optFns, c.addOperationPutBlockPublicAccessConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutBlockPublicAccessConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutBlockPublicAccessConfigurationInput struct {
// A configuration for Amazon EMR block public access. The configuration applies
// to all clusters created in your account for the current Region. The
// configuration specifies whether block public access is enabled. If block public
// access is enabled, security groups associated with the cluster cannot have rules
// that allow inbound traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is
// specified as an exception using PermittedPublicSecurityGroupRuleRanges in the
// BlockPublicAccessConfiguration . By default, Port 22 (SSH) is an exception, and
// public access is allowed on this port. You can change this by updating
// BlockPublicSecurityGroupRules to remove the exception. For accounts that created
// clusters in a Region before November 25, 2019, block public access is disabled
// by default in that Region. To use this feature, you must manually enable and
// configure it. For accounts that did not create an Amazon EMR cluster in a Region
// before this date, block public access is enabled by default in that Region.
//
// This member is required.
BlockPublicAccessConfiguration *types.BlockPublicAccessConfiguration
noSmithyDocumentSerde
}
type PutBlockPublicAccessConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutBlockPublicAccessConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutBlockPublicAccessConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutBlockPublicAccessConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutBlockPublicAccessConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutBlockPublicAccessConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutBlockPublicAccessConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "PutBlockPublicAccessConfiguration",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates or updates a managed scaling policy for an Amazon EMR cluster. The
// managed scaling policy defines the limits for resources, such as Amazon EC2
// instances that can be added or terminated from a cluster. The policy only
// applies to the core and task nodes. The master node cannot be scaled after
// initial configuration.
func (c *Client) PutManagedScalingPolicy(ctx context.Context, params *PutManagedScalingPolicyInput, optFns ...func(*Options)) (*PutManagedScalingPolicyOutput, error) {
if params == nil {
params = &PutManagedScalingPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutManagedScalingPolicy", params, optFns, c.addOperationPutManagedScalingPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutManagedScalingPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutManagedScalingPolicyInput struct {
// Specifies the ID of an Amazon EMR cluster where the managed scaling policy is
// attached.
//
// This member is required.
ClusterId *string
// Specifies the constraints for the managed scaling policy.
//
// This member is required.
ManagedScalingPolicy *types.ManagedScalingPolicy
noSmithyDocumentSerde
}
type PutManagedScalingPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutManagedScalingPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutManagedScalingPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutManagedScalingPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutManagedScalingPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutManagedScalingPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutManagedScalingPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "PutManagedScalingPolicy",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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 an automatic scaling policy from a specified instance group within an
// Amazon EMR cluster.
func (c *Client) RemoveAutoScalingPolicy(ctx context.Context, params *RemoveAutoScalingPolicyInput, optFns ...func(*Options)) (*RemoveAutoScalingPolicyOutput, error) {
if params == nil {
params = &RemoveAutoScalingPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveAutoScalingPolicy", params, optFns, c.addOperationRemoveAutoScalingPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveAutoScalingPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type RemoveAutoScalingPolicyInput struct {
// Specifies the ID of a cluster. The instance group to which the automatic
// scaling policy is applied is within this cluster.
//
// This member is required.
ClusterId *string
// Specifies the ID of the instance group to which the scaling policy is applied.
//
// This member is required.
InstanceGroupId *string
noSmithyDocumentSerde
}
type RemoveAutoScalingPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveAutoScalingPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveAutoScalingPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveAutoScalingPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRemoveAutoScalingPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveAutoScalingPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRemoveAutoScalingPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "RemoveAutoScalingPolicy",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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 an auto-termination policy from an Amazon EMR cluster.
func (c *Client) RemoveAutoTerminationPolicy(ctx context.Context, params *RemoveAutoTerminationPolicyInput, optFns ...func(*Options)) (*RemoveAutoTerminationPolicyOutput, error) {
if params == nil {
params = &RemoveAutoTerminationPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveAutoTerminationPolicy", params, optFns, c.addOperationRemoveAutoTerminationPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveAutoTerminationPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type RemoveAutoTerminationPolicyInput struct {
// Specifies the ID of the Amazon EMR cluster from which the auto-termination
// policy will be removed.
//
// This member is required.
ClusterId *string
noSmithyDocumentSerde
}
type RemoveAutoTerminationPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveAutoTerminationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveAutoTerminationPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveAutoTerminationPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRemoveAutoTerminationPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveAutoTerminationPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRemoveAutoTerminationPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "RemoveAutoTerminationPolicy",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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 managed scaling policy from a specified Amazon EMR cluster.
func (c *Client) RemoveManagedScalingPolicy(ctx context.Context, params *RemoveManagedScalingPolicyInput, optFns ...func(*Options)) (*RemoveManagedScalingPolicyOutput, error) {
if params == nil {
params = &RemoveManagedScalingPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveManagedScalingPolicy", params, optFns, c.addOperationRemoveManagedScalingPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveManagedScalingPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type RemoveManagedScalingPolicyInput struct {
// Specifies the ID of the cluster from which the managed scaling policy will be
// removed.
//
// This member is required.
ClusterId *string
noSmithyDocumentSerde
}
type RemoveManagedScalingPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveManagedScalingPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveManagedScalingPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveManagedScalingPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRemoveManagedScalingPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveManagedScalingPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRemoveManagedScalingPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "RemoveManagedScalingPolicy",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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 an Amazon EMR resource, such as a cluster or Amazon EMR
// Studio. Tags make it easier to associate resources in various ways, such as
// grouping clusters to track your Amazon EMR resource allocation costs. For more
// information, see Tag Clusters (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags.html)
// . The following example removes the stack tag with value Prod from a cluster:
func (c *Client) RemoveTags(ctx context.Context, params *RemoveTagsInput, optFns ...func(*Options)) (*RemoveTagsOutput, error) {
if params == nil {
params = &RemoveTagsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveTags", params, optFns, c.addOperationRemoveTagsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveTagsOutput)
out.ResultMetadata = metadata
return out, nil
}
// This input identifies an Amazon EMR resource and a list of tags to remove.
type RemoveTagsInput struct {
// The Amazon EMR resource identifier from which tags will be removed. For
// example, a cluster identifier or an Amazon EMR Studio ID.
//
// This member is required.
ResourceId *string
// A list of tag keys to remove from the resource.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
// This output indicates the result of removing tags from the resource.
type RemoveTagsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveTagsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveTags{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveTags{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRemoveTagsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveTags(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRemoveTags(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "RemoveTags",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// RunJobFlow creates and starts running a new cluster (job flow). The cluster
// runs the steps specified. After the steps complete, the cluster stops and the
// HDFS partition is lost. To prevent loss of data, configure the last step of the
// job flow to store results in Amazon S3. If the JobFlowInstancesConfig
// KeepJobFlowAliveWhenNoSteps parameter is set to TRUE , the cluster transitions
// to the WAITING state rather than shutting down after the steps have completed.
// For additional protection, you can set the JobFlowInstancesConfig
// TerminationProtected parameter to TRUE to lock the cluster and prevent it from
// being terminated by API call, user intervention, or in the event of a job flow
// error. A maximum of 256 steps are allowed in each job flow. If your cluster is
// long-running (such as a Hive data warehouse) or complex, you may require more
// than 256 steps to process your data. You can bypass the 256-step limitation in
// various ways, including using the SSH shell to connect to the master node and
// submitting queries directly to the software running on the master node, such as
// Hive and Hadoop. For long-running clusters, we recommend that you periodically
// store your results. The instance fleets configuration is available only in
// Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions. The RunJobFlow
// request can contain InstanceFleets parameters or InstanceGroups parameters, but
// not both.
func (c *Client) RunJobFlow(ctx context.Context, params *RunJobFlowInput, optFns ...func(*Options)) (*RunJobFlowOutput, error) {
if params == nil {
params = &RunJobFlowInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RunJobFlow", params, optFns, c.addOperationRunJobFlowMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RunJobFlowOutput)
out.ResultMetadata = metadata
return out, nil
}
// Input to the RunJobFlow operation.
type RunJobFlowInput struct {
// A specification of the number and type of Amazon EC2 instances.
//
// This member is required.
Instances *types.JobFlowInstancesConfig
// The name of the job flow.
//
// This member is required.
Name *string
// A JSON string for selecting additional features.
AdditionalInfo *string
// Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases
// 4.0 and later, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID .
AmiVersion *string
// Applies to Amazon EMR releases 4.0 and later. A case-insensitive list of
// applications for Amazon EMR to install and configure when launching the cluster.
// For a list of applications available for each Amazon EMR release version, see
// the Amazon EMRRelease Guide (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/)
// .
Applications []types.Application
// An IAM role for automatic scaling policies. The default role is
// EMR_AutoScaling_DefaultRole . The IAM role provides permissions that the
// automatic scaling feature requires to launch and terminate Amazon EC2 instances
// in an instance group.
AutoScalingRole *string
// An auto-termination policy for an Amazon EMR cluster. An auto-termination
// policy defines the amount of idle time in seconds after which a cluster
// automatically terminates. For alternative cluster termination options, see
// Control cluster termination (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-termination.html)
// .
AutoTerminationPolicy *types.AutoTerminationPolicy
// A list of bootstrap actions to run before Hadoop starts on the cluster nodes.
BootstrapActions []types.BootstrapActionConfig
// For Amazon EMR releases 4.0 and later. The list of configurations supplied for
// the Amazon EMR cluster that you are creating.
Configurations []types.Configuration
// Available only in Amazon EMR releases 5.7.0 and later. The ID of a custom
// Amazon EBS-backed Linux AMI. If specified, Amazon EMR uses this AMI when it
// launches cluster Amazon EC2 instances. For more information about custom AMIs in
// Amazon EMR, see Using a Custom AMI (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-custom-ami.html)
// in the Amazon EMR Management Guide. If omitted, the cluster uses the base Linux
// AMI for the ReleaseLabel specified. For Amazon EMR releases 2.x and 3.x, use
// AmiVersion instead. For information about creating a custom AMI, see Creating
// an Amazon EBS-Backed Linux AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html)
// in the Amazon Elastic Compute Cloud User Guide for Linux Instances. For
// information about finding an AMI ID, see Finding a Linux AMI (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html)
// .
CustomAmiId *string
// The size, in GiB, of the Amazon EBS root device volume of the Linux AMI that is
// used for each Amazon EC2 instance. Available in Amazon EMR releases 4.x and
// later.
EbsRootVolumeSize *int32
// Also called instance profile and Amazon EC2 role. An IAM role for an Amazon EMR
// cluster. The Amazon EC2 instances of the cluster assume this role. The default
// role is EMR_EC2_DefaultRole . In order to use the default role, you must have
// already created it using the CLI or console.
JobFlowRole *string
// Attributes for Kerberos configuration when Kerberos authentication is enabled
// using a security configuration. For more information see Use Kerberos
// Authentication (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-kerberos.html)
// in the Amazon EMR Management Guide.
KerberosAttributes *types.KerberosAttributes
// The KMS key used for encrypting log files. If a value is not provided, the logs
// remain encrypted by AES-256. This attribute is only available with Amazon EMR
// releases 5.30.0 and later, excluding Amazon EMR 6.0.0.
LogEncryptionKmsKeyId *string
// The location in Amazon S3 to write the log files of the job flow. If a value is
// not provided, logs are not created.
LogUri *string
// The specified managed scaling policy for an Amazon EMR cluster.
ManagedScalingPolicy *types.ManagedScalingPolicy
// For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use
// Applications. A list of strings that indicates third-party software to use with
// the job flow that accepts a user argument list. Amazon EMR accepts and forwards
// the argument list to the corresponding installation script as bootstrap action
// arguments. For more information, see "Launch a Job Flow on the MapR Distribution
// for Hadoop" in the Amazon EMR Developer Guide (https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf)
// . Supported values are:
// - "mapr-m3" - launch the cluster using MapR M3 Edition.
// - "mapr-m5" - launch the cluster using MapR M5 Edition.
// - "mapr" with the user arguments specifying "--edition,m3" or "--edition,m5"
// - launch the job flow using MapR M3 or M5 Edition respectively.
// - "mapr-m7" - launch the cluster using MapR M7 Edition.
// - "hunk" - launch the cluster with the Hunk Big Data Analytics Platform.
// - "hue"- launch the cluster with Hue installed.
// - "spark" - launch the cluster with Apache Spark installed.
// - "ganglia" - launch the cluster with the Ganglia Monitoring System
// installed.
NewSupportedProducts []types.SupportedProductConfig
// Specifies a particular Amazon Linux release for all nodes in a cluster launch
// RunJobFlow request. If a release is not specified, Amazon EMR uses the latest
// validated Amazon Linux release for cluster launch.
OSReleaseLabel *string
// The specified placement group configuration for an Amazon EMR cluster.
PlacementGroupConfigs []types.PlacementGroupConfig
// The Amazon EMR release label, which determines the version of open-source
// application packages installed on the cluster. Release labels are in the form
// emr-x.x.x , where x.x.x is an Amazon EMR release version such as emr-5.14.0 .
// For more information about Amazon EMR release versions and included application
// versions and features, see https://docs.aws.amazon.com/emr/latest/ReleaseGuide/ (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/)
// . The release label applies only to Amazon EMR releases version 4.0 and later.
// Earlier versions use AmiVersion .
ReleaseLabel *string
// Applies only when CustomAmiID is used. Specifies which updates from the Amazon
// Linux AMI package repositories to apply automatically when the instance boots
// using the AMI. If omitted, the default is SECURITY , which indicates that only
// security updates are applied. If NONE is specified, no updates are applied, and
// all updates must be applied manually.
RepoUpgradeOnBoot types.RepoUpgradeOnBoot
// Specifies the way that individual Amazon EC2 instances terminate when an
// automatic scale-in activity occurs or an instance group is resized.
// TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the
// instance-hour boundary, regardless of when the request to terminate the instance
// was submitted. This option is only available with Amazon EMR 5.1.0 and later and
// is the default for clusters created using that version.
// TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list
// and drains tasks from nodes before terminating the Amazon EC2 instances,
// regardless of the instance-hour boundary. With either behavior, Amazon EMR
// removes the least active nodes first and blocks instance termination if it could
// lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION available only in Amazon
// EMR releases 4.1.0 and later, and is the default for releases of Amazon EMR
// earlier than 5.1.0.
ScaleDownBehavior types.ScaleDownBehavior
// The name of a security configuration to apply to the cluster.
SecurityConfiguration *string
// The IAM role that Amazon EMR assumes in order to access Amazon Web Services
// resources on your behalf. If you've created a custom service role path, you must
// specify it for the service role when you launch your cluster.
ServiceRole *string
// Specifies the number of steps that can be executed concurrently. The default
// value is 1 . The maximum value is 256 .
StepConcurrencyLevel *int32
// A list of steps to run.
Steps []types.StepConfig
// For Amazon EMR releases 3.x and 2.x. For Amazon EMR releases 4.x and later, use
// Applications. A list of strings that indicates third-party software to use. For
// more information, see the Amazon EMR Developer Guide (https://docs.aws.amazon.com/emr/latest/DeveloperGuide/emr-dg.pdf)
// . Currently supported values are:
// - "mapr-m3" - launch the job flow using MapR M3 Edition.
// - "mapr-m5" - launch the job flow using MapR M5 Edition.
SupportedProducts []string
// A list of tags to associate with a cluster and propagate to Amazon EC2
// instances.
Tags []types.Tag
// The VisibleToAllUsers parameter is no longer supported. By default, the value
// is set to true . Setting it to false now has no effect. Set this value to true
// so that IAM principals in the Amazon Web Services account associated with the
// cluster can perform Amazon EMR actions on the cluster that their IAM policies
// allow. This value defaults to true for clusters created using the Amazon EMR
// API or the CLI create-cluster (https://docs.aws.amazon.com/cli/latest/reference/emr/create-cluster.html)
// command. When set to false , only the IAM principal that created the cluster and
// the Amazon Web Services account root user can perform Amazon EMR actions for the
// cluster, regardless of the IAM permissions policies attached to other IAM
// principals. For more information, see Understanding the Amazon EMR cluster
// VisibleToAllUsers setting (https://docs.aws.amazon.com/emr/latest/ManagementGuide/security_IAM_emr-with-IAM.html#security_set_visible_to_all_users)
// in the Amazon EMR Management Guide.
VisibleToAllUsers bool
noSmithyDocumentSerde
}
// The result of the RunJobFlow operation.
type RunJobFlowOutput struct {
// The Amazon Resource Name (ARN) of the cluster.
ClusterArn *string
// A unique identifier for the job flow.
JobFlowId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRunJobFlowMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpRunJobFlow{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRunJobFlow{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRunJobFlowValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRunJobFlow(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opRunJobFlow(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "RunJobFlow",
}
}
| 328 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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"
)
// SetTerminationProtection locks a cluster (job flow) so the Amazon EC2 instances
// in the cluster cannot be terminated by user intervention, an API call, or in the
// event of a job-flow error. The cluster still terminates upon successful
// completion of the job flow. Calling SetTerminationProtection on a cluster is
// similar to calling the Amazon EC2 DisableAPITermination API on all Amazon EC2
// instances in a cluster. SetTerminationProtection is used to prevent accidental
// termination of a cluster and to ensure that in the event of an error, the
// instances persist so that you can recover any data stored in their ephemeral
// instance storage. To terminate a cluster that has been locked by setting
// SetTerminationProtection to true , you must first unlock the job flow by a
// subsequent call to SetTerminationProtection in which you set the value to false
// . For more information, see Managing Cluster Termination (https://docs.aws.amazon.com/emr/latest/ManagementGuide/UsingEMR_TerminationProtection.html)
// in the Amazon EMR Management Guide.
func (c *Client) SetTerminationProtection(ctx context.Context, params *SetTerminationProtectionInput, optFns ...func(*Options)) (*SetTerminationProtectionOutput, error) {
if params == nil {
params = &SetTerminationProtectionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SetTerminationProtection", params, optFns, c.addOperationSetTerminationProtectionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SetTerminationProtectionOutput)
out.ResultMetadata = metadata
return out, nil
}
// The input argument to the TerminationProtection operation.
type SetTerminationProtectionInput struct {
// A list of strings that uniquely identify the clusters to protect. This
// identifier is returned by RunJobFlow and can also be obtained from
// DescribeJobFlows .
//
// This member is required.
JobFlowIds []string
// A Boolean that indicates whether to protect the cluster and prevent the Amazon
// EC2 instances in the cluster from shutting down due to API calls, user
// intervention, or job-flow error.
//
// This member is required.
TerminationProtected bool
noSmithyDocumentSerde
}
type SetTerminationProtectionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSetTerminationProtectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSetTerminationProtection{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSetTerminationProtection{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSetTerminationProtectionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetTerminationProtection(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opSetTerminationProtection(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "SetTerminationProtection",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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"
)
// The SetVisibleToAllUsers parameter is no longer supported. Your cluster may be
// visible to all users in your account. To restrict cluster access using an IAM
// policy, see Identity and Access Management for Amazon EMR (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-access-IAM.html)
// . Sets the Cluster$VisibleToAllUsers value for an Amazon EMR cluster. When true
// , IAM principals in the Amazon Web Services account can perform Amazon EMR
// cluster actions that their IAM policies allow. When false , only the IAM
// principal that created the cluster and the Amazon Web Services account root user
// can perform Amazon EMR actions on the cluster, regardless of IAM permissions
// policies attached to other IAM principals. This action works on running
// clusters. When you create a cluster, use the RunJobFlowInput$VisibleToAllUsers
// parameter. For more information, see Understanding the Amazon EMR Cluster
// VisibleToAllUsers Setting (https://docs.aws.amazon.com/emr/latest/ManagementGuide/security_IAM_emr-with-IAM.html#security_set_visible_to_all_users)
// in the Amazon EMR Management Guide.
func (c *Client) SetVisibleToAllUsers(ctx context.Context, params *SetVisibleToAllUsersInput, optFns ...func(*Options)) (*SetVisibleToAllUsersOutput, error) {
if params == nil {
params = &SetVisibleToAllUsersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SetVisibleToAllUsers", params, optFns, c.addOperationSetVisibleToAllUsersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SetVisibleToAllUsersOutput)
out.ResultMetadata = metadata
return out, nil
}
// The input to the SetVisibleToAllUsers action.
type SetVisibleToAllUsersInput struct {
// The unique identifier of the job flow (cluster).
//
// This member is required.
JobFlowIds []string
// A value of true indicates that an IAM principal in the Amazon Web Services
// account can perform Amazon EMR actions on the cluster that the IAM policies
// attached to the principal allow. A value of false indicates that only the IAM
// principal that created the cluster and the Amazon Web Services root user can
// perform Amazon EMR actions on the cluster.
//
// This member is required.
VisibleToAllUsers bool
noSmithyDocumentSerde
}
type SetVisibleToAllUsersOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSetVisibleToAllUsersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpSetVisibleToAllUsers{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSetVisibleToAllUsers{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpSetVisibleToAllUsersValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSetVisibleToAllUsers(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opSetVisibleToAllUsers(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "SetVisibleToAllUsers",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts a notebook execution.
func (c *Client) StartNotebookExecution(ctx context.Context, params *StartNotebookExecutionInput, optFns ...func(*Options)) (*StartNotebookExecutionOutput, error) {
if params == nil {
params = &StartNotebookExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartNotebookExecution", params, optFns, c.addOperationStartNotebookExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartNotebookExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartNotebookExecutionInput struct {
// Specifies the execution engine (cluster) that runs the notebook execution.
//
// This member is required.
ExecutionEngine *types.ExecutionEngineConfig
// The name or ARN of the IAM role that is used as the service role for Amazon EMR
// (the Amazon EMR role) for the notebook execution.
//
// This member is required.
ServiceRole *string
// The unique identifier of the Amazon EMR Notebook to use for notebook execution.
EditorId *string
// The environment variables associated with the notebook execution.
EnvironmentVariables map[string]string
// An optional name for the notebook execution.
NotebookExecutionName *string
// The unique identifier of the Amazon EC2 security group to associate with the
// Amazon EMR Notebook for this notebook execution.
NotebookInstanceSecurityGroupId *string
// Input parameters in JSON format passed to the Amazon EMR Notebook at runtime
// for execution.
NotebookParams *string
// The Amazon S3 location for the notebook execution input.
NotebookS3Location *types.NotebookS3LocationFromInput
// The output format for the notebook execution.
OutputNotebookFormat types.OutputNotebookFormat
// The Amazon S3 location for the notebook execution output.
OutputNotebookS3Location *types.OutputNotebookS3LocationFromInput
// The path and file name of the notebook file for this execution, relative to the
// path specified for the Amazon EMR Notebook. For example, if you specify a path
// of s3://MyBucket/MyNotebooks when you create an Amazon EMR Notebook for a
// notebook with an ID of e-ABCDEFGHIJK1234567890ABCD (the EditorID of this
// request), and you specify a RelativePath of
// my_notebook_executions/notebook_execution.ipynb , the location of the file for
// the notebook execution is
// s3://MyBucket/MyNotebooks/e-ABCDEFGHIJK1234567890ABCD/my_notebook_executions/notebook_execution.ipynb
// .
RelativePath *string
// A list of tags associated with a notebook execution. Tags are user-defined
// key-value pairs that consist of a required key string with a maximum of 128
// characters and an optional value string with a maximum of 256 characters.
Tags []types.Tag
noSmithyDocumentSerde
}
type StartNotebookExecutionOutput struct {
// The unique identifier of the notebook execution.
NotebookExecutionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartNotebookExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartNotebookExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartNotebookExecution{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartNotebookExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartNotebookExecution(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStartNotebookExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "StartNotebookExecution",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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"
)
// Stops a notebook execution.
func (c *Client) StopNotebookExecution(ctx context.Context, params *StopNotebookExecutionInput, optFns ...func(*Options)) (*StopNotebookExecutionOutput, error) {
if params == nil {
params = &StopNotebookExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopNotebookExecution", params, optFns, c.addOperationStopNotebookExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopNotebookExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopNotebookExecutionInput struct {
// The unique identifier of the notebook execution.
//
// This member is required.
NotebookExecutionId *string
noSmithyDocumentSerde
}
type StopNotebookExecutionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopNotebookExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopNotebookExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopNotebookExecution{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopNotebookExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopNotebookExecution(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStopNotebookExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "StopNotebookExecution",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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"
)
// TerminateJobFlows shuts a list of clusters (job flows) down. When a job flow is
// shut down, any step not yet completed is canceled and the Amazon EC2 instances
// on which the cluster is running are stopped. Any log files not already saved are
// uploaded to Amazon S3 if a LogUri was specified when the cluster was created.
// The maximum number of clusters allowed is 10. The call to TerminateJobFlows is
// asynchronous. Depending on the configuration of the cluster, it may take up to
// 1-5 minutes for the cluster to completely terminate and release allocated
// resources, such as Amazon EC2 instances.
func (c *Client) TerminateJobFlows(ctx context.Context, params *TerminateJobFlowsInput, optFns ...func(*Options)) (*TerminateJobFlowsOutput, error) {
if params == nil {
params = &TerminateJobFlowsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TerminateJobFlows", params, optFns, c.addOperationTerminateJobFlowsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TerminateJobFlowsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Input to the TerminateJobFlows operation.
type TerminateJobFlowsInput struct {
// A list of job flows to be shut down.
//
// This member is required.
JobFlowIds []string
noSmithyDocumentSerde
}
type TerminateJobFlowsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTerminateJobFlowsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpTerminateJobFlows{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTerminateJobFlows{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTerminateJobFlowsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTerminateJobFlows(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opTerminateJobFlows(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "TerminateJobFlows",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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"
)
// Updates an Amazon EMR Studio configuration, including attributes such as name,
// description, and subnets.
func (c *Client) UpdateStudio(ctx context.Context, params *UpdateStudioInput, optFns ...func(*Options)) (*UpdateStudioOutput, error) {
if params == nil {
params = &UpdateStudioInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateStudio", params, optFns, c.addOperationUpdateStudioMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateStudioOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateStudioInput struct {
// The ID of the Amazon EMR Studio to update.
//
// This member is required.
StudioId *string
// The Amazon S3 location to back up Workspaces and notebook files for the Amazon
// EMR Studio.
DefaultS3Location *string
// A detailed description to assign to the Amazon EMR Studio.
Description *string
// A descriptive name for the Amazon EMR Studio.
Name *string
// A list of subnet IDs to associate with the Amazon EMR Studio. The list can
// include new subnet IDs, but must also include all of the subnet IDs previously
// associated with the Studio. The list order does not matter. A Studio can have a
// maximum of 5 subnets. The subnets must belong to the same VPC as the Studio.
SubnetIds []string
noSmithyDocumentSerde
}
type UpdateStudioOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateStudioMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateStudio{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateStudio{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateStudioValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateStudio(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateStudio(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "UpdateStudio",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the session policy attached to the user or group for the specified
// Amazon EMR Studio.
func (c *Client) UpdateStudioSessionMapping(ctx context.Context, params *UpdateStudioSessionMappingInput, optFns ...func(*Options)) (*UpdateStudioSessionMappingOutput, error) {
if params == nil {
params = &UpdateStudioSessionMappingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateStudioSessionMapping", params, optFns, c.addOperationUpdateStudioSessionMappingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateStudioSessionMappingOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateStudioSessionMappingInput struct {
// Specifies whether the identity to update is a user or a group.
//
// This member is required.
IdentityType types.IdentityType
// The Amazon Resource Name (ARN) of the session policy to associate with the
// specified user or group.
//
// This member is required.
SessionPolicyArn *string
// The ID of the Amazon EMR Studio.
//
// This member is required.
StudioId *string
// The globally unique identifier (GUID) of the user or group. For more
// information, see UserId (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserId)
// and GroupId (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-GroupId)
// in the IAM Identity Center Identity Store API Reference. Either IdentityName or
// IdentityId must be specified.
IdentityId *string
// The name of the user or group to update. For more information, see UserName (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserName)
// and DisplayName (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-DisplayName)
// in the IAM Identity Center Identity Store API Reference. Either IdentityName or
// IdentityId must be specified.
IdentityName *string
noSmithyDocumentSerde
}
type UpdateStudioSessionMappingOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateStudioSessionMappingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateStudioSessionMapping{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateStudioSessionMapping{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateStudioSessionMappingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateStudioSessionMapping(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opUpdateStudioSessionMapping(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "elasticmapreduce",
OperationName: "UpdateStudioSessionMapping",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/emr/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"
"math"
"strings"
)
type awsAwsjson11_deserializeOpAddInstanceFleet struct {
}
func (*awsAwsjson11_deserializeOpAddInstanceFleet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddInstanceFleet) 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_deserializeOpErrorAddInstanceFleet(response, &metadata)
}
output := &AddInstanceFleetOutput{}
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_deserializeOpDocumentAddInstanceFleetOutput(&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_deserializeOpErrorAddInstanceFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAddInstanceGroups struct {
}
func (*awsAwsjson11_deserializeOpAddInstanceGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddInstanceGroups) 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_deserializeOpErrorAddInstanceGroups(response, &metadata)
}
output := &AddInstanceGroupsOutput{}
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_deserializeOpDocumentAddInstanceGroupsOutput(&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_deserializeOpErrorAddInstanceGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAddJobFlowSteps struct {
}
func (*awsAwsjson11_deserializeOpAddJobFlowSteps) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddJobFlowSteps) 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_deserializeOpErrorAddJobFlowSteps(response, &metadata)
}
output := &AddJobFlowStepsOutput{}
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_deserializeOpDocumentAddJobFlowStepsOutput(&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_deserializeOpErrorAddJobFlowSteps(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpAddTags struct {
}
func (*awsAwsjson11_deserializeOpAddTags) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpAddTags) 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_deserializeOpErrorAddTags(response, &metadata)
}
output := &AddTagsOutput{}
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_deserializeOpDocumentAddTagsOutput(&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_deserializeOpErrorAddTags(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCancelSteps struct {
}
func (*awsAwsjson11_deserializeOpCancelSteps) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCancelSteps) 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_deserializeOpErrorCancelSteps(response, &metadata)
}
output := &CancelStepsOutput{}
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_deserializeOpDocumentCancelStepsOutput(&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_deserializeOpErrorCancelSteps(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateSecurityConfiguration struct {
}
func (*awsAwsjson11_deserializeOpCreateSecurityConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateSecurityConfiguration) 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_deserializeOpErrorCreateSecurityConfiguration(response, &metadata)
}
output := &CreateSecurityConfigurationOutput{}
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_deserializeOpDocumentCreateSecurityConfigurationOutput(&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_deserializeOpErrorCreateSecurityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateStudio struct {
}
func (*awsAwsjson11_deserializeOpCreateStudio) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateStudio) 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_deserializeOpErrorCreateStudio(response, &metadata)
}
output := &CreateStudioOutput{}
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_deserializeOpDocumentCreateStudioOutput(&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_deserializeOpErrorCreateStudio(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpCreateStudioSessionMapping struct {
}
func (*awsAwsjson11_deserializeOpCreateStudioSessionMapping) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateStudioSessionMapping) 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_deserializeOpErrorCreateStudioSessionMapping(response, &metadata)
}
output := &CreateStudioSessionMappingOutput{}
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_deserializeOpErrorCreateStudioSessionMapping(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteSecurityConfiguration struct {
}
func (*awsAwsjson11_deserializeOpDeleteSecurityConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteSecurityConfiguration) 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_deserializeOpErrorDeleteSecurityConfiguration(response, &metadata)
}
output := &DeleteSecurityConfigurationOutput{}
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_deserializeOpDocumentDeleteSecurityConfigurationOutput(&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_deserializeOpErrorDeleteSecurityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteStudio struct {
}
func (*awsAwsjson11_deserializeOpDeleteStudio) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteStudio) 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_deserializeOpErrorDeleteStudio(response, &metadata)
}
output := &DeleteStudioOutput{}
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_deserializeOpErrorDeleteStudio(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteStudioSessionMapping struct {
}
func (*awsAwsjson11_deserializeOpDeleteStudioSessionMapping) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteStudioSessionMapping) 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_deserializeOpErrorDeleteStudioSessionMapping(response, &metadata)
}
output := &DeleteStudioSessionMappingOutput{}
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_deserializeOpErrorDeleteStudioSessionMapping(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeCluster struct {
}
func (*awsAwsjson11_deserializeOpDescribeCluster) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeCluster) 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_deserializeOpErrorDescribeCluster(response, &metadata)
}
output := &DescribeClusterOutput{}
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_deserializeOpDocumentDescribeClusterOutput(&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_deserializeOpErrorDescribeCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeJobFlows struct {
}
func (*awsAwsjson11_deserializeOpDescribeJobFlows) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeJobFlows) 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_deserializeOpErrorDescribeJobFlows(response, &metadata)
}
output := &DescribeJobFlowsOutput{}
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_deserializeOpDocumentDescribeJobFlowsOutput(&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_deserializeOpErrorDescribeJobFlows(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeNotebookExecution struct {
}
func (*awsAwsjson11_deserializeOpDescribeNotebookExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeNotebookExecution) 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_deserializeOpErrorDescribeNotebookExecution(response, &metadata)
}
output := &DescribeNotebookExecutionOutput{}
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_deserializeOpDocumentDescribeNotebookExecutionOutput(&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_deserializeOpErrorDescribeNotebookExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeReleaseLabel struct {
}
func (*awsAwsjson11_deserializeOpDescribeReleaseLabel) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeReleaseLabel) 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_deserializeOpErrorDescribeReleaseLabel(response, &metadata)
}
output := &DescribeReleaseLabelOutput{}
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_deserializeOpDocumentDescribeReleaseLabelOutput(&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_deserializeOpErrorDescribeReleaseLabel(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeSecurityConfiguration struct {
}
func (*awsAwsjson11_deserializeOpDescribeSecurityConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeSecurityConfiguration) 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_deserializeOpErrorDescribeSecurityConfiguration(response, &metadata)
}
output := &DescribeSecurityConfigurationOutput{}
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_deserializeOpDocumentDescribeSecurityConfigurationOutput(&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_deserializeOpErrorDescribeSecurityConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeStep struct {
}
func (*awsAwsjson11_deserializeOpDescribeStep) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeStep) 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_deserializeOpErrorDescribeStep(response, &metadata)
}
output := &DescribeStepOutput{}
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_deserializeOpDocumentDescribeStepOutput(&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_deserializeOpErrorDescribeStep(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeStudio struct {
}
func (*awsAwsjson11_deserializeOpDescribeStudio) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeStudio) 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_deserializeOpErrorDescribeStudio(response, &metadata)
}
output := &DescribeStudioOutput{}
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_deserializeOpDocumentDescribeStudioOutput(&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_deserializeOpErrorDescribeStudio(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetAutoTerminationPolicy struct {
}
func (*awsAwsjson11_deserializeOpGetAutoTerminationPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetAutoTerminationPolicy) 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_deserializeOpErrorGetAutoTerminationPolicy(response, &metadata)
}
output := &GetAutoTerminationPolicyOutput{}
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_deserializeOpDocumentGetAutoTerminationPolicyOutput(&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_deserializeOpErrorGetAutoTerminationPolicy(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_deserializeOpGetBlockPublicAccessConfiguration struct {
}
func (*awsAwsjson11_deserializeOpGetBlockPublicAccessConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetBlockPublicAccessConfiguration) 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_deserializeOpErrorGetBlockPublicAccessConfiguration(response, &metadata)
}
output := &GetBlockPublicAccessConfigurationOutput{}
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_deserializeOpDocumentGetBlockPublicAccessConfigurationOutput(&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_deserializeOpErrorGetBlockPublicAccessConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetClusterSessionCredentials struct {
}
func (*awsAwsjson11_deserializeOpGetClusterSessionCredentials) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetClusterSessionCredentials) 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_deserializeOpErrorGetClusterSessionCredentials(response, &metadata)
}
output := &GetClusterSessionCredentialsOutput{}
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_deserializeOpDocumentGetClusterSessionCredentialsOutput(&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_deserializeOpErrorGetClusterSessionCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetManagedScalingPolicy struct {
}
func (*awsAwsjson11_deserializeOpGetManagedScalingPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetManagedScalingPolicy) 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_deserializeOpErrorGetManagedScalingPolicy(response, &metadata)
}
output := &GetManagedScalingPolicyOutput{}
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_deserializeOpDocumentGetManagedScalingPolicyOutput(&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_deserializeOpErrorGetManagedScalingPolicy(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_deserializeOpGetStudioSessionMapping struct {
}
func (*awsAwsjson11_deserializeOpGetStudioSessionMapping) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetStudioSessionMapping) 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_deserializeOpErrorGetStudioSessionMapping(response, &metadata)
}
output := &GetStudioSessionMappingOutput{}
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_deserializeOpDocumentGetStudioSessionMappingOutput(&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_deserializeOpErrorGetStudioSessionMapping(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListBootstrapActions struct {
}
func (*awsAwsjson11_deserializeOpListBootstrapActions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListBootstrapActions) 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_deserializeOpErrorListBootstrapActions(response, &metadata)
}
output := &ListBootstrapActionsOutput{}
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_deserializeOpDocumentListBootstrapActionsOutput(&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_deserializeOpErrorListBootstrapActions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListClusters struct {
}
func (*awsAwsjson11_deserializeOpListClusters) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListClusters) 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_deserializeOpErrorListClusters(response, &metadata)
}
output := &ListClustersOutput{}
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_deserializeOpDocumentListClustersOutput(&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_deserializeOpErrorListClusters(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListInstanceFleets struct {
}
func (*awsAwsjson11_deserializeOpListInstanceFleets) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListInstanceFleets) 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_deserializeOpErrorListInstanceFleets(response, &metadata)
}
output := &ListInstanceFleetsOutput{}
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_deserializeOpDocumentListInstanceFleetsOutput(&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_deserializeOpErrorListInstanceFleets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListInstanceGroups struct {
}
func (*awsAwsjson11_deserializeOpListInstanceGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListInstanceGroups) 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_deserializeOpErrorListInstanceGroups(response, &metadata)
}
output := &ListInstanceGroupsOutput{}
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_deserializeOpDocumentListInstanceGroupsOutput(&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_deserializeOpErrorListInstanceGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListInstances struct {
}
func (*awsAwsjson11_deserializeOpListInstances) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListInstances) 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_deserializeOpErrorListInstances(response, &metadata)
}
output := &ListInstancesOutput{}
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_deserializeOpDocumentListInstancesOutput(&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_deserializeOpErrorListInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListNotebookExecutions struct {
}
func (*awsAwsjson11_deserializeOpListNotebookExecutions) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListNotebookExecutions) 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_deserializeOpErrorListNotebookExecutions(response, &metadata)
}
output := &ListNotebookExecutionsOutput{}
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_deserializeOpDocumentListNotebookExecutionsOutput(&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_deserializeOpErrorListNotebookExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListReleaseLabels struct {
}
func (*awsAwsjson11_deserializeOpListReleaseLabels) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListReleaseLabels) 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_deserializeOpErrorListReleaseLabels(response, &metadata)
}
output := &ListReleaseLabelsOutput{}
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_deserializeOpDocumentListReleaseLabelsOutput(&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_deserializeOpErrorListReleaseLabels(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListSecurityConfigurations struct {
}
func (*awsAwsjson11_deserializeOpListSecurityConfigurations) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListSecurityConfigurations) 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_deserializeOpErrorListSecurityConfigurations(response, &metadata)
}
output := &ListSecurityConfigurationsOutput{}
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_deserializeOpDocumentListSecurityConfigurationsOutput(&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_deserializeOpErrorListSecurityConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListSteps struct {
}
func (*awsAwsjson11_deserializeOpListSteps) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListSteps) 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_deserializeOpErrorListSteps(response, &metadata)
}
output := &ListStepsOutput{}
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_deserializeOpDocumentListStepsOutput(&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_deserializeOpErrorListSteps(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListStudios struct {
}
func (*awsAwsjson11_deserializeOpListStudios) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListStudios) 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_deserializeOpErrorListStudios(response, &metadata)
}
output := &ListStudiosOutput{}
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_deserializeOpDocumentListStudiosOutput(&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_deserializeOpErrorListStudios(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListStudioSessionMappings struct {
}
func (*awsAwsjson11_deserializeOpListStudioSessionMappings) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListStudioSessionMappings) 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_deserializeOpErrorListStudioSessionMappings(response, &metadata)
}
output := &ListStudioSessionMappingsOutput{}
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_deserializeOpDocumentListStudioSessionMappingsOutput(&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_deserializeOpErrorListStudioSessionMappings(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListSupportedInstanceTypes struct {
}
func (*awsAwsjson11_deserializeOpListSupportedInstanceTypes) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListSupportedInstanceTypes) 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_deserializeOpErrorListSupportedInstanceTypes(response, &metadata)
}
output := &ListSupportedInstanceTypesOutput{}
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_deserializeOpDocumentListSupportedInstanceTypesOutput(&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_deserializeOpErrorListSupportedInstanceTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpModifyCluster struct {
}
func (*awsAwsjson11_deserializeOpModifyCluster) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpModifyCluster) 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_deserializeOpErrorModifyCluster(response, &metadata)
}
output := &ModifyClusterOutput{}
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_deserializeOpDocumentModifyClusterOutput(&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_deserializeOpErrorModifyCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpModifyInstanceFleet struct {
}
func (*awsAwsjson11_deserializeOpModifyInstanceFleet) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpModifyInstanceFleet) 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_deserializeOpErrorModifyInstanceFleet(response, &metadata)
}
output := &ModifyInstanceFleetOutput{}
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_deserializeOpErrorModifyInstanceFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpModifyInstanceGroups struct {
}
func (*awsAwsjson11_deserializeOpModifyInstanceGroups) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpModifyInstanceGroups) 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_deserializeOpErrorModifyInstanceGroups(response, &metadata)
}
output := &ModifyInstanceGroupsOutput{}
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_deserializeOpErrorModifyInstanceGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutAutoScalingPolicy struct {
}
func (*awsAwsjson11_deserializeOpPutAutoScalingPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutAutoScalingPolicy) 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_deserializeOpErrorPutAutoScalingPolicy(response, &metadata)
}
output := &PutAutoScalingPolicyOutput{}
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_deserializeOpDocumentPutAutoScalingPolicyOutput(&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_deserializeOpErrorPutAutoScalingPolicy(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_deserializeOpPutAutoTerminationPolicy struct {
}
func (*awsAwsjson11_deserializeOpPutAutoTerminationPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutAutoTerminationPolicy) 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_deserializeOpErrorPutAutoTerminationPolicy(response, &metadata)
}
output := &PutAutoTerminationPolicyOutput{}
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_deserializeOpDocumentPutAutoTerminationPolicyOutput(&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_deserializeOpErrorPutAutoTerminationPolicy(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_deserializeOpPutBlockPublicAccessConfiguration struct {
}
func (*awsAwsjson11_deserializeOpPutBlockPublicAccessConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutBlockPublicAccessConfiguration) 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_deserializeOpErrorPutBlockPublicAccessConfiguration(response, &metadata)
}
output := &PutBlockPublicAccessConfigurationOutput{}
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_deserializeOpDocumentPutBlockPublicAccessConfigurationOutput(&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_deserializeOpErrorPutBlockPublicAccessConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutManagedScalingPolicy struct {
}
func (*awsAwsjson11_deserializeOpPutManagedScalingPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutManagedScalingPolicy) 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_deserializeOpErrorPutManagedScalingPolicy(response, &metadata)
}
output := &PutManagedScalingPolicyOutput{}
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_deserializeOpDocumentPutManagedScalingPolicyOutput(&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_deserializeOpErrorPutManagedScalingPolicy(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_deserializeOpRemoveAutoScalingPolicy struct {
}
func (*awsAwsjson11_deserializeOpRemoveAutoScalingPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRemoveAutoScalingPolicy) 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_deserializeOpErrorRemoveAutoScalingPolicy(response, &metadata)
}
output := &RemoveAutoScalingPolicyOutput{}
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_deserializeOpDocumentRemoveAutoScalingPolicyOutput(&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_deserializeOpErrorRemoveAutoScalingPolicy(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_deserializeOpRemoveAutoTerminationPolicy struct {
}
func (*awsAwsjson11_deserializeOpRemoveAutoTerminationPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRemoveAutoTerminationPolicy) 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_deserializeOpErrorRemoveAutoTerminationPolicy(response, &metadata)
}
output := &RemoveAutoTerminationPolicyOutput{}
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_deserializeOpDocumentRemoveAutoTerminationPolicyOutput(&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_deserializeOpErrorRemoveAutoTerminationPolicy(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_deserializeOpRemoveManagedScalingPolicy struct {
}
func (*awsAwsjson11_deserializeOpRemoveManagedScalingPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRemoveManagedScalingPolicy) 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_deserializeOpErrorRemoveManagedScalingPolicy(response, &metadata)
}
output := &RemoveManagedScalingPolicyOutput{}
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_deserializeOpDocumentRemoveManagedScalingPolicyOutput(&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_deserializeOpErrorRemoveManagedScalingPolicy(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_deserializeOpRemoveTags struct {
}
func (*awsAwsjson11_deserializeOpRemoveTags) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRemoveTags) 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_deserializeOpErrorRemoveTags(response, &metadata)
}
output := &RemoveTagsOutput{}
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_deserializeOpDocumentRemoveTagsOutput(&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_deserializeOpErrorRemoveTags(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpRunJobFlow struct {
}
func (*awsAwsjson11_deserializeOpRunJobFlow) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpRunJobFlow) 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_deserializeOpErrorRunJobFlow(response, &metadata)
}
output := &RunJobFlowOutput{}
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_deserializeOpDocumentRunJobFlowOutput(&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_deserializeOpErrorRunJobFlow(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSetTerminationProtection struct {
}
func (*awsAwsjson11_deserializeOpSetTerminationProtection) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSetTerminationProtection) 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_deserializeOpErrorSetTerminationProtection(response, &metadata)
}
output := &SetTerminationProtectionOutput{}
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_deserializeOpErrorSetTerminationProtection(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpSetVisibleToAllUsers struct {
}
func (*awsAwsjson11_deserializeOpSetVisibleToAllUsers) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpSetVisibleToAllUsers) 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_deserializeOpErrorSetVisibleToAllUsers(response, &metadata)
}
output := &SetVisibleToAllUsersOutput{}
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_deserializeOpErrorSetVisibleToAllUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStartNotebookExecution struct {
}
func (*awsAwsjson11_deserializeOpStartNotebookExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStartNotebookExecution) 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_deserializeOpErrorStartNotebookExecution(response, &metadata)
}
output := &StartNotebookExecutionOutput{}
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_deserializeOpDocumentStartNotebookExecutionOutput(&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_deserializeOpErrorStartNotebookExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStopNotebookExecution struct {
}
func (*awsAwsjson11_deserializeOpStopNotebookExecution) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStopNotebookExecution) 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_deserializeOpErrorStopNotebookExecution(response, &metadata)
}
output := &StopNotebookExecutionOutput{}
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_deserializeOpErrorStopNotebookExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTerminateJobFlows struct {
}
func (*awsAwsjson11_deserializeOpTerminateJobFlows) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpTerminateJobFlows) 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_deserializeOpErrorTerminateJobFlows(response, &metadata)
}
output := &TerminateJobFlowsOutput{}
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_deserializeOpErrorTerminateJobFlows(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateStudio struct {
}
func (*awsAwsjson11_deserializeOpUpdateStudio) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateStudio) 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_deserializeOpErrorUpdateStudio(response, &metadata)
}
output := &UpdateStudioOutput{}
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_deserializeOpErrorUpdateStudio(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUpdateStudioSessionMapping struct {
}
func (*awsAwsjson11_deserializeOpUpdateStudioSessionMapping) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUpdateStudioSessionMapping) 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_deserializeOpErrorUpdateStudioSessionMapping(response, &metadata)
}
output := &UpdateStudioSessionMappingOutput{}
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_deserializeOpErrorUpdateStudioSessionMapping(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("InvalidRequestException", errorCode):
return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorInternalServerError(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.InternalServerError{}
err := awsAwsjson11_deserializeDocumentInternalServerError(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorInternalServerException(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.InternalServerException{}
err := awsAwsjson11_deserializeDocumentInternalServerException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.InvalidRequestException{}
err := awsAwsjson11_deserializeDocumentInvalidRequestException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_deserializeDocumentApplication(v **types.Application, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Application
if *v == nil {
sv = &types.Application{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AdditionalInfo":
if err := awsAwsjson11_deserializeDocumentStringMap(&sv.AdditionalInfo, value); err != nil {
return err
}
case "Args":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.Args, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentApplicationList(v *[]types.Application, 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.Application
if *v == nil {
cv = []types.Application{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Application
destAddr := &col
if err := awsAwsjson11_deserializeDocumentApplication(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAutoScalingPolicyDescription(v **types.AutoScalingPolicyDescription, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AutoScalingPolicyDescription
if *v == nil {
sv = &types.AutoScalingPolicyDescription{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Constraints":
if err := awsAwsjson11_deserializeDocumentScalingConstraints(&sv.Constraints, value); err != nil {
return err
}
case "Rules":
if err := awsAwsjson11_deserializeDocumentScalingRuleList(&sv.Rules, value); err != nil {
return err
}
case "Status":
if err := awsAwsjson11_deserializeDocumentAutoScalingPolicyStatus(&sv.Status, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAutoScalingPolicyStateChangeReason(v **types.AutoScalingPolicyStateChangeReason, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AutoScalingPolicyStateChangeReason
if *v == nil {
sv = &types.AutoScalingPolicyStateChangeReason{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AutoScalingPolicyStateChangeReasonCode to be of type string, got %T instead", value)
}
sv.Code = types.AutoScalingPolicyStateChangeReasonCode(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAutoScalingPolicyStatus(v **types.AutoScalingPolicyStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AutoScalingPolicyStatus
if *v == nil {
sv = &types.AutoScalingPolicyStatus{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "State":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AutoScalingPolicyState to be of type string, got %T instead", value)
}
sv.State = types.AutoScalingPolicyState(jtv)
}
case "StateChangeReason":
if err := awsAwsjson11_deserializeDocumentAutoScalingPolicyStateChangeReason(&sv.StateChangeReason, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentAutoTerminationPolicy(v **types.AutoTerminationPolicy, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AutoTerminationPolicy
if *v == nil {
sv = &types.AutoTerminationPolicy{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IdleTimeout":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.IdleTimeout = i64
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBlockPublicAccessConfiguration(v **types.BlockPublicAccessConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BlockPublicAccessConfiguration
if *v == nil {
sv = &types.BlockPublicAccessConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BlockPublicSecurityGroupRules":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.BlockPublicSecurityGroupRules = jtv
}
case "Classification":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Classification = ptr.String(jtv)
}
case "Configurations":
if err := awsAwsjson11_deserializeDocumentConfigurationList(&sv.Configurations, value); err != nil {
return err
}
case "PermittedPublicSecurityGroupRuleRanges":
if err := awsAwsjson11_deserializeDocumentPortRanges(&sv.PermittedPublicSecurityGroupRuleRanges, value); err != nil {
return err
}
case "Properties":
if err := awsAwsjson11_deserializeDocumentStringMap(&sv.Properties, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBlockPublicAccessConfigurationMetadata(v **types.BlockPublicAccessConfigurationMetadata, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BlockPublicAccessConfigurationMetadata
if *v == nil {
sv = &types.BlockPublicAccessConfigurationMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreatedByArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ArnType to be of type string, got %T instead", value)
}
sv.CreatedByArn = ptr.String(jtv)
}
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBootstrapActionConfig(v **types.BootstrapActionConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BootstrapActionConfig
if *v == nil {
sv = &types.BootstrapActionConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "ScriptBootstrapAction":
if err := awsAwsjson11_deserializeDocumentScriptBootstrapActionConfig(&sv.ScriptBootstrapAction, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBootstrapActionDetail(v **types.BootstrapActionDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BootstrapActionDetail
if *v == nil {
sv = &types.BootstrapActionDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BootstrapActionConfig":
if err := awsAwsjson11_deserializeDocumentBootstrapActionConfig(&sv.BootstrapActionConfig, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentBootstrapActionDetailList(v *[]types.BootstrapActionDetail, 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.BootstrapActionDetail
if *v == nil {
cv = []types.BootstrapActionDetail{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BootstrapActionDetail
destAddr := &col
if err := awsAwsjson11_deserializeDocumentBootstrapActionDetail(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCancelStepsInfo(v **types.CancelStepsInfo, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CancelStepsInfo
if *v == nil {
sv = &types.CancelStepsInfo{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CancelStepsRequestStatus to be of type string, got %T instead", value)
}
sv.Status = types.CancelStepsRequestStatus(jtv)
}
case "StepId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StepId to be of type string, got %T instead", value)
}
sv.StepId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCancelStepsInfoList(v *[]types.CancelStepsInfo, 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.CancelStepsInfo
if *v == nil {
cv = []types.CancelStepsInfo{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CancelStepsInfo
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCancelStepsInfo(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCloudWatchAlarmDefinition(v **types.CloudWatchAlarmDefinition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CloudWatchAlarmDefinition
if *v == nil {
sv = &types.CloudWatchAlarmDefinition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ComparisonOperator":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComparisonOperator to be of type string, got %T instead", value)
}
sv.ComparisonOperator = types.ComparisonOperator(jtv)
}
case "Dimensions":
if err := awsAwsjson11_deserializeDocumentMetricDimensionList(&sv.Dimensions, value); err != nil {
return err
}
case "EvaluationPeriods":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.EvaluationPeriods = ptr.Int32(int32(i64))
}
case "MetricName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.MetricName = ptr.String(jtv)
}
case "Namespace":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Namespace = ptr.String(jtv)
}
case "Period":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Period = ptr.Int32(int32(i64))
}
case "Statistic":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Statistic to be of type string, got %T instead", value)
}
sv.Statistic = types.Statistic(jtv)
}
case "Threshold":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Threshold = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.Threshold = ptr.Float64(f64)
default:
return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value)
}
}
case "Unit":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Unit to be of type string, got %T instead", value)
}
sv.Unit = types.Unit(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCluster(v **types.Cluster, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Cluster
if *v == nil {
sv = &types.Cluster{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Applications":
if err := awsAwsjson11_deserializeDocumentApplicationList(&sv.Applications, value); err != nil {
return err
}
case "AutoScalingRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.AutoScalingRole = ptr.String(jtv)
}
case "AutoTerminate":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.AutoTerminate = jtv
}
case "ClusterArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ArnType to be of type string, got %T instead", value)
}
sv.ClusterArn = ptr.String(jtv)
}
case "Configurations":
if err := awsAwsjson11_deserializeDocumentConfigurationList(&sv.Configurations, value); err != nil {
return err
}
case "CustomAmiId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.CustomAmiId = ptr.String(jtv)
}
case "EbsRootVolumeSize":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.EbsRootVolumeSize = ptr.Int32(int32(i64))
}
case "Ec2InstanceAttributes":
if err := awsAwsjson11_deserializeDocumentEc2InstanceAttributes(&sv.Ec2InstanceAttributes, value); err != nil {
return err
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClusterId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "InstanceCollectionType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceCollectionType to be of type string, got %T instead", value)
}
sv.InstanceCollectionType = types.InstanceCollectionType(jtv)
}
case "KerberosAttributes":
if err := awsAwsjson11_deserializeDocumentKerberosAttributes(&sv.KerberosAttributes, value); err != nil {
return err
}
case "LogEncryptionKmsKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LogEncryptionKmsKeyId = ptr.String(jtv)
}
case "LogUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LogUri = ptr.String(jtv)
}
case "MasterPublicDnsName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.MasterPublicDnsName = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "NormalizedInstanceHours":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.NormalizedInstanceHours = ptr.Int32(int32(i64))
}
case "OSReleaseLabel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.OSReleaseLabel = ptr.String(jtv)
}
case "OutpostArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OptionalArnType to be of type string, got %T instead", value)
}
sv.OutpostArn = ptr.String(jtv)
}
case "PlacementGroups":
if err := awsAwsjson11_deserializeDocumentPlacementGroupConfigList(&sv.PlacementGroups, value); err != nil {
return err
}
case "ReleaseLabel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ReleaseLabel = ptr.String(jtv)
}
case "RepoUpgradeOnBoot":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RepoUpgradeOnBoot to be of type string, got %T instead", value)
}
sv.RepoUpgradeOnBoot = types.RepoUpgradeOnBoot(jtv)
}
case "RequestedAmiVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RequestedAmiVersion = ptr.String(jtv)
}
case "RunningAmiVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RunningAmiVersion = ptr.String(jtv)
}
case "ScaleDownBehavior":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ScaleDownBehavior to be of type string, got %T instead", value)
}
sv.ScaleDownBehavior = types.ScaleDownBehavior(jtv)
}
case "SecurityConfiguration":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.SecurityConfiguration = ptr.String(jtv)
}
case "ServiceRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ServiceRole = ptr.String(jtv)
}
case "Status":
if err := awsAwsjson11_deserializeDocumentClusterStatus(&sv.Status, value); err != nil {
return err
}
case "StepConcurrencyLevel":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.StepConcurrencyLevel = ptr.Int32(int32(i64))
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
case "TerminationProtected":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.TerminationProtected = jtv
}
case "VisibleToAllUsers":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.VisibleToAllUsers = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentClusterStateChangeReason(v **types.ClusterStateChangeReason, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ClusterStateChangeReason
if *v == nil {
sv = &types.ClusterStateChangeReason{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClusterStateChangeReasonCode to be of type string, got %T instead", value)
}
sv.Code = types.ClusterStateChangeReasonCode(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentClusterStatus(v **types.ClusterStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ClusterStatus
if *v == nil {
sv = &types.ClusterStatus{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ErrorDetails":
if err := awsAwsjson11_deserializeDocumentErrorDetailList(&sv.ErrorDetails, value); err != nil {
return err
}
case "State":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClusterState to be of type string, got %T instead", value)
}
sv.State = types.ClusterState(jtv)
}
case "StateChangeReason":
if err := awsAwsjson11_deserializeDocumentClusterStateChangeReason(&sv.StateChangeReason, value); err != nil {
return err
}
case "Timeline":
if err := awsAwsjson11_deserializeDocumentClusterTimeline(&sv.Timeline, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentClusterSummary(v **types.ClusterSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ClusterSummary
if *v == nil {
sv = &types.ClusterSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ClusterArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ArnType to be of type string, got %T instead", value)
}
sv.ClusterArn = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClusterId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "NormalizedInstanceHours":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.NormalizedInstanceHours = ptr.Int32(int32(i64))
}
case "OutpostArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OptionalArnType to be of type string, got %T instead", value)
}
sv.OutpostArn = ptr.String(jtv)
}
case "Status":
if err := awsAwsjson11_deserializeDocumentClusterStatus(&sv.Status, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentClusterSummaryList(v *[]types.ClusterSummary, 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.ClusterSummary
if *v == nil {
cv = []types.ClusterSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ClusterSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentClusterSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentClusterTimeline(v **types.ClusterTimeline, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ClusterTimeline
if *v == nil {
sv = &types.ClusterTimeline{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "EndDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "ReadyDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ReadyDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCommand(v **types.Command, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Command
if *v == nil {
sv = &types.Command{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Args":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.Args, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "ScriptPath":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ScriptPath = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentCommandList(v *[]types.Command, 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.Command
if *v == nil {
cv = []types.Command{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Command
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCommand(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentComputeLimits(v **types.ComputeLimits, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ComputeLimits
if *v == nil {
sv = &types.ComputeLimits{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MaximumCapacityUnits":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaximumCapacityUnits = ptr.Int32(int32(i64))
}
case "MaximumCoreCapacityUnits":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaximumCoreCapacityUnits = ptr.Int32(int32(i64))
}
case "MaximumOnDemandCapacityUnits":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaximumOnDemandCapacityUnits = ptr.Int32(int32(i64))
}
case "MinimumCapacityUnits":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MinimumCapacityUnits = ptr.Int32(int32(i64))
}
case "UnitType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ComputeLimitsUnitType to be of type string, got %T instead", value)
}
sv.UnitType = types.ComputeLimitsUnitType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentConfiguration(v **types.Configuration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Configuration
if *v == nil {
sv = &types.Configuration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Classification":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Classification = ptr.String(jtv)
}
case "Configurations":
if err := awsAwsjson11_deserializeDocumentConfigurationList(&sv.Configurations, value); err != nil {
return err
}
case "Properties":
if err := awsAwsjson11_deserializeDocumentStringMap(&sv.Properties, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentConfigurationList(v *[]types.Configuration, 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.Configuration
if *v == nil {
cv = []types.Configuration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Configuration
destAddr := &col
if err := awsAwsjson11_deserializeDocumentConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCredentials(v *types.Credentials, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var uv types.Credentials
loop:
for key, value := range shape {
if value == nil {
continue
}
switch key {
case "UsernamePassword":
var mv types.UsernamePassword
destAddr := &mv
if err := awsAwsjson11_deserializeDocumentUsernamePassword(&destAddr, value); err != nil {
return err
}
mv = *destAddr
uv = &types.CredentialsMemberUsernamePassword{Value: mv}
break loop
default:
uv = &types.UnknownUnionMember{Tag: key}
break loop
}
}
*v = uv
return nil
}
func awsAwsjson11_deserializeDocumentEbsBlockDevice(v **types.EbsBlockDevice, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EbsBlockDevice
if *v == nil {
sv = &types.EbsBlockDevice{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Device":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Device = ptr.String(jtv)
}
case "VolumeSpecification":
if err := awsAwsjson11_deserializeDocumentVolumeSpecification(&sv.VolumeSpecification, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEbsBlockDeviceList(v *[]types.EbsBlockDevice, 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.EbsBlockDevice
if *v == nil {
cv = []types.EbsBlockDevice{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EbsBlockDevice
destAddr := &col
if err := awsAwsjson11_deserializeDocumentEbsBlockDevice(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentEbsVolume(v **types.EbsVolume, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EbsVolume
if *v == nil {
sv = &types.EbsVolume{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Device":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Device = ptr.String(jtv)
}
case "VolumeId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.VolumeId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEbsVolumeList(v *[]types.EbsVolume, 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.EbsVolume
if *v == nil {
cv = []types.EbsVolume{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EbsVolume
destAddr := &col
if err := awsAwsjson11_deserializeDocumentEbsVolume(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentEc2InstanceAttributes(v **types.Ec2InstanceAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Ec2InstanceAttributes
if *v == nil {
sv = &types.Ec2InstanceAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AdditionalMasterSecurityGroups":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.AdditionalMasterSecurityGroups, value); err != nil {
return err
}
case "AdditionalSlaveSecurityGroups":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.AdditionalSlaveSecurityGroups, value); err != nil {
return err
}
case "Ec2AvailabilityZone":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Ec2AvailabilityZone = ptr.String(jtv)
}
case "Ec2KeyName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Ec2KeyName = ptr.String(jtv)
}
case "Ec2SubnetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Ec2SubnetId = ptr.String(jtv)
}
case "EmrManagedMasterSecurityGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.EmrManagedMasterSecurityGroup = ptr.String(jtv)
}
case "EmrManagedSlaveSecurityGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.EmrManagedSlaveSecurityGroup = ptr.String(jtv)
}
case "IamInstanceProfile":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.IamInstanceProfile = ptr.String(jtv)
}
case "RequestedEc2AvailabilityZones":
if err := awsAwsjson11_deserializeDocumentXmlStringMaxLen256List(&sv.RequestedEc2AvailabilityZones, value); err != nil {
return err
}
case "RequestedEc2SubnetIds":
if err := awsAwsjson11_deserializeDocumentXmlStringMaxLen256List(&sv.RequestedEc2SubnetIds, value); err != nil {
return err
}
case "ServiceAccessSecurityGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ServiceAccessSecurityGroup = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentEC2InstanceIdsList(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 InstanceId to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentEnvironmentVariablesMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentErrorData(v *[]map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []map[string]string
if *v == nil {
cv = []map[string]string{}
} else {
cv = *v
}
for _, value := range shape {
var col map[string]string
if err := awsAwsjson11_deserializeDocumentStringMap(&col, value); err != nil {
return err
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentErrorDetail(v **types.ErrorDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ErrorDetail
if *v == nil {
sv = &types.ErrorDetail{}
} 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 String to be of type string, got %T instead", value)
}
sv.ErrorCode = ptr.String(jtv)
}
case "ErrorData":
if err := awsAwsjson11_deserializeDocumentErrorData(&sv.ErrorData, value); err != nil {
return err
}
case "ErrorMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ErrorMessage = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentErrorDetailList(v *[]types.ErrorDetail, 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.ErrorDetail
if *v == nil {
cv = []types.ErrorDetail{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ErrorDetail
destAddr := &col
if err := awsAwsjson11_deserializeDocumentErrorDetail(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentExecutionEngineConfig(v **types.ExecutionEngineConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ExecutionEngineConfig
if *v == nil {
sv = &types.ExecutionEngineConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ExecutionRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IAMRoleArn to be of type string, got %T instead", value)
}
sv.ExecutionRoleArn = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "MasterInstanceSecurityGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.MasterInstanceSecurityGroupId = ptr.String(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExecutionEngineType to be of type string, got %T instead", value)
}
sv.Type = types.ExecutionEngineType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentFailureDetails(v **types.FailureDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.FailureDetails
if *v == nil {
sv = &types.FailureDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LogFile":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.LogFile = ptr.String(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "Reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHadoopJarStepConfig(v **types.HadoopJarStepConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HadoopJarStepConfig
if *v == nil {
sv = &types.HadoopJarStepConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Args":
if err := awsAwsjson11_deserializeDocumentXmlStringList(&sv.Args, value); err != nil {
return err
}
case "Jar":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.Jar = ptr.String(jtv)
}
case "MainClass":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.MainClass = ptr.String(jtv)
}
case "Properties":
if err := awsAwsjson11_deserializeDocumentKeyValueList(&sv.Properties, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentHadoopStepConfig(v **types.HadoopStepConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.HadoopStepConfig
if *v == nil {
sv = &types.HadoopStepConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Args":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.Args, value); err != nil {
return err
}
case "Jar":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Jar = ptr.String(jtv)
}
case "MainClass":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.MainClass = ptr.String(jtv)
}
case "Properties":
if err := awsAwsjson11_deserializeDocumentStringMap(&sv.Properties, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstance(v **types.Instance, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Instance
if *v == nil {
sv = &types.Instance{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EbsVolumes":
if err := awsAwsjson11_deserializeDocumentEbsVolumeList(&sv.EbsVolumes, value); err != nil {
return err
}
case "Ec2InstanceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value)
}
sv.Ec2InstanceId = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "InstanceFleetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceFleetId to be of type string, got %T instead", value)
}
sv.InstanceFleetId = ptr.String(jtv)
}
case "InstanceGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.InstanceGroupId = ptr.String(jtv)
}
case "InstanceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value)
}
sv.InstanceType = ptr.String(jtv)
}
case "Market":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MarketType to be of type string, got %T instead", value)
}
sv.Market = types.MarketType(jtv)
}
case "PrivateDnsName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PrivateDnsName = ptr.String(jtv)
}
case "PrivateIpAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PrivateIpAddress = ptr.String(jtv)
}
case "PublicDnsName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PublicDnsName = ptr.String(jtv)
}
case "PublicIpAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.PublicIpAddress = ptr.String(jtv)
}
case "Status":
if err := awsAwsjson11_deserializeDocumentInstanceStatus(&sv.Status, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceFleet(v **types.InstanceFleet, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceFleet
if *v == nil {
sv = &types.InstanceFleet{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceFleetId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "InstanceFleetType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceFleetType to be of type string, got %T instead", value)
}
sv.InstanceFleetType = types.InstanceFleetType(jtv)
}
case "InstanceTypeSpecifications":
if err := awsAwsjson11_deserializeDocumentInstanceTypeSpecificationList(&sv.InstanceTypeSpecifications, value); err != nil {
return err
}
case "LaunchSpecifications":
if err := awsAwsjson11_deserializeDocumentInstanceFleetProvisioningSpecifications(&sv.LaunchSpecifications, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "ProvisionedOnDemandCapacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WholeNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ProvisionedOnDemandCapacity = ptr.Int32(int32(i64))
}
case "ProvisionedSpotCapacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WholeNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ProvisionedSpotCapacity = ptr.Int32(int32(i64))
}
case "ResizeSpecifications":
if err := awsAwsjson11_deserializeDocumentInstanceFleetResizingSpecifications(&sv.ResizeSpecifications, value); err != nil {
return err
}
case "Status":
if err := awsAwsjson11_deserializeDocumentInstanceFleetStatus(&sv.Status, value); err != nil {
return err
}
case "TargetOnDemandCapacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WholeNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TargetOnDemandCapacity = ptr.Int32(int32(i64))
}
case "TargetSpotCapacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WholeNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TargetSpotCapacity = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceFleetList(v *[]types.InstanceFleet, 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.InstanceFleet
if *v == nil {
cv = []types.InstanceFleet{}
} else {
cv = *v
}
for _, value := range shape {
var col types.InstanceFleet
destAddr := &col
if err := awsAwsjson11_deserializeDocumentInstanceFleet(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceFleetProvisioningSpecifications(v **types.InstanceFleetProvisioningSpecifications, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceFleetProvisioningSpecifications
if *v == nil {
sv = &types.InstanceFleetProvisioningSpecifications{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "OnDemandSpecification":
if err := awsAwsjson11_deserializeDocumentOnDemandProvisioningSpecification(&sv.OnDemandSpecification, value); err != nil {
return err
}
case "SpotSpecification":
if err := awsAwsjson11_deserializeDocumentSpotProvisioningSpecification(&sv.SpotSpecification, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceFleetResizingSpecifications(v **types.InstanceFleetResizingSpecifications, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceFleetResizingSpecifications
if *v == nil {
sv = &types.InstanceFleetResizingSpecifications{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "OnDemandResizeSpecification":
if err := awsAwsjson11_deserializeDocumentOnDemandResizingSpecification(&sv.OnDemandResizeSpecification, value); err != nil {
return err
}
case "SpotResizeSpecification":
if err := awsAwsjson11_deserializeDocumentSpotResizingSpecification(&sv.SpotResizeSpecification, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceFleetStateChangeReason(v **types.InstanceFleetStateChangeReason, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceFleetStateChangeReason
if *v == nil {
sv = &types.InstanceFleetStateChangeReason{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceFleetStateChangeReasonCode to be of type string, got %T instead", value)
}
sv.Code = types.InstanceFleetStateChangeReasonCode(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceFleetStatus(v **types.InstanceFleetStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceFleetStatus
if *v == nil {
sv = &types.InstanceFleetStatus{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "State":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceFleetState to be of type string, got %T instead", value)
}
sv.State = types.InstanceFleetState(jtv)
}
case "StateChangeReason":
if err := awsAwsjson11_deserializeDocumentInstanceFleetStateChangeReason(&sv.StateChangeReason, value); err != nil {
return err
}
case "Timeline":
if err := awsAwsjson11_deserializeDocumentInstanceFleetTimeline(&sv.Timeline, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceFleetTimeline(v **types.InstanceFleetTimeline, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceFleetTimeline
if *v == nil {
sv = &types.InstanceFleetTimeline{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "EndDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "ReadyDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ReadyDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceGroup(v **types.InstanceGroup, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceGroup
if *v == nil {
sv = &types.InstanceGroup{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AutoScalingPolicy":
if err := awsAwsjson11_deserializeDocumentAutoScalingPolicyDescription(&sv.AutoScalingPolicy, value); err != nil {
return err
}
case "BidPrice":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.BidPrice = ptr.String(jtv)
}
case "Configurations":
if err := awsAwsjson11_deserializeDocumentConfigurationList(&sv.Configurations, value); err != nil {
return err
}
case "ConfigurationsVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ConfigurationsVersion = i64
}
case "CustomAmiId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.CustomAmiId = ptr.String(jtv)
}
case "EbsBlockDevices":
if err := awsAwsjson11_deserializeDocumentEbsBlockDeviceList(&sv.EbsBlockDevices, value); err != nil {
return err
}
case "EbsOptimized":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.EbsOptimized = ptr.Bool(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceGroupId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "InstanceGroupType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceGroupType to be of type string, got %T instead", value)
}
sv.InstanceGroupType = types.InstanceGroupType(jtv)
}
case "InstanceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value)
}
sv.InstanceType = ptr.String(jtv)
}
case "LastSuccessfullyAppliedConfigurations":
if err := awsAwsjson11_deserializeDocumentConfigurationList(&sv.LastSuccessfullyAppliedConfigurations, value); err != nil {
return err
}
case "LastSuccessfullyAppliedConfigurationsVersion":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.LastSuccessfullyAppliedConfigurationsVersion = i64
}
case "Market":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MarketType to be of type string, got %T instead", value)
}
sv.Market = types.MarketType(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "RequestedInstanceCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RequestedInstanceCount = ptr.Int32(int32(i64))
}
case "RunningInstanceCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RunningInstanceCount = ptr.Int32(int32(i64))
}
case "ShrinkPolicy":
if err := awsAwsjson11_deserializeDocumentShrinkPolicy(&sv.ShrinkPolicy, value); err != nil {
return err
}
case "Status":
if err := awsAwsjson11_deserializeDocumentInstanceGroupStatus(&sv.Status, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceGroupDetail(v **types.InstanceGroupDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceGroupDetail
if *v == nil {
sv = &types.InstanceGroupDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BidPrice":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.BidPrice = ptr.String(jtv)
}
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "CustomAmiId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.CustomAmiId = ptr.String(jtv)
}
case "EndDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "InstanceGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.InstanceGroupId = ptr.String(jtv)
}
case "InstanceRequestCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.InstanceRequestCount = ptr.Int32(int32(i64))
}
case "InstanceRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceRoleType to be of type string, got %T instead", value)
}
sv.InstanceRole = types.InstanceRoleType(jtv)
}
case "InstanceRunningCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.InstanceRunningCount = ptr.Int32(int32(i64))
}
case "InstanceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value)
}
sv.InstanceType = ptr.String(jtv)
}
case "LastStateChangeReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.LastStateChangeReason = ptr.String(jtv)
}
case "Market":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MarketType to be of type string, got %T instead", value)
}
sv.Market = types.MarketType(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "ReadyDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ReadyDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "StartDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "State":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceGroupState to be of type string, got %T instead", value)
}
sv.State = types.InstanceGroupState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceGroupDetailList(v *[]types.InstanceGroupDetail, 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.InstanceGroupDetail
if *v == nil {
cv = []types.InstanceGroupDetail{}
} else {
cv = *v
}
for _, value := range shape {
var col types.InstanceGroupDetail
destAddr := &col
if err := awsAwsjson11_deserializeDocumentInstanceGroupDetail(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceGroupIdsList(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 XmlStringMaxLen256 to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceGroupList(v *[]types.InstanceGroup, 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.InstanceGroup
if *v == nil {
cv = []types.InstanceGroup{}
} else {
cv = *v
}
for _, value := range shape {
var col types.InstanceGroup
destAddr := &col
if err := awsAwsjson11_deserializeDocumentInstanceGroup(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceGroupStateChangeReason(v **types.InstanceGroupStateChangeReason, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceGroupStateChangeReason
if *v == nil {
sv = &types.InstanceGroupStateChangeReason{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceGroupStateChangeReasonCode to be of type string, got %T instead", value)
}
sv.Code = types.InstanceGroupStateChangeReasonCode(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceGroupStatus(v **types.InstanceGroupStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceGroupStatus
if *v == nil {
sv = &types.InstanceGroupStatus{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "State":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceGroupState to be of type string, got %T instead", value)
}
sv.State = types.InstanceGroupState(jtv)
}
case "StateChangeReason":
if err := awsAwsjson11_deserializeDocumentInstanceGroupStateChangeReason(&sv.StateChangeReason, value); err != nil {
return err
}
case "Timeline":
if err := awsAwsjson11_deserializeDocumentInstanceGroupTimeline(&sv.Timeline, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceGroupTimeline(v **types.InstanceGroupTimeline, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceGroupTimeline
if *v == nil {
sv = &types.InstanceGroupTimeline{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "EndDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "ReadyDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ReadyDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceList(v *[]types.Instance, 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.Instance
if *v == nil {
cv = []types.Instance{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Instance
destAddr := &col
if err := awsAwsjson11_deserializeDocumentInstance(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceResizePolicy(v **types.InstanceResizePolicy, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceResizePolicy
if *v == nil {
sv = &types.InstanceResizePolicy{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InstancesToProtect":
if err := awsAwsjson11_deserializeDocumentEC2InstanceIdsList(&sv.InstancesToProtect, value); err != nil {
return err
}
case "InstancesToTerminate":
if err := awsAwsjson11_deserializeDocumentEC2InstanceIdsList(&sv.InstancesToTerminate, value); err != nil {
return err
}
case "InstanceTerminationTimeout":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.InstanceTerminationTimeout = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceStateChangeReason(v **types.InstanceStateChangeReason, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceStateChangeReason
if *v == nil {
sv = &types.InstanceStateChangeReason{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceStateChangeReasonCode to be of type string, got %T instead", value)
}
sv.Code = types.InstanceStateChangeReasonCode(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceStatus(v **types.InstanceStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceStatus
if *v == nil {
sv = &types.InstanceStatus{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "State":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceState to be of type string, got %T instead", value)
}
sv.State = types.InstanceState(jtv)
}
case "StateChangeReason":
if err := awsAwsjson11_deserializeDocumentInstanceStateChangeReason(&sv.StateChangeReason, value); err != nil {
return err
}
case "Timeline":
if err := awsAwsjson11_deserializeDocumentInstanceTimeline(&sv.Timeline, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceTimeline(v **types.InstanceTimeline, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceTimeline
if *v == nil {
sv = &types.InstanceTimeline{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "EndDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "ReadyDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ReadyDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceTypeSpecification(v **types.InstanceTypeSpecification, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InstanceTypeSpecification
if *v == nil {
sv = &types.InstanceTypeSpecification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BidPrice":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.BidPrice = ptr.String(jtv)
}
case "BidPriceAsPercentageOfOnDemandPrice":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.BidPriceAsPercentageOfOnDemandPrice = ptr.Float64(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.BidPriceAsPercentageOfOnDemandPrice = ptr.Float64(f64)
default:
return fmt.Errorf("expected NonNegativeDouble to be a JSON Number, got %T instead", value)
}
}
case "Configurations":
if err := awsAwsjson11_deserializeDocumentConfigurationList(&sv.Configurations, value); err != nil {
return err
}
case "CustomAmiId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.CustomAmiId = ptr.String(jtv)
}
case "EbsBlockDevices":
if err := awsAwsjson11_deserializeDocumentEbsBlockDeviceList(&sv.EbsBlockDevices, value); err != nil {
return err
}
case "EbsOptimized":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected BooleanObject to be of type *bool, got %T instead", value)
}
sv.EbsOptimized = ptr.Bool(jtv)
}
case "InstanceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value)
}
sv.InstanceType = ptr.String(jtv)
}
case "WeightedCapacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WholeNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.WeightedCapacity = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInstanceTypeSpecificationList(v *[]types.InstanceTypeSpecification, 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.InstanceTypeSpecification
if *v == nil {
cv = []types.InstanceTypeSpecification{}
} else {
cv = *v
}
for _, value := range shape {
var col types.InstanceTypeSpecification
destAddr := &col
if err := awsAwsjson11_deserializeDocumentInstanceTypeSpecification(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServerError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerError
if *v == nil {
sv = &types.InternalServerError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerException
if *v == nil {
sv = &types.InternalServerException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InvalidRequestException
if *v == nil {
sv = &types.InvalidRequestException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "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 "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_deserializeDocumentJobFlowDetail(v **types.JobFlowDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JobFlowDetail
if *v == nil {
sv = &types.JobFlowDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AmiVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.AmiVersion = ptr.String(jtv)
}
case "AutoScalingRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.AutoScalingRole = ptr.String(jtv)
}
case "BootstrapActions":
if err := awsAwsjson11_deserializeDocumentBootstrapActionDetailList(&sv.BootstrapActions, value); err != nil {
return err
}
case "ExecutionStatusDetail":
if err := awsAwsjson11_deserializeDocumentJobFlowExecutionStatusDetail(&sv.ExecutionStatusDetail, value); err != nil {
return err
}
case "Instances":
if err := awsAwsjson11_deserializeDocumentJobFlowInstancesDetail(&sv.Instances, value); err != nil {
return err
}
case "JobFlowId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.JobFlowId = ptr.String(jtv)
}
case "JobFlowRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.JobFlowRole = ptr.String(jtv)
}
case "LogEncryptionKmsKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.LogEncryptionKmsKeyId = ptr.String(jtv)
}
case "LogUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.LogUri = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "ScaleDownBehavior":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ScaleDownBehavior to be of type string, got %T instead", value)
}
sv.ScaleDownBehavior = types.ScaleDownBehavior(jtv)
}
case "ServiceRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.ServiceRole = ptr.String(jtv)
}
case "Steps":
if err := awsAwsjson11_deserializeDocumentStepDetailList(&sv.Steps, value); err != nil {
return err
}
case "SupportedProducts":
if err := awsAwsjson11_deserializeDocumentSupportedProductsList(&sv.SupportedProducts, value); err != nil {
return err
}
case "VisibleToAllUsers":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.VisibleToAllUsers = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentJobFlowDetailList(v *[]types.JobFlowDetail, 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.JobFlowDetail
if *v == nil {
cv = []types.JobFlowDetail{}
} else {
cv = *v
}
for _, value := range shape {
var col types.JobFlowDetail
destAddr := &col
if err := awsAwsjson11_deserializeDocumentJobFlowDetail(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentJobFlowExecutionStatusDetail(v **types.JobFlowExecutionStatusDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JobFlowExecutionStatusDetail
if *v == nil {
sv = &types.JobFlowExecutionStatusDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "EndDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "LastStateChangeReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.LastStateChangeReason = ptr.String(jtv)
}
case "ReadyDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ReadyDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "StartDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "State":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobFlowExecutionState to be of type string, got %T instead", value)
}
sv.State = types.JobFlowExecutionState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentJobFlowInstancesDetail(v **types.JobFlowInstancesDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JobFlowInstancesDetail
if *v == nil {
sv = &types.JobFlowInstancesDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Ec2KeyName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Ec2KeyName = ptr.String(jtv)
}
case "Ec2SubnetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Ec2SubnetId = ptr.String(jtv)
}
case "HadoopVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.HadoopVersion = ptr.String(jtv)
}
case "InstanceCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.InstanceCount = ptr.Int32(int32(i64))
}
case "InstanceGroups":
if err := awsAwsjson11_deserializeDocumentInstanceGroupDetailList(&sv.InstanceGroups, value); err != nil {
return err
}
case "KeepJobFlowAliveWhenNoSteps":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.KeepJobFlowAliveWhenNoSteps = jtv
}
case "MasterInstanceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.MasterInstanceId = ptr.String(jtv)
}
case "MasterInstanceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value)
}
sv.MasterInstanceType = ptr.String(jtv)
}
case "MasterPublicDnsName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.MasterPublicDnsName = ptr.String(jtv)
}
case "NormalizedInstanceHours":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.NormalizedInstanceHours = ptr.Int32(int32(i64))
}
case "Placement":
if err := awsAwsjson11_deserializeDocumentPlacementType(&sv.Placement, value); err != nil {
return err
}
case "SlaveInstanceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value)
}
sv.SlaveInstanceType = ptr.String(jtv)
}
case "TerminationProtected":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.TerminationProtected = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentKerberosAttributes(v **types.KerberosAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KerberosAttributes
if *v == nil {
sv = &types.KerberosAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ADDomainJoinPassword":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.ADDomainJoinPassword = ptr.String(jtv)
}
case "ADDomainJoinUser":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.ADDomainJoinUser = ptr.String(jtv)
}
case "CrossRealmTrustPrincipalPassword":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.CrossRealmTrustPrincipalPassword = ptr.String(jtv)
}
case "KdcAdminPassword":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.KdcAdminPassword = ptr.String(jtv)
}
case "Realm":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Realm = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentKeyValue(v **types.KeyValue, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.KeyValue
if *v == nil {
sv = &types.KeyValue{}
} 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 XmlString 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 XmlString to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentKeyValueList(v *[]types.KeyValue, 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.KeyValue
if *v == nil {
cv = []types.KeyValue{}
} else {
cv = *v
}
for _, value := range shape {
var col types.KeyValue
destAddr := &col
if err := awsAwsjson11_deserializeDocumentKeyValue(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentManagedScalingPolicy(v **types.ManagedScalingPolicy, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ManagedScalingPolicy
if *v == nil {
sv = &types.ManagedScalingPolicy{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ComputeLimits":
if err := awsAwsjson11_deserializeDocumentComputeLimits(&sv.ComputeLimits, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMetricDimension(v **types.MetricDimension, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MetricDimension
if *v == nil {
sv = &types.MetricDimension{}
} 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 String 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 String to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMetricDimensionList(v *[]types.MetricDimension, 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.MetricDimension
if *v == nil {
cv = []types.MetricDimension{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MetricDimension
destAddr := &col
if err := awsAwsjson11_deserializeDocumentMetricDimension(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentNotebookExecution(v **types.NotebookExecution, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NotebookExecution
if *v == nil {
sv = &types.NotebookExecution{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "EditorId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.EditorId = ptr.String(jtv)
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "EnvironmentVariables":
if err := awsAwsjson11_deserializeDocumentEnvironmentVariablesMap(&sv.EnvironmentVariables, value); err != nil {
return err
}
case "ExecutionEngine":
if err := awsAwsjson11_deserializeDocumentExecutionEngineConfig(&sv.ExecutionEngine, value); err != nil {
return err
}
case "LastStateChangeReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.LastStateChangeReason = ptr.String(jtv)
}
case "NotebookExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.NotebookExecutionId = ptr.String(jtv)
}
case "NotebookExecutionName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.NotebookExecutionName = ptr.String(jtv)
}
case "NotebookInstanceSecurityGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.NotebookInstanceSecurityGroupId = ptr.String(jtv)
}
case "NotebookParams":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.NotebookParams = ptr.String(jtv)
}
case "NotebookS3Location":
if err := awsAwsjson11_deserializeDocumentNotebookS3LocationForOutput(&sv.NotebookS3Location, value); err != nil {
return err
}
case "OutputNotebookFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutputNotebookFormat to be of type string, got %T instead", value)
}
sv.OutputNotebookFormat = types.OutputNotebookFormat(jtv)
}
case "OutputNotebookS3Location":
if err := awsAwsjson11_deserializeDocumentOutputNotebookS3LocationForOutput(&sv.OutputNotebookS3Location, value); err != nil {
return err
}
case "OutputNotebookURI":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.OutputNotebookURI = ptr.String(jtv)
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NotebookExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.NotebookExecutionStatus(jtv)
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentNotebookExecutionSummary(v **types.NotebookExecutionSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NotebookExecutionSummary
if *v == nil {
sv = &types.NotebookExecutionSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EditorId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.EditorId = ptr.String(jtv)
}
case "EndTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "ExecutionEngineId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.ExecutionEngineId = ptr.String(jtv)
}
case "NotebookExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.NotebookExecutionId = ptr.String(jtv)
}
case "NotebookExecutionName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.NotebookExecutionName = ptr.String(jtv)
}
case "NotebookS3Location":
if err := awsAwsjson11_deserializeDocumentNotebookS3LocationForOutput(&sv.NotebookS3Location, value); err != nil {
return err
}
case "StartTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NotebookExecutionStatus to be of type string, got %T instead", value)
}
sv.Status = types.NotebookExecutionStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentNotebookExecutionSummaryList(v *[]types.NotebookExecutionSummary, 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.NotebookExecutionSummary
if *v == nil {
cv = []types.NotebookExecutionSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.NotebookExecutionSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentNotebookExecutionSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentNotebookS3LocationForOutput(v **types.NotebookS3LocationForOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NotebookS3LocationForOutput
if *v == nil {
sv = &types.NotebookS3LocationForOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Bucket":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Bucket = ptr.String(jtv)
}
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UriString to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOnDemandCapacityReservationOptions(v **types.OnDemandCapacityReservationOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OnDemandCapacityReservationOptions
if *v == nil {
sv = &types.OnDemandCapacityReservationOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CapacityReservationPreference":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OnDemandCapacityReservationPreference to be of type string, got %T instead", value)
}
sv.CapacityReservationPreference = types.OnDemandCapacityReservationPreference(jtv)
}
case "CapacityReservationResourceGroupArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.CapacityReservationResourceGroupArn = ptr.String(jtv)
}
case "UsageStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OnDemandCapacityReservationUsageStrategy to be of type string, got %T instead", value)
}
sv.UsageStrategy = types.OnDemandCapacityReservationUsageStrategy(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOnDemandProvisioningSpecification(v **types.OnDemandProvisioningSpecification, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OnDemandProvisioningSpecification
if *v == nil {
sv = &types.OnDemandProvisioningSpecification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AllocationStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OnDemandProvisioningAllocationStrategy to be of type string, got %T instead", value)
}
sv.AllocationStrategy = types.OnDemandProvisioningAllocationStrategy(jtv)
}
case "CapacityReservationOptions":
if err := awsAwsjson11_deserializeDocumentOnDemandCapacityReservationOptions(&sv.CapacityReservationOptions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOnDemandResizingSpecification(v **types.OnDemandResizingSpecification, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OnDemandResizingSpecification
if *v == nil {
sv = &types.OnDemandResizingSpecification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TimeoutDurationMinutes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WholeNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeoutDurationMinutes = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOSRelease(v **types.OSRelease, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OSRelease
if *v == nil {
sv = &types.OSRelease{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Label":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Label = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentOSReleaseList(v *[]types.OSRelease, 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.OSRelease
if *v == nil {
cv = []types.OSRelease{}
} else {
cv = *v
}
for _, value := range shape {
var col types.OSRelease
destAddr := &col
if err := awsAwsjson11_deserializeDocumentOSRelease(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentOutputNotebookS3LocationForOutput(v **types.OutputNotebookS3LocationForOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.OutputNotebookS3LocationForOutput
if *v == nil {
sv = &types.OutputNotebookS3LocationForOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Bucket":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Bucket = ptr.String(jtv)
}
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UriString to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPlacementGroupConfig(v **types.PlacementGroupConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PlacementGroupConfig
if *v == nil {
sv = &types.PlacementGroupConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InstanceRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceRoleType to be of type string, got %T instead", value)
}
sv.InstanceRole = types.InstanceRoleType(jtv)
}
case "PlacementStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PlacementGroupStrategy to be of type string, got %T instead", value)
}
sv.PlacementStrategy = types.PlacementGroupStrategy(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPlacementGroupConfigList(v *[]types.PlacementGroupConfig, 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.PlacementGroupConfig
if *v == nil {
cv = []types.PlacementGroupConfig{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PlacementGroupConfig
destAddr := &col
if err := awsAwsjson11_deserializeDocumentPlacementGroupConfig(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentPlacementType(v **types.PlacementType, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PlacementType
if *v == nil {
sv = &types.PlacementType{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AvailabilityZone":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.AvailabilityZone = ptr.String(jtv)
}
case "AvailabilityZones":
if err := awsAwsjson11_deserializeDocumentXmlStringMaxLen256List(&sv.AvailabilityZones, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPortRange(v **types.PortRange, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PortRange
if *v == nil {
sv = &types.PortRange{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MaxRange":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxRange = ptr.Int32(int32(i64))
}
case "MinRange":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Port to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MinRange = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentPortRanges(v *[]types.PortRange, 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.PortRange
if *v == nil {
cv = []types.PortRange{}
} else {
cv = *v
}
for _, value := range shape {
var col types.PortRange
destAddr := &col
if err := awsAwsjson11_deserializeDocumentPortRange(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentScalingAction(v **types.ScalingAction, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ScalingAction
if *v == nil {
sv = &types.ScalingAction{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Market":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MarketType to be of type string, got %T instead", value)
}
sv.Market = types.MarketType(jtv)
}
case "SimpleScalingPolicyConfiguration":
if err := awsAwsjson11_deserializeDocumentSimpleScalingPolicyConfiguration(&sv.SimpleScalingPolicyConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentScalingConstraints(v **types.ScalingConstraints, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ScalingConstraints
if *v == nil {
sv = &types.ScalingConstraints{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MaxCapacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxCapacity = ptr.Int32(int32(i64))
}
case "MinCapacity":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MinCapacity = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentScalingRule(v **types.ScalingRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ScalingRule
if *v == nil {
sv = &types.ScalingRule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Action":
if err := awsAwsjson11_deserializeDocumentScalingAction(&sv.Action, value); err != nil {
return err
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Trigger":
if err := awsAwsjson11_deserializeDocumentScalingTrigger(&sv.Trigger, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentScalingRuleList(v *[]types.ScalingRule, 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.ScalingRule
if *v == nil {
cv = []types.ScalingRule{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ScalingRule
destAddr := &col
if err := awsAwsjson11_deserializeDocumentScalingRule(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentScalingTrigger(v **types.ScalingTrigger, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ScalingTrigger
if *v == nil {
sv = &types.ScalingTrigger{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CloudWatchAlarmDefinition":
if err := awsAwsjson11_deserializeDocumentCloudWatchAlarmDefinition(&sv.CloudWatchAlarmDefinition, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentScriptBootstrapActionConfig(v **types.ScriptBootstrapActionConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ScriptBootstrapActionConfig
if *v == nil {
sv = &types.ScriptBootstrapActionConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Args":
if err := awsAwsjson11_deserializeDocumentXmlStringList(&sv.Args, value); err != nil {
return err
}
case "Path":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.Path = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSecurityConfigurationList(v *[]types.SecurityConfigurationSummary, 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.SecurityConfigurationSummary
if *v == nil {
cv = []types.SecurityConfigurationSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SecurityConfigurationSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSecurityConfigurationSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSecurityConfigurationSummary(v **types.SecurityConfigurationSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SecurityConfigurationSummary
if *v == nil {
sv = &types.SecurityConfigurationSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSessionMappingDetail(v **types.SessionMappingDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SessionMappingDetail
if *v == nil {
sv = &types.SessionMappingDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "IdentityId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.IdentityId = ptr.String(jtv)
}
case "IdentityName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.IdentityName = ptr.String(jtv)
}
case "IdentityType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value)
}
sv.IdentityType = types.IdentityType(jtv)
}
case "LastModifiedTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModifiedTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "SessionPolicyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.SessionPolicyArn = ptr.String(jtv)
}
case "StudioId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.StudioId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSessionMappingSummary(v **types.SessionMappingSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SessionMappingSummary
if *v == nil {
sv = &types.SessionMappingSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "IdentityId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.IdentityId = ptr.String(jtv)
}
case "IdentityName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.IdentityName = ptr.String(jtv)
}
case "IdentityType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value)
}
sv.IdentityType = types.IdentityType(jtv)
}
case "SessionPolicyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.SessionPolicyArn = ptr.String(jtv)
}
case "StudioId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.StudioId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSessionMappingSummaryList(v *[]types.SessionMappingSummary, 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.SessionMappingSummary
if *v == nil {
cv = []types.SessionMappingSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SessionMappingSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSessionMappingSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentShrinkPolicy(v **types.ShrinkPolicy, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ShrinkPolicy
if *v == nil {
sv = &types.ShrinkPolicy{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DecommissionTimeout":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DecommissionTimeout = ptr.Int32(int32(i64))
}
case "InstanceResizePolicy":
if err := awsAwsjson11_deserializeDocumentInstanceResizePolicy(&sv.InstanceResizePolicy, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSimpleScalingPolicyConfiguration(v **types.SimpleScalingPolicyConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SimpleScalingPolicyConfiguration
if *v == nil {
sv = &types.SimpleScalingPolicyConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AdjustmentType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AdjustmentType to be of type string, got %T instead", value)
}
sv.AdjustmentType = types.AdjustmentType(jtv)
}
case "CoolDown":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CoolDown = ptr.Int32(int32(i64))
}
case "ScalingAdjustment":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ScalingAdjustment = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSimplifiedApplication(v **types.SimplifiedApplication, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SimplifiedApplication
if *v == nil {
sv = &types.SimplifiedApplication{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSimplifiedApplicationList(v *[]types.SimplifiedApplication, 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.SimplifiedApplication
if *v == nil {
cv = []types.SimplifiedApplication{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SimplifiedApplication
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSimplifiedApplication(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSpotProvisioningSpecification(v **types.SpotProvisioningSpecification, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SpotProvisioningSpecification
if *v == nil {
sv = &types.SpotProvisioningSpecification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AllocationStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SpotProvisioningAllocationStrategy to be of type string, got %T instead", value)
}
sv.AllocationStrategy = types.SpotProvisioningAllocationStrategy(jtv)
}
case "BlockDurationMinutes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WholeNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.BlockDurationMinutes = ptr.Int32(int32(i64))
}
case "TimeoutAction":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SpotProvisioningTimeoutAction to be of type string, got %T instead", value)
}
sv.TimeoutAction = types.SpotProvisioningTimeoutAction(jtv)
}
case "TimeoutDurationMinutes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WholeNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeoutDurationMinutes = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSpotResizingSpecification(v **types.SpotResizingSpecification, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SpotResizingSpecification
if *v == nil {
sv = &types.SpotResizingSpecification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TimeoutDurationMinutes":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected WholeNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeoutDurationMinutes = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStep(v **types.Step, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Step
if *v == nil {
sv = &types.Step{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ActionOnFailure":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionOnFailure to be of type string, got %T instead", value)
}
sv.ActionOnFailure = types.ActionOnFailure(jtv)
}
case "Config":
if err := awsAwsjson11_deserializeDocumentHadoopStepConfig(&sv.Config, value); err != nil {
return err
}
case "ExecutionRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OptionalArnType to be of type string, got %T instead", value)
}
sv.ExecutionRoleArn = ptr.String(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StepId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Status":
if err := awsAwsjson11_deserializeDocumentStepStatus(&sv.Status, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStepConfig(v **types.StepConfig, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StepConfig
if *v == nil {
sv = &types.StepConfig{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ActionOnFailure":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionOnFailure to be of type string, got %T instead", value)
}
sv.ActionOnFailure = types.ActionOnFailure(jtv)
}
case "HadoopJarStep":
if err := awsAwsjson11_deserializeDocumentHadoopJarStepConfig(&sv.HadoopJarStep, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStepDetail(v **types.StepDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StepDetail
if *v == nil {
sv = &types.StepDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ExecutionStatusDetail":
if err := awsAwsjson11_deserializeDocumentStepExecutionStatusDetail(&sv.ExecutionStatusDetail, value); err != nil {
return err
}
case "StepConfig":
if err := awsAwsjson11_deserializeDocumentStepConfig(&sv.StepConfig, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStepDetailList(v *[]types.StepDetail, 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.StepDetail
if *v == nil {
cv = []types.StepDetail{}
} else {
cv = *v
}
for _, value := range shape {
var col types.StepDetail
destAddr := &col
if err := awsAwsjson11_deserializeDocumentStepDetail(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentStepExecutionStatusDetail(v **types.StepExecutionStatusDetail, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StepExecutionStatusDetail
if *v == nil {
sv = &types.StepExecutionStatusDetail{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "EndDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "LastStateChangeReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.LastStateChangeReason = ptr.String(jtv)
}
case "StartDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "State":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StepExecutionState to be of type string, got %T instead", value)
}
sv.State = types.StepExecutionState(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStepIdsList(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 XmlStringMaxLen256 to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentStepStateChangeReason(v **types.StepStateChangeReason, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StepStateChangeReason
if *v == nil {
sv = &types.StepStateChangeReason{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StepStateChangeReasonCode to be of type string, got %T instead", value)
}
sv.Code = types.StepStateChangeReasonCode(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStepStatus(v **types.StepStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StepStatus
if *v == nil {
sv = &types.StepStatus{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureDetails":
if err := awsAwsjson11_deserializeDocumentFailureDetails(&sv.FailureDetails, value); err != nil {
return err
}
case "State":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StepState to be of type string, got %T instead", value)
}
sv.State = types.StepState(jtv)
}
case "StateChangeReason":
if err := awsAwsjson11_deserializeDocumentStepStateChangeReason(&sv.StateChangeReason, value); err != nil {
return err
}
case "Timeline":
if err := awsAwsjson11_deserializeDocumentStepTimeline(&sv.Timeline, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStepSummary(v **types.StepSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StepSummary
if *v == nil {
sv = &types.StepSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ActionOnFailure":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ActionOnFailure to be of type string, got %T instead", value)
}
sv.ActionOnFailure = types.ActionOnFailure(jtv)
}
case "Config":
if err := awsAwsjson11_deserializeDocumentHadoopStepConfig(&sv.Config, value); err != nil {
return err
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StepId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Status":
if err := awsAwsjson11_deserializeDocumentStepStatus(&sv.Status, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStepSummaryList(v *[]types.StepSummary, 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.StepSummary
if *v == nil {
cv = []types.StepSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.StepSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentStepSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentStepTimeline(v **types.StepTimeline, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StepTimeline
if *v == nil {
sv = &types.StepTimeline{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "EndDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.EndDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "StartDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStringList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentStringMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsAwsjson11_deserializeDocumentStudio(v **types.Studio, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Studio
if *v == nil {
sv = &types.Studio{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AuthMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AuthMode to be of type string, got %T instead", value)
}
sv.AuthMode = types.AuthMode(jtv)
}
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "DefaultS3Location":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.DefaultS3Location = ptr.String(jtv)
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "EngineSecurityGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.EngineSecurityGroupId = ptr.String(jtv)
}
case "IdpAuthUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.IdpAuthUrl = ptr.String(jtv)
}
case "IdpRelayStateParameterName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.IdpRelayStateParameterName = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "ServiceRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.ServiceRole = ptr.String(jtv)
}
case "StudioArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.StudioArn = ptr.String(jtv)
}
case "StudioId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.StudioId = ptr.String(jtv)
}
case "SubnetIds":
if err := awsAwsjson11_deserializeDocumentSubnetIdList(&sv.SubnetIds, value); err != nil {
return err
}
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
case "Url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.Url = ptr.String(jtv)
}
case "UserRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.UserRole = ptr.String(jtv)
}
case "VpcId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.VpcId = ptr.String(jtv)
}
case "WorkspaceSecurityGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.WorkspaceSecurityGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStudioSummary(v **types.StudioSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.StudioSummary
if *v == nil {
sv = &types.StudioSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AuthMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AuthMode to be of type string, got %T instead", value)
}
sv.AuthMode = types.AuthMode(jtv)
}
case "CreationTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "StudioId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.StudioId = ptr.String(jtv)
}
case "Url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Url = ptr.String(jtv)
}
case "VpcId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.VpcId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentStudioSummaryList(v *[]types.StudioSummary, 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.StudioSummary
if *v == nil {
cv = []types.StudioSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.StudioSummary
destAddr := &col
if err := awsAwsjson11_deserializeDocumentStudioSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSubnetIdList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSupportedInstanceType(v **types.SupportedInstanceType, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SupportedInstanceType
if *v == nil {
sv = &types.SupportedInstanceType{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Architecture":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Architecture = ptr.String(jtv)
}
case "EbsOptimizedAvailable":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.EbsOptimizedAvailable = jtv
}
case "EbsOptimizedByDefault":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.EbsOptimizedByDefault = jtv
}
case "EbsStorageOnly":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.EbsStorageOnly = jtv
}
case "InstanceFamilyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.InstanceFamilyId = ptr.String(jtv)
}
case "Is64BitsOnly":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.Is64BitsOnly = jtv
}
case "MemoryGB":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.MemoryGB = float32(f64)
case string:
var f64 float64
switch {
case strings.EqualFold(jtv, "NaN"):
f64 = math.NaN()
case strings.EqualFold(jtv, "Infinity"):
f64 = math.Inf(1)
case strings.EqualFold(jtv, "-Infinity"):
f64 = math.Inf(-1)
default:
return fmt.Errorf("unknown JSON number value: %s", jtv)
}
sv.MemoryGB = float32(f64)
default:
return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value)
}
}
case "NumberOfDisks":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.NumberOfDisks = ptr.Int32(int32(i64))
}
case "StorageGB":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.StorageGB = ptr.Int32(int32(i64))
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Type = ptr.String(jtv)
}
case "VCPU":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.VCPU = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentSupportedInstanceTypesList(v *[]types.SupportedInstanceType, 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.SupportedInstanceType
if *v == nil {
cv = []types.SupportedInstanceType{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SupportedInstanceType
destAddr := &col
if err := awsAwsjson11_deserializeDocumentSupportedInstanceType(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentSupportedProductsList(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 XmlStringMaxLen256 to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String 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 String 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_deserializeDocumentUsernamePassword(v **types.UsernamePassword, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.UsernamePassword
if *v == nil {
sv = &types.UsernamePassword{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Password":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Password = ptr.String(jtv)
}
case "Username":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.Username = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentVolumeSpecification(v **types.VolumeSpecification, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.VolumeSpecification
if *v == nil {
sv = &types.VolumeSpecification{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Iops":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Iops = ptr.Int32(int32(i64))
}
case "SizeInGB":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SizeInGB = ptr.Int32(int32(i64))
}
case "Throughput":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ThroughputVal to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Throughput = ptr.Int32(int32(i64))
}
case "VolumeType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.VolumeType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentXmlStringList(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 XmlString to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentXmlStringMaxLen256List(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 XmlStringMaxLen256 to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddInstanceFleetOutput(v **AddInstanceFleetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddInstanceFleetOutput
if *v == nil {
sv = &AddInstanceFleetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ClusterArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ArnType to be of type string, got %T instead", value)
}
sv.ClusterArn = ptr.String(jtv)
}
case "ClusterId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.ClusterId = ptr.String(jtv)
}
case "InstanceFleetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceFleetId to be of type string, got %T instead", value)
}
sv.InstanceFleetId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddInstanceGroupsOutput(v **AddInstanceGroupsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddInstanceGroupsOutput
if *v == nil {
sv = &AddInstanceGroupsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ClusterArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ArnType to be of type string, got %T instead", value)
}
sv.ClusterArn = ptr.String(jtv)
}
case "InstanceGroupIds":
if err := awsAwsjson11_deserializeDocumentInstanceGroupIdsList(&sv.InstanceGroupIds, value); err != nil {
return err
}
case "JobFlowId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.JobFlowId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddJobFlowStepsOutput(v **AddJobFlowStepsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddJobFlowStepsOutput
if *v == nil {
sv = &AddJobFlowStepsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "StepIds":
if err := awsAwsjson11_deserializeDocumentStepIdsList(&sv.StepIds, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentAddTagsOutput(v **AddTagsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *AddTagsOutput
if *v == nil {
sv = &AddTagsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCancelStepsOutput(v **CancelStepsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CancelStepsOutput
if *v == nil {
sv = &CancelStepsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CancelStepsInfoList":
if err := awsAwsjson11_deserializeDocumentCancelStepsInfoList(&sv.CancelStepsInfoList, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateSecurityConfigurationOutput(v **CreateSecurityConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateSecurityConfigurationOutput
if *v == nil {
sv = &CreateSecurityConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateStudioOutput(v **CreateStudioOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateStudioOutput
if *v == nil {
sv = &CreateStudioOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "StudioId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.StudioId = ptr.String(jtv)
}
case "Url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.Url = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteSecurityConfigurationOutput(v **DeleteSecurityConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteSecurityConfigurationOutput
if *v == nil {
sv = &DeleteSecurityConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeClusterOutput(v **DescribeClusterOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeClusterOutput
if *v == nil {
sv = &DescribeClusterOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Cluster":
if err := awsAwsjson11_deserializeDocumentCluster(&sv.Cluster, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeJobFlowsOutput(v **DescribeJobFlowsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeJobFlowsOutput
if *v == nil {
sv = &DescribeJobFlowsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "JobFlows":
if err := awsAwsjson11_deserializeDocumentJobFlowDetailList(&sv.JobFlows, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeNotebookExecutionOutput(v **DescribeNotebookExecutionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeNotebookExecutionOutput
if *v == nil {
sv = &DescribeNotebookExecutionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NotebookExecution":
if err := awsAwsjson11_deserializeDocumentNotebookExecution(&sv.NotebookExecution, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeReleaseLabelOutput(v **DescribeReleaseLabelOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeReleaseLabelOutput
if *v == nil {
sv = &DescribeReleaseLabelOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Applications":
if err := awsAwsjson11_deserializeDocumentSimplifiedApplicationList(&sv.Applications, value); err != nil {
return err
}
case "AvailableOSReleases":
if err := awsAwsjson11_deserializeDocumentOSReleaseList(&sv.AvailableOSReleases, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "ReleaseLabel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ReleaseLabel = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeSecurityConfigurationOutput(v **DescribeSecurityConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeSecurityConfigurationOutput
if *v == nil {
sv = &DescribeSecurityConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreationDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreationDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "SecurityConfiguration":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SecurityConfiguration = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeStepOutput(v **DescribeStepOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeStepOutput
if *v == nil {
sv = &DescribeStepOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Step":
if err := awsAwsjson11_deserializeDocumentStep(&sv.Step, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeStudioOutput(v **DescribeStudioOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeStudioOutput
if *v == nil {
sv = &DescribeStudioOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Studio":
if err := awsAwsjson11_deserializeDocumentStudio(&sv.Studio, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetAutoTerminationPolicyOutput(v **GetAutoTerminationPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetAutoTerminationPolicyOutput
if *v == nil {
sv = &GetAutoTerminationPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AutoTerminationPolicy":
if err := awsAwsjson11_deserializeDocumentAutoTerminationPolicy(&sv.AutoTerminationPolicy, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetBlockPublicAccessConfigurationOutput(v **GetBlockPublicAccessConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetBlockPublicAccessConfigurationOutput
if *v == nil {
sv = &GetBlockPublicAccessConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BlockPublicAccessConfiguration":
if err := awsAwsjson11_deserializeDocumentBlockPublicAccessConfiguration(&sv.BlockPublicAccessConfiguration, value); err != nil {
return err
}
case "BlockPublicAccessConfigurationMetadata":
if err := awsAwsjson11_deserializeDocumentBlockPublicAccessConfigurationMetadata(&sv.BlockPublicAccessConfigurationMetadata, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetClusterSessionCredentialsOutput(v **GetClusterSessionCredentialsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetClusterSessionCredentialsOutput
if *v == nil {
sv = &GetClusterSessionCredentialsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Credentials":
if err := awsAwsjson11_deserializeDocumentCredentials(&sv.Credentials, value); err != nil {
return err
}
case "ExpiresAt":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ExpiresAt = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetManagedScalingPolicyOutput(v **GetManagedScalingPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetManagedScalingPolicyOutput
if *v == nil {
sv = &GetManagedScalingPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ManagedScalingPolicy":
if err := awsAwsjson11_deserializeDocumentManagedScalingPolicy(&sv.ManagedScalingPolicy, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetStudioSessionMappingOutput(v **GetStudioSessionMappingOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetStudioSessionMappingOutput
if *v == nil {
sv = &GetStudioSessionMappingOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SessionMapping":
if err := awsAwsjson11_deserializeDocumentSessionMappingDetail(&sv.SessionMapping, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListBootstrapActionsOutput(v **ListBootstrapActionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListBootstrapActionsOutput
if *v == nil {
sv = &ListBootstrapActionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BootstrapActions":
if err := awsAwsjson11_deserializeDocumentCommandList(&sv.BootstrapActions, value); err != nil {
return err
}
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListClustersOutput(v **ListClustersOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListClustersOutput
if *v == nil {
sv = &ListClustersOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Clusters":
if err := awsAwsjson11_deserializeDocumentClusterSummaryList(&sv.Clusters, value); err != nil {
return err
}
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListInstanceFleetsOutput(v **ListInstanceFleetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListInstanceFleetsOutput
if *v == nil {
sv = &ListInstanceFleetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InstanceFleets":
if err := awsAwsjson11_deserializeDocumentInstanceFleetList(&sv.InstanceFleets, value); err != nil {
return err
}
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListInstanceGroupsOutput(v **ListInstanceGroupsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListInstanceGroupsOutput
if *v == nil {
sv = &ListInstanceGroupsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InstanceGroups":
if err := awsAwsjson11_deserializeDocumentInstanceGroupList(&sv.InstanceGroups, value); err != nil {
return err
}
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListInstancesOutput(v **ListInstancesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListInstancesOutput
if *v == nil {
sv = &ListInstancesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Instances":
if err := awsAwsjson11_deserializeDocumentInstanceList(&sv.Instances, value); err != nil {
return err
}
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListNotebookExecutionsOutput(v **ListNotebookExecutionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListNotebookExecutionsOutput
if *v == nil {
sv = &ListNotebookExecutionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
case "NotebookExecutions":
if err := awsAwsjson11_deserializeDocumentNotebookExecutionSummaryList(&sv.NotebookExecutions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListReleaseLabelsOutput(v **ListReleaseLabelsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListReleaseLabelsOutput
if *v == nil {
sv = &ListReleaseLabelsOutput{}
} 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 String to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "ReleaseLabels":
if err := awsAwsjson11_deserializeDocumentStringList(&sv.ReleaseLabels, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListSecurityConfigurationsOutput(v **ListSecurityConfigurationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSecurityConfigurationsOutput
if *v == nil {
sv = &ListSecurityConfigurationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
case "SecurityConfigurations":
if err := awsAwsjson11_deserializeDocumentSecurityConfigurationList(&sv.SecurityConfigurations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListStepsOutput(v **ListStepsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListStepsOutput
if *v == nil {
sv = &ListStepsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
case "Steps":
if err := awsAwsjson11_deserializeDocumentStepSummaryList(&sv.Steps, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListStudioSessionMappingsOutput(v **ListStudioSessionMappingsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListStudioSessionMappingsOutput
if *v == nil {
sv = &ListStudioSessionMappingsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
case "SessionMappings":
if err := awsAwsjson11_deserializeDocumentSessionMappingSummaryList(&sv.SessionMappings, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListStudiosOutput(v **ListStudiosOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListStudiosOutput
if *v == nil {
sv = &ListStudiosOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Marker to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
case "Studios":
if err := awsAwsjson11_deserializeDocumentStudioSummaryList(&sv.Studios, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListSupportedInstanceTypesOutput(v **ListSupportedInstanceTypesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSupportedInstanceTypesOutput
if *v == nil {
sv = &ListSupportedInstanceTypesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Marker":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Marker = ptr.String(jtv)
}
case "SupportedInstanceTypes":
if err := awsAwsjson11_deserializeDocumentSupportedInstanceTypesList(&sv.SupportedInstanceTypes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentModifyClusterOutput(v **ModifyClusterOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ModifyClusterOutput
if *v == nil {
sv = &ModifyClusterOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "StepConcurrencyLevel":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.StepConcurrencyLevel = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutAutoScalingPolicyOutput(v **PutAutoScalingPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutAutoScalingPolicyOutput
if *v == nil {
sv = &PutAutoScalingPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AutoScalingPolicy":
if err := awsAwsjson11_deserializeDocumentAutoScalingPolicyDescription(&sv.AutoScalingPolicy, value); err != nil {
return err
}
case "ClusterArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ArnType to be of type string, got %T instead", value)
}
sv.ClusterArn = ptr.String(jtv)
}
case "ClusterId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClusterId to be of type string, got %T instead", value)
}
sv.ClusterId = ptr.String(jtv)
}
case "InstanceGroupId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InstanceGroupId to be of type string, got %T instead", value)
}
sv.InstanceGroupId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutAutoTerminationPolicyOutput(v **PutAutoTerminationPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutAutoTerminationPolicyOutput
if *v == nil {
sv = &PutAutoTerminationPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutBlockPublicAccessConfigurationOutput(v **PutBlockPublicAccessConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutBlockPublicAccessConfigurationOutput
if *v == nil {
sv = &PutBlockPublicAccessConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutManagedScalingPolicyOutput(v **PutManagedScalingPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutManagedScalingPolicyOutput
if *v == nil {
sv = &PutManagedScalingPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentRemoveAutoScalingPolicyOutput(v **RemoveAutoScalingPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RemoveAutoScalingPolicyOutput
if *v == nil {
sv = &RemoveAutoScalingPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentRemoveAutoTerminationPolicyOutput(v **RemoveAutoTerminationPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RemoveAutoTerminationPolicyOutput
if *v == nil {
sv = &RemoveAutoTerminationPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentRemoveManagedScalingPolicyOutput(v **RemoveManagedScalingPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RemoveManagedScalingPolicyOutput
if *v == nil {
sv = &RemoveManagedScalingPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentRemoveTagsOutput(v **RemoveTagsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RemoveTagsOutput
if *v == nil {
sv = &RemoveTagsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentRunJobFlowOutput(v **RunJobFlowOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *RunJobFlowOutput
if *v == nil {
sv = &RunJobFlowOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ClusterArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ArnType to be of type string, got %T instead", value)
}
sv.ClusterArn = ptr.String(jtv)
}
case "JobFlowId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.JobFlowId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStartNotebookExecutionOutput(v **StartNotebookExecutionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartNotebookExecutionOutput
if *v == nil {
sv = &StartNotebookExecutionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "NotebookExecutionId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected XmlStringMaxLen256 to be of type string, got %T instead", value)
}
sv.NotebookExecutionId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 15,972 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package emr provides the API client, operations, and parameter types for Amazon
// EMR.
//
// Amazon EMR is a web service that makes it easier to process large amounts of
// data efficiently. Amazon EMR uses Hadoop processing combined with several Amazon
// Web Services services to do tasks such as web indexing, data mining, log file
// analysis, machine learning, scientific simulation, and data warehouse
// management.
package emr
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
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/emr/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 = "elasticmapreduce"
}
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 emr
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.27.0"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/emr/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"math"
"path"
)
type awsAwsjson11_serializeOpAddInstanceFleet struct {
}
func (*awsAwsjson11_serializeOpAddInstanceFleet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddInstanceFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddInstanceFleetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.AddInstanceFleet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddInstanceFleetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpAddInstanceGroups struct {
}
func (*awsAwsjson11_serializeOpAddInstanceGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddInstanceGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddInstanceGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.AddInstanceGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddInstanceGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpAddJobFlowSteps struct {
}
func (*awsAwsjson11_serializeOpAddJobFlowSteps) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddJobFlowSteps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddJobFlowStepsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.AddJobFlowSteps")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddJobFlowStepsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpAddTags struct {
}
func (*awsAwsjson11_serializeOpAddTags) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpAddTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*AddTagsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.AddTags")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentAddTagsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCancelSteps struct {
}
func (*awsAwsjson11_serializeOpCancelSteps) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCancelSteps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CancelStepsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.CancelSteps")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCancelStepsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateSecurityConfiguration struct {
}
func (*awsAwsjson11_serializeOpCreateSecurityConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateSecurityConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSecurityConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.CreateSecurityConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateSecurityConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateStudio struct {
}
func (*awsAwsjson11_serializeOpCreateStudio) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateStudio) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateStudioInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.CreateStudio")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateStudioInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpCreateStudioSessionMapping struct {
}
func (*awsAwsjson11_serializeOpCreateStudioSessionMapping) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateStudioSessionMapping) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateStudioSessionMappingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.CreateStudioSessionMapping")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateStudioSessionMappingInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteSecurityConfiguration struct {
}
func (*awsAwsjson11_serializeOpDeleteSecurityConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteSecurityConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSecurityConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DeleteSecurityConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteSecurityConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteStudio struct {
}
func (*awsAwsjson11_serializeOpDeleteStudio) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteStudio) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteStudioInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DeleteStudio")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteStudioInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDeleteStudioSessionMapping struct {
}
func (*awsAwsjson11_serializeOpDeleteStudioSessionMapping) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteStudioSessionMapping) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteStudioSessionMappingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DeleteStudioSessionMapping")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteStudioSessionMappingInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeCluster struct {
}
func (*awsAwsjson11_serializeOpDescribeCluster) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeClusterInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DescribeCluster")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeClusterInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeJobFlows struct {
}
func (*awsAwsjson11_serializeOpDescribeJobFlows) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeJobFlows) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeJobFlowsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DescribeJobFlows")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeJobFlowsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeNotebookExecution struct {
}
func (*awsAwsjson11_serializeOpDescribeNotebookExecution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeNotebookExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeNotebookExecutionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DescribeNotebookExecution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeNotebookExecutionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeReleaseLabel struct {
}
func (*awsAwsjson11_serializeOpDescribeReleaseLabel) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeReleaseLabel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeReleaseLabelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DescribeReleaseLabel")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeReleaseLabelInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeSecurityConfiguration struct {
}
func (*awsAwsjson11_serializeOpDescribeSecurityConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeSecurityConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeSecurityConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DescribeSecurityConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeSecurityConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeStep struct {
}
func (*awsAwsjson11_serializeOpDescribeStep) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeStep) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStepInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DescribeStep")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeStepInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpDescribeStudio struct {
}
func (*awsAwsjson11_serializeOpDescribeStudio) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeStudio) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeStudioInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.DescribeStudio")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeStudioInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetAutoTerminationPolicy struct {
}
func (*awsAwsjson11_serializeOpGetAutoTerminationPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetAutoTerminationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetAutoTerminationPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.GetAutoTerminationPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetAutoTerminationPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetBlockPublicAccessConfiguration struct {
}
func (*awsAwsjson11_serializeOpGetBlockPublicAccessConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetBlockPublicAccessConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetBlockPublicAccessConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.GetBlockPublicAccessConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetBlockPublicAccessConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetClusterSessionCredentials struct {
}
func (*awsAwsjson11_serializeOpGetClusterSessionCredentials) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetClusterSessionCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetClusterSessionCredentialsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.GetClusterSessionCredentials")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetClusterSessionCredentialsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetManagedScalingPolicy struct {
}
func (*awsAwsjson11_serializeOpGetManagedScalingPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetManagedScalingPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetManagedScalingPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.GetManagedScalingPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetManagedScalingPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpGetStudioSessionMapping struct {
}
func (*awsAwsjson11_serializeOpGetStudioSessionMapping) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetStudioSessionMapping) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetStudioSessionMappingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.GetStudioSessionMapping")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetStudioSessionMappingInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListBootstrapActions struct {
}
func (*awsAwsjson11_serializeOpListBootstrapActions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListBootstrapActions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListBootstrapActionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListBootstrapActions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListBootstrapActionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListClusters struct {
}
func (*awsAwsjson11_serializeOpListClusters) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListClusters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListClustersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListClusters")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListClustersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListInstanceFleets struct {
}
func (*awsAwsjson11_serializeOpListInstanceFleets) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListInstanceFleets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListInstanceFleetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListInstanceFleets")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListInstanceFleetsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListInstanceGroups struct {
}
func (*awsAwsjson11_serializeOpListInstanceGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListInstanceGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListInstanceGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListInstanceGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListInstanceGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListInstances struct {
}
func (*awsAwsjson11_serializeOpListInstances) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListInstances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListInstancesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListInstances")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListInstancesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListNotebookExecutions struct {
}
func (*awsAwsjson11_serializeOpListNotebookExecutions) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListNotebookExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListNotebookExecutionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListNotebookExecutions")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListNotebookExecutionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListReleaseLabels struct {
}
func (*awsAwsjson11_serializeOpListReleaseLabels) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListReleaseLabels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListReleaseLabelsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListReleaseLabels")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListReleaseLabelsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListSecurityConfigurations struct {
}
func (*awsAwsjson11_serializeOpListSecurityConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListSecurityConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSecurityConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListSecurityConfigurations")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListSecurityConfigurationsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListSteps struct {
}
func (*awsAwsjson11_serializeOpListSteps) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListSteps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListStepsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListSteps")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListStepsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListStudios struct {
}
func (*awsAwsjson11_serializeOpListStudios) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListStudios) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListStudiosInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListStudios")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListStudiosInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListStudioSessionMappings struct {
}
func (*awsAwsjson11_serializeOpListStudioSessionMappings) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListStudioSessionMappings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListStudioSessionMappingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListStudioSessionMappings")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListStudioSessionMappingsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListSupportedInstanceTypes struct {
}
func (*awsAwsjson11_serializeOpListSupportedInstanceTypes) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListSupportedInstanceTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSupportedInstanceTypesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ListSupportedInstanceTypes")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListSupportedInstanceTypesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpModifyCluster struct {
}
func (*awsAwsjson11_serializeOpModifyCluster) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpModifyCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ModifyClusterInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ModifyCluster")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentModifyClusterInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpModifyInstanceFleet struct {
}
func (*awsAwsjson11_serializeOpModifyInstanceFleet) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpModifyInstanceFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ModifyInstanceFleetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ModifyInstanceFleet")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentModifyInstanceFleetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpModifyInstanceGroups struct {
}
func (*awsAwsjson11_serializeOpModifyInstanceGroups) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpModifyInstanceGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ModifyInstanceGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.ModifyInstanceGroups")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentModifyInstanceGroupsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutAutoScalingPolicy struct {
}
func (*awsAwsjson11_serializeOpPutAutoScalingPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutAutoScalingPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutAutoScalingPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.PutAutoScalingPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutAutoScalingPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutAutoTerminationPolicy struct {
}
func (*awsAwsjson11_serializeOpPutAutoTerminationPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutAutoTerminationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutAutoTerminationPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.PutAutoTerminationPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutAutoTerminationPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutBlockPublicAccessConfiguration struct {
}
func (*awsAwsjson11_serializeOpPutBlockPublicAccessConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutBlockPublicAccessConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutBlockPublicAccessConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.PutBlockPublicAccessConfiguration")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutBlockPublicAccessConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutManagedScalingPolicy struct {
}
func (*awsAwsjson11_serializeOpPutManagedScalingPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutManagedScalingPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutManagedScalingPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.PutManagedScalingPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutManagedScalingPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRemoveAutoScalingPolicy struct {
}
func (*awsAwsjson11_serializeOpRemoveAutoScalingPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRemoveAutoScalingPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RemoveAutoScalingPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.RemoveAutoScalingPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRemoveAutoScalingPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRemoveAutoTerminationPolicy struct {
}
func (*awsAwsjson11_serializeOpRemoveAutoTerminationPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRemoveAutoTerminationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RemoveAutoTerminationPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.RemoveAutoTerminationPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRemoveAutoTerminationPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRemoveManagedScalingPolicy struct {
}
func (*awsAwsjson11_serializeOpRemoveManagedScalingPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRemoveManagedScalingPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RemoveManagedScalingPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.RemoveManagedScalingPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRemoveManagedScalingPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRemoveTags struct {
}
func (*awsAwsjson11_serializeOpRemoveTags) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRemoveTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RemoveTagsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.RemoveTags")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRemoveTagsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpRunJobFlow struct {
}
func (*awsAwsjson11_serializeOpRunJobFlow) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpRunJobFlow) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RunJobFlowInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.RunJobFlow")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentRunJobFlowInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSetTerminationProtection struct {
}
func (*awsAwsjson11_serializeOpSetTerminationProtection) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSetTerminationProtection) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SetTerminationProtectionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.SetTerminationProtection")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSetTerminationProtectionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpSetVisibleToAllUsers struct {
}
func (*awsAwsjson11_serializeOpSetVisibleToAllUsers) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpSetVisibleToAllUsers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*SetVisibleToAllUsersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.SetVisibleToAllUsers")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentSetVisibleToAllUsersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStartNotebookExecution struct {
}
func (*awsAwsjson11_serializeOpStartNotebookExecution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartNotebookExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartNotebookExecutionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.StartNotebookExecution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartNotebookExecutionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpStopNotebookExecution struct {
}
func (*awsAwsjson11_serializeOpStopNotebookExecution) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopNotebookExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopNotebookExecutionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.StopNotebookExecution")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopNotebookExecutionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTerminateJobFlows struct {
}
func (*awsAwsjson11_serializeOpTerminateJobFlows) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTerminateJobFlows) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TerminateJobFlowsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.TerminateJobFlows")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTerminateJobFlowsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateStudio struct {
}
func (*awsAwsjson11_serializeOpUpdateStudio) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateStudio) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateStudioInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.UpdateStudio")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateStudioInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUpdateStudioSessionMapping struct {
}
func (*awsAwsjson11_serializeOpUpdateStudioSessionMapping) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUpdateStudioSessionMapping) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateStudioSessionMappingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("ElasticMapReduce.UpdateStudioSessionMapping")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUpdateStudioSessionMappingInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if 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_serializeDocumentApplication(v *types.Application, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalInfo != nil {
ok := object.Key("AdditionalInfo")
if err := awsAwsjson11_serializeDocumentStringMap(v.AdditionalInfo, ok); err != nil {
return err
}
}
if v.Args != nil {
ok := object.Key("Args")
if err := awsAwsjson11_serializeDocumentStringList(v.Args, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Version != nil {
ok := object.Key("Version")
ok.String(*v.Version)
}
return nil
}
func awsAwsjson11_serializeDocumentApplicationList(v []types.Application, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentApplication(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAutoScalingPolicy(v *types.AutoScalingPolicy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Constraints != nil {
ok := object.Key("Constraints")
if err := awsAwsjson11_serializeDocumentScalingConstraints(v.Constraints, ok); err != nil {
return err
}
}
if v.Rules != nil {
ok := object.Key("Rules")
if err := awsAwsjson11_serializeDocumentScalingRuleList(v.Rules, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentAutoTerminationPolicy(v *types.AutoTerminationPolicy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IdleTimeout != 0 {
ok := object.Key("IdleTimeout")
ok.Long(v.IdleTimeout)
}
return nil
}
func awsAwsjson11_serializeDocumentBlockPublicAccessConfiguration(v *types.BlockPublicAccessConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("BlockPublicSecurityGroupRules")
ok.Boolean(v.BlockPublicSecurityGroupRules)
}
if v.Classification != nil {
ok := object.Key("Classification")
ok.String(*v.Classification)
}
if v.Configurations != nil {
ok := object.Key("Configurations")
if err := awsAwsjson11_serializeDocumentConfigurationList(v.Configurations, ok); err != nil {
return err
}
}
if v.PermittedPublicSecurityGroupRuleRanges != nil {
ok := object.Key("PermittedPublicSecurityGroupRuleRanges")
if err := awsAwsjson11_serializeDocumentPortRanges(v.PermittedPublicSecurityGroupRuleRanges, ok); err != nil {
return err
}
}
if v.Properties != nil {
ok := object.Key("Properties")
if err := awsAwsjson11_serializeDocumentStringMap(v.Properties, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentBootstrapActionConfig(v *types.BootstrapActionConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.ScriptBootstrapAction != nil {
ok := object.Key("ScriptBootstrapAction")
if err := awsAwsjson11_serializeDocumentScriptBootstrapActionConfig(v.ScriptBootstrapAction, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentBootstrapActionConfigList(v []types.BootstrapActionConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentBootstrapActionConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCloudWatchAlarmDefinition(v *types.CloudWatchAlarmDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ComparisonOperator) > 0 {
ok := object.Key("ComparisonOperator")
ok.String(string(v.ComparisonOperator))
}
if v.Dimensions != nil {
ok := object.Key("Dimensions")
if err := awsAwsjson11_serializeDocumentMetricDimensionList(v.Dimensions, ok); err != nil {
return err
}
}
if v.EvaluationPeriods != nil {
ok := object.Key("EvaluationPeriods")
ok.Integer(*v.EvaluationPeriods)
}
if v.MetricName != nil {
ok := object.Key("MetricName")
ok.String(*v.MetricName)
}
if v.Namespace != nil {
ok := object.Key("Namespace")
ok.String(*v.Namespace)
}
if v.Period != nil {
ok := object.Key("Period")
ok.Integer(*v.Period)
}
if len(v.Statistic) > 0 {
ok := object.Key("Statistic")
ok.String(string(v.Statistic))
}
if v.Threshold != nil {
ok := object.Key("Threshold")
switch {
case math.IsNaN(*v.Threshold):
ok.String("NaN")
case math.IsInf(*v.Threshold, 1):
ok.String("Infinity")
case math.IsInf(*v.Threshold, -1):
ok.String("-Infinity")
default:
ok.Double(*v.Threshold)
}
}
if len(v.Unit) > 0 {
ok := object.Key("Unit")
ok.String(string(v.Unit))
}
return nil
}
func awsAwsjson11_serializeDocumentClusterStateList(v []types.ClusterState, 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_serializeDocumentComputeLimits(v *types.ComputeLimits, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaximumCapacityUnits != nil {
ok := object.Key("MaximumCapacityUnits")
ok.Integer(*v.MaximumCapacityUnits)
}
if v.MaximumCoreCapacityUnits != nil {
ok := object.Key("MaximumCoreCapacityUnits")
ok.Integer(*v.MaximumCoreCapacityUnits)
}
if v.MaximumOnDemandCapacityUnits != nil {
ok := object.Key("MaximumOnDemandCapacityUnits")
ok.Integer(*v.MaximumOnDemandCapacityUnits)
}
if v.MinimumCapacityUnits != nil {
ok := object.Key("MinimumCapacityUnits")
ok.Integer(*v.MinimumCapacityUnits)
}
if len(v.UnitType) > 0 {
ok := object.Key("UnitType")
ok.String(string(v.UnitType))
}
return nil
}
func awsAwsjson11_serializeDocumentConfiguration(v *types.Configuration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Classification != nil {
ok := object.Key("Classification")
ok.String(*v.Classification)
}
if v.Configurations != nil {
ok := object.Key("Configurations")
if err := awsAwsjson11_serializeDocumentConfigurationList(v.Configurations, ok); err != nil {
return err
}
}
if v.Properties != nil {
ok := object.Key("Properties")
if err := awsAwsjson11_serializeDocumentStringMap(v.Properties, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentConfigurationList(v []types.Configuration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentEbsBlockDeviceConfig(v *types.EbsBlockDeviceConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VolumeSpecification != nil {
ok := object.Key("VolumeSpecification")
if err := awsAwsjson11_serializeDocumentVolumeSpecification(v.VolumeSpecification, ok); err != nil {
return err
}
}
if v.VolumesPerInstance != nil {
ok := object.Key("VolumesPerInstance")
ok.Integer(*v.VolumesPerInstance)
}
return nil
}
func awsAwsjson11_serializeDocumentEbsBlockDeviceConfigList(v []types.EbsBlockDeviceConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentEbsBlockDeviceConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentEbsConfiguration(v *types.EbsConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EbsBlockDeviceConfigs != nil {
ok := object.Key("EbsBlockDeviceConfigs")
if err := awsAwsjson11_serializeDocumentEbsBlockDeviceConfigList(v.EbsBlockDeviceConfigs, ok); err != nil {
return err
}
}
if v.EbsOptimized != nil {
ok := object.Key("EbsOptimized")
ok.Boolean(*v.EbsOptimized)
}
return nil
}
func awsAwsjson11_serializeDocumentEC2InstanceIdsList(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_serializeDocumentEC2InstanceIdsToTerminateList(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_serializeDocumentEnvironmentVariablesMap(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_serializeDocumentExecutionEngineConfig(v *types.ExecutionEngineConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExecutionRoleArn != nil {
ok := object.Key("ExecutionRoleArn")
ok.String(*v.ExecutionRoleArn)
}
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if v.MasterInstanceSecurityGroupId != nil {
ok := object.Key("MasterInstanceSecurityGroupId")
ok.String(*v.MasterInstanceSecurityGroupId)
}
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
return nil
}
func awsAwsjson11_serializeDocumentHadoopJarStepConfig(v *types.HadoopJarStepConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Args != nil {
ok := object.Key("Args")
if err := awsAwsjson11_serializeDocumentXmlStringList(v.Args, ok); err != nil {
return err
}
}
if v.Jar != nil {
ok := object.Key("Jar")
ok.String(*v.Jar)
}
if v.MainClass != nil {
ok := object.Key("MainClass")
ok.String(*v.MainClass)
}
if v.Properties != nil {
ok := object.Key("Properties")
if err := awsAwsjson11_serializeDocumentKeyValueList(v.Properties, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceFleetConfig(v *types.InstanceFleetConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.InstanceFleetType) > 0 {
ok := object.Key("InstanceFleetType")
ok.String(string(v.InstanceFleetType))
}
if v.InstanceTypeConfigs != nil {
ok := object.Key("InstanceTypeConfigs")
if err := awsAwsjson11_serializeDocumentInstanceTypeConfigList(v.InstanceTypeConfigs, ok); err != nil {
return err
}
}
if v.LaunchSpecifications != nil {
ok := object.Key("LaunchSpecifications")
if err := awsAwsjson11_serializeDocumentInstanceFleetProvisioningSpecifications(v.LaunchSpecifications, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.ResizeSpecifications != nil {
ok := object.Key("ResizeSpecifications")
if err := awsAwsjson11_serializeDocumentInstanceFleetResizingSpecifications(v.ResizeSpecifications, ok); err != nil {
return err
}
}
if v.TargetOnDemandCapacity != nil {
ok := object.Key("TargetOnDemandCapacity")
ok.Integer(*v.TargetOnDemandCapacity)
}
if v.TargetSpotCapacity != nil {
ok := object.Key("TargetSpotCapacity")
ok.Integer(*v.TargetSpotCapacity)
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceFleetConfigList(v []types.InstanceFleetConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentInstanceFleetConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceFleetModifyConfig(v *types.InstanceFleetModifyConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceFleetId != nil {
ok := object.Key("InstanceFleetId")
ok.String(*v.InstanceFleetId)
}
if v.ResizeSpecifications != nil {
ok := object.Key("ResizeSpecifications")
if err := awsAwsjson11_serializeDocumentInstanceFleetResizingSpecifications(v.ResizeSpecifications, ok); err != nil {
return err
}
}
if v.TargetOnDemandCapacity != nil {
ok := object.Key("TargetOnDemandCapacity")
ok.Integer(*v.TargetOnDemandCapacity)
}
if v.TargetSpotCapacity != nil {
ok := object.Key("TargetSpotCapacity")
ok.Integer(*v.TargetSpotCapacity)
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceFleetProvisioningSpecifications(v *types.InstanceFleetProvisioningSpecifications, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.OnDemandSpecification != nil {
ok := object.Key("OnDemandSpecification")
if err := awsAwsjson11_serializeDocumentOnDemandProvisioningSpecification(v.OnDemandSpecification, ok); err != nil {
return err
}
}
if v.SpotSpecification != nil {
ok := object.Key("SpotSpecification")
if err := awsAwsjson11_serializeDocumentSpotProvisioningSpecification(v.SpotSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceFleetResizingSpecifications(v *types.InstanceFleetResizingSpecifications, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.OnDemandResizeSpecification != nil {
ok := object.Key("OnDemandResizeSpecification")
if err := awsAwsjson11_serializeDocumentOnDemandResizingSpecification(v.OnDemandResizeSpecification, ok); err != nil {
return err
}
}
if v.SpotResizeSpecification != nil {
ok := object.Key("SpotResizeSpecification")
if err := awsAwsjson11_serializeDocumentSpotResizingSpecification(v.SpotResizeSpecification, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceGroupConfig(v *types.InstanceGroupConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AutoScalingPolicy != nil {
ok := object.Key("AutoScalingPolicy")
if err := awsAwsjson11_serializeDocumentAutoScalingPolicy(v.AutoScalingPolicy, ok); err != nil {
return err
}
}
if v.BidPrice != nil {
ok := object.Key("BidPrice")
ok.String(*v.BidPrice)
}
if v.Configurations != nil {
ok := object.Key("Configurations")
if err := awsAwsjson11_serializeDocumentConfigurationList(v.Configurations, ok); err != nil {
return err
}
}
if v.CustomAmiId != nil {
ok := object.Key("CustomAmiId")
ok.String(*v.CustomAmiId)
}
if v.EbsConfiguration != nil {
ok := object.Key("EbsConfiguration")
if err := awsAwsjson11_serializeDocumentEbsConfiguration(v.EbsConfiguration, ok); err != nil {
return err
}
}
if v.InstanceCount != nil {
ok := object.Key("InstanceCount")
ok.Integer(*v.InstanceCount)
}
if len(v.InstanceRole) > 0 {
ok := object.Key("InstanceRole")
ok.String(string(v.InstanceRole))
}
if v.InstanceType != nil {
ok := object.Key("InstanceType")
ok.String(*v.InstanceType)
}
if len(v.Market) > 0 {
ok := object.Key("Market")
ok.String(string(v.Market))
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceGroupConfigList(v []types.InstanceGroupConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentInstanceGroupConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceGroupModifyConfig(v *types.InstanceGroupModifyConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Configurations != nil {
ok := object.Key("Configurations")
if err := awsAwsjson11_serializeDocumentConfigurationList(v.Configurations, ok); err != nil {
return err
}
}
if v.EC2InstanceIdsToTerminate != nil {
ok := object.Key("EC2InstanceIdsToTerminate")
if err := awsAwsjson11_serializeDocumentEC2InstanceIdsToTerminateList(v.EC2InstanceIdsToTerminate, ok); err != nil {
return err
}
}
if v.InstanceCount != nil {
ok := object.Key("InstanceCount")
ok.Integer(*v.InstanceCount)
}
if v.InstanceGroupId != nil {
ok := object.Key("InstanceGroupId")
ok.String(*v.InstanceGroupId)
}
if len(v.ReconfigurationType) > 0 {
ok := object.Key("ReconfigurationType")
ok.String(string(v.ReconfigurationType))
}
if v.ShrinkPolicy != nil {
ok := object.Key("ShrinkPolicy")
if err := awsAwsjson11_serializeDocumentShrinkPolicy(v.ShrinkPolicy, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceGroupModifyConfigList(v []types.InstanceGroupModifyConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentInstanceGroupModifyConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceGroupTypeList(v []types.InstanceGroupType, 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_serializeDocumentInstanceResizePolicy(v *types.InstanceResizePolicy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstancesToProtect != nil {
ok := object.Key("InstancesToProtect")
if err := awsAwsjson11_serializeDocumentEC2InstanceIdsList(v.InstancesToProtect, ok); err != nil {
return err
}
}
if v.InstancesToTerminate != nil {
ok := object.Key("InstancesToTerminate")
if err := awsAwsjson11_serializeDocumentEC2InstanceIdsList(v.InstancesToTerminate, ok); err != nil {
return err
}
}
if v.InstanceTerminationTimeout != nil {
ok := object.Key("InstanceTerminationTimeout")
ok.Integer(*v.InstanceTerminationTimeout)
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceStateList(v []types.InstanceState, 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_serializeDocumentInstanceTypeConfig(v *types.InstanceTypeConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BidPrice != nil {
ok := object.Key("BidPrice")
ok.String(*v.BidPrice)
}
if v.BidPriceAsPercentageOfOnDemandPrice != nil {
ok := object.Key("BidPriceAsPercentageOfOnDemandPrice")
switch {
case math.IsNaN(*v.BidPriceAsPercentageOfOnDemandPrice):
ok.String("NaN")
case math.IsInf(*v.BidPriceAsPercentageOfOnDemandPrice, 1):
ok.String("Infinity")
case math.IsInf(*v.BidPriceAsPercentageOfOnDemandPrice, -1):
ok.String("-Infinity")
default:
ok.Double(*v.BidPriceAsPercentageOfOnDemandPrice)
}
}
if v.Configurations != nil {
ok := object.Key("Configurations")
if err := awsAwsjson11_serializeDocumentConfigurationList(v.Configurations, ok); err != nil {
return err
}
}
if v.CustomAmiId != nil {
ok := object.Key("CustomAmiId")
ok.String(*v.CustomAmiId)
}
if v.EbsConfiguration != nil {
ok := object.Key("EbsConfiguration")
if err := awsAwsjson11_serializeDocumentEbsConfiguration(v.EbsConfiguration, ok); err != nil {
return err
}
}
if v.InstanceType != nil {
ok := object.Key("InstanceType")
ok.String(*v.InstanceType)
}
if v.WeightedCapacity != nil {
ok := object.Key("WeightedCapacity")
ok.Integer(*v.WeightedCapacity)
}
return nil
}
func awsAwsjson11_serializeDocumentInstanceTypeConfigList(v []types.InstanceTypeConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentInstanceTypeConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentJobFlowExecutionStateList(v []types.JobFlowExecutionState, 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_serializeDocumentJobFlowInstancesConfig(v *types.JobFlowInstancesConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalMasterSecurityGroups != nil {
ok := object.Key("AdditionalMasterSecurityGroups")
if err := awsAwsjson11_serializeDocumentSecurityGroupsList(v.AdditionalMasterSecurityGroups, ok); err != nil {
return err
}
}
if v.AdditionalSlaveSecurityGroups != nil {
ok := object.Key("AdditionalSlaveSecurityGroups")
if err := awsAwsjson11_serializeDocumentSecurityGroupsList(v.AdditionalSlaveSecurityGroups, ok); err != nil {
return err
}
}
if v.Ec2KeyName != nil {
ok := object.Key("Ec2KeyName")
ok.String(*v.Ec2KeyName)
}
if v.Ec2SubnetId != nil {
ok := object.Key("Ec2SubnetId")
ok.String(*v.Ec2SubnetId)
}
if v.Ec2SubnetIds != nil {
ok := object.Key("Ec2SubnetIds")
if err := awsAwsjson11_serializeDocumentXmlStringMaxLen256List(v.Ec2SubnetIds, ok); err != nil {
return err
}
}
if v.EmrManagedMasterSecurityGroup != nil {
ok := object.Key("EmrManagedMasterSecurityGroup")
ok.String(*v.EmrManagedMasterSecurityGroup)
}
if v.EmrManagedSlaveSecurityGroup != nil {
ok := object.Key("EmrManagedSlaveSecurityGroup")
ok.String(*v.EmrManagedSlaveSecurityGroup)
}
if v.HadoopVersion != nil {
ok := object.Key("HadoopVersion")
ok.String(*v.HadoopVersion)
}
if v.InstanceCount != nil {
ok := object.Key("InstanceCount")
ok.Integer(*v.InstanceCount)
}
if v.InstanceFleets != nil {
ok := object.Key("InstanceFleets")
if err := awsAwsjson11_serializeDocumentInstanceFleetConfigList(v.InstanceFleets, ok); err != nil {
return err
}
}
if v.InstanceGroups != nil {
ok := object.Key("InstanceGroups")
if err := awsAwsjson11_serializeDocumentInstanceGroupConfigList(v.InstanceGroups, ok); err != nil {
return err
}
}
if v.KeepJobFlowAliveWhenNoSteps {
ok := object.Key("KeepJobFlowAliveWhenNoSteps")
ok.Boolean(v.KeepJobFlowAliveWhenNoSteps)
}
if v.MasterInstanceType != nil {
ok := object.Key("MasterInstanceType")
ok.String(*v.MasterInstanceType)
}
if v.Placement != nil {
ok := object.Key("Placement")
if err := awsAwsjson11_serializeDocumentPlacementType(v.Placement, ok); err != nil {
return err
}
}
if v.ServiceAccessSecurityGroup != nil {
ok := object.Key("ServiceAccessSecurityGroup")
ok.String(*v.ServiceAccessSecurityGroup)
}
if v.SlaveInstanceType != nil {
ok := object.Key("SlaveInstanceType")
ok.String(*v.SlaveInstanceType)
}
if v.TerminationProtected {
ok := object.Key("TerminationProtected")
ok.Boolean(v.TerminationProtected)
}
return nil
}
func awsAwsjson11_serializeDocumentKerberosAttributes(v *types.KerberosAttributes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ADDomainJoinPassword != nil {
ok := object.Key("ADDomainJoinPassword")
ok.String(*v.ADDomainJoinPassword)
}
if v.ADDomainJoinUser != nil {
ok := object.Key("ADDomainJoinUser")
ok.String(*v.ADDomainJoinUser)
}
if v.CrossRealmTrustPrincipalPassword != nil {
ok := object.Key("CrossRealmTrustPrincipalPassword")
ok.String(*v.CrossRealmTrustPrincipalPassword)
}
if v.KdcAdminPassword != nil {
ok := object.Key("KdcAdminPassword")
ok.String(*v.KdcAdminPassword)
}
if v.Realm != nil {
ok := object.Key("Realm")
ok.String(*v.Realm)
}
return nil
}
func awsAwsjson11_serializeDocumentKeyValue(v *types.KeyValue, 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_serializeDocumentKeyValueList(v []types.KeyValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentKeyValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentManagedScalingPolicy(v *types.ManagedScalingPolicy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ComputeLimits != nil {
ok := object.Key("ComputeLimits")
if err := awsAwsjson11_serializeDocumentComputeLimits(v.ComputeLimits, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentMetricDimension(v *types.MetricDimension, 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_serializeDocumentMetricDimensionList(v []types.MetricDimension, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentMetricDimension(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentNewSupportedProductsList(v []types.SupportedProductConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentSupportedProductConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentNotebookS3LocationFromInput(v *types.NotebookS3LocationFromInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bucket != nil {
ok := object.Key("Bucket")
ok.String(*v.Bucket)
}
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
return nil
}
func awsAwsjson11_serializeDocumentOnDemandCapacityReservationOptions(v *types.OnDemandCapacityReservationOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.CapacityReservationPreference) > 0 {
ok := object.Key("CapacityReservationPreference")
ok.String(string(v.CapacityReservationPreference))
}
if v.CapacityReservationResourceGroupArn != nil {
ok := object.Key("CapacityReservationResourceGroupArn")
ok.String(*v.CapacityReservationResourceGroupArn)
}
if len(v.UsageStrategy) > 0 {
ok := object.Key("UsageStrategy")
ok.String(string(v.UsageStrategy))
}
return nil
}
func awsAwsjson11_serializeDocumentOnDemandProvisioningSpecification(v *types.OnDemandProvisioningSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AllocationStrategy) > 0 {
ok := object.Key("AllocationStrategy")
ok.String(string(v.AllocationStrategy))
}
if v.CapacityReservationOptions != nil {
ok := object.Key("CapacityReservationOptions")
if err := awsAwsjson11_serializeDocumentOnDemandCapacityReservationOptions(v.CapacityReservationOptions, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentOnDemandResizingSpecification(v *types.OnDemandResizingSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TimeoutDurationMinutes != nil {
ok := object.Key("TimeoutDurationMinutes")
ok.Integer(*v.TimeoutDurationMinutes)
}
return nil
}
func awsAwsjson11_serializeDocumentOutputNotebookS3LocationFromInput(v *types.OutputNotebookS3LocationFromInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bucket != nil {
ok := object.Key("Bucket")
ok.String(*v.Bucket)
}
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
return nil
}
func awsAwsjson11_serializeDocumentPlacementGroupConfig(v *types.PlacementGroupConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.InstanceRole) > 0 {
ok := object.Key("InstanceRole")
ok.String(string(v.InstanceRole))
}
if len(v.PlacementStrategy) > 0 {
ok := object.Key("PlacementStrategy")
ok.String(string(v.PlacementStrategy))
}
return nil
}
func awsAwsjson11_serializeDocumentPlacementGroupConfigList(v []types.PlacementGroupConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentPlacementGroupConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentPlacementType(v *types.PlacementType, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AvailabilityZone != nil {
ok := object.Key("AvailabilityZone")
ok.String(*v.AvailabilityZone)
}
if v.AvailabilityZones != nil {
ok := object.Key("AvailabilityZones")
if err := awsAwsjson11_serializeDocumentXmlStringMaxLen256List(v.AvailabilityZones, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentPortRange(v *types.PortRange, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxRange != nil {
ok := object.Key("MaxRange")
ok.Integer(*v.MaxRange)
}
if v.MinRange != nil {
ok := object.Key("MinRange")
ok.Integer(*v.MinRange)
}
return nil
}
func awsAwsjson11_serializeDocumentPortRanges(v []types.PortRange, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentPortRange(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentReleaseLabelFilter(v *types.ReleaseLabelFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Application != nil {
ok := object.Key("Application")
ok.String(*v.Application)
}
if v.Prefix != nil {
ok := object.Key("Prefix")
ok.String(*v.Prefix)
}
return nil
}
func awsAwsjson11_serializeDocumentScalingAction(v *types.ScalingAction, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Market) > 0 {
ok := object.Key("Market")
ok.String(string(v.Market))
}
if v.SimpleScalingPolicyConfiguration != nil {
ok := object.Key("SimpleScalingPolicyConfiguration")
if err := awsAwsjson11_serializeDocumentSimpleScalingPolicyConfiguration(v.SimpleScalingPolicyConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentScalingConstraints(v *types.ScalingConstraints, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxCapacity != nil {
ok := object.Key("MaxCapacity")
ok.Integer(*v.MaxCapacity)
}
if v.MinCapacity != nil {
ok := object.Key("MinCapacity")
ok.Integer(*v.MinCapacity)
}
return nil
}
func awsAwsjson11_serializeDocumentScalingRule(v *types.ScalingRule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("Action")
if err := awsAwsjson11_serializeDocumentScalingAction(v.Action, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Trigger != nil {
ok := object.Key("Trigger")
if err := awsAwsjson11_serializeDocumentScalingTrigger(v.Trigger, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentScalingRuleList(v []types.ScalingRule, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentScalingRule(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentScalingTrigger(v *types.ScalingTrigger, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchAlarmDefinition != nil {
ok := object.Key("CloudWatchAlarmDefinition")
if err := awsAwsjson11_serializeDocumentCloudWatchAlarmDefinition(v.CloudWatchAlarmDefinition, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentScriptBootstrapActionConfig(v *types.ScriptBootstrapActionConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Args != nil {
ok := object.Key("Args")
if err := awsAwsjson11_serializeDocumentXmlStringList(v.Args, ok); err != nil {
return err
}
}
if v.Path != nil {
ok := object.Key("Path")
ok.String(*v.Path)
}
return nil
}
func awsAwsjson11_serializeDocumentSecurityGroupsList(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_serializeDocumentShrinkPolicy(v *types.ShrinkPolicy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DecommissionTimeout != nil {
ok := object.Key("DecommissionTimeout")
ok.Integer(*v.DecommissionTimeout)
}
if v.InstanceResizePolicy != nil {
ok := object.Key("InstanceResizePolicy")
if err := awsAwsjson11_serializeDocumentInstanceResizePolicy(v.InstanceResizePolicy, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentSimpleScalingPolicyConfiguration(v *types.SimpleScalingPolicyConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AdjustmentType) > 0 {
ok := object.Key("AdjustmentType")
ok.String(string(v.AdjustmentType))
}
if v.CoolDown != nil {
ok := object.Key("CoolDown")
ok.Integer(*v.CoolDown)
}
if v.ScalingAdjustment != nil {
ok := object.Key("ScalingAdjustment")
ok.Integer(*v.ScalingAdjustment)
}
return nil
}
func awsAwsjson11_serializeDocumentSpotProvisioningSpecification(v *types.SpotProvisioningSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AllocationStrategy) > 0 {
ok := object.Key("AllocationStrategy")
ok.String(string(v.AllocationStrategy))
}
if v.BlockDurationMinutes != nil {
ok := object.Key("BlockDurationMinutes")
ok.Integer(*v.BlockDurationMinutes)
}
if len(v.TimeoutAction) > 0 {
ok := object.Key("TimeoutAction")
ok.String(string(v.TimeoutAction))
}
if v.TimeoutDurationMinutes != nil {
ok := object.Key("TimeoutDurationMinutes")
ok.Integer(*v.TimeoutDurationMinutes)
}
return nil
}
func awsAwsjson11_serializeDocumentSpotResizingSpecification(v *types.SpotResizingSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TimeoutDurationMinutes != nil {
ok := object.Key("TimeoutDurationMinutes")
ok.Integer(*v.TimeoutDurationMinutes)
}
return nil
}
func awsAwsjson11_serializeDocumentStepConfig(v *types.StepConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ActionOnFailure) > 0 {
ok := object.Key("ActionOnFailure")
ok.String(string(v.ActionOnFailure))
}
if v.HadoopJarStep != nil {
ok := object.Key("HadoopJarStep")
if err := awsAwsjson11_serializeDocumentHadoopJarStepConfig(v.HadoopJarStep, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeDocumentStepConfigList(v []types.StepConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentStepConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentStepIdsList(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_serializeDocumentStepStateList(v []types.StepState, 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_serializeDocumentStringList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentStringMap(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_serializeDocumentSubnetIdList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentSupportedProductConfig(v *types.SupportedProductConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Args != nil {
ok := object.Key("Args")
if err := awsAwsjson11_serializeDocumentXmlStringList(v.Args, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeDocumentSupportedProductsList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentVolumeSpecification(v *types.VolumeSpecification, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Iops != nil {
ok := object.Key("Iops")
ok.Integer(*v.Iops)
}
if v.SizeInGB != nil {
ok := object.Key("SizeInGB")
ok.Integer(*v.SizeInGB)
}
if v.Throughput != nil {
ok := object.Key("Throughput")
ok.Integer(*v.Throughput)
}
if v.VolumeType != nil {
ok := object.Key("VolumeType")
ok.String(*v.VolumeType)
}
return nil
}
func awsAwsjson11_serializeDocumentXmlStringList(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_serializeDocumentXmlStringMaxLen256List(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_serializeOpDocumentAddInstanceFleetInput(v *AddInstanceFleetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.InstanceFleet != nil {
ok := object.Key("InstanceFleet")
if err := awsAwsjson11_serializeDocumentInstanceFleetConfig(v.InstanceFleet, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddInstanceGroupsInput(v *AddInstanceGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.InstanceGroups != nil {
ok := object.Key("InstanceGroups")
if err := awsAwsjson11_serializeDocumentInstanceGroupConfigList(v.InstanceGroups, ok); err != nil {
return err
}
}
if v.JobFlowId != nil {
ok := object.Key("JobFlowId")
ok.String(*v.JobFlowId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddJobFlowStepsInput(v *AddJobFlowStepsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExecutionRoleArn != nil {
ok := object.Key("ExecutionRoleArn")
ok.String(*v.ExecutionRoleArn)
}
if v.JobFlowId != nil {
ok := object.Key("JobFlowId")
ok.String(*v.JobFlowId)
}
if v.Steps != nil {
ok := object.Key("Steps")
if err := awsAwsjson11_serializeDocumentStepConfigList(v.Steps, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentAddTagsInput(v *AddTagsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceId != nil {
ok := object.Key("ResourceId")
ok.String(*v.ResourceId)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCancelStepsInput(v *CancelStepsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if len(v.StepCancellationOption) > 0 {
ok := object.Key("StepCancellationOption")
ok.String(string(v.StepCancellationOption))
}
if v.StepIds != nil {
ok := object.Key("StepIds")
if err := awsAwsjson11_serializeDocumentStepIdsList(v.StepIds, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateSecurityConfigurationInput(v *CreateSecurityConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.SecurityConfiguration != nil {
ok := object.Key("SecurityConfiguration")
ok.String(*v.SecurityConfiguration)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateStudioInput(v *CreateStudioInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AuthMode) > 0 {
ok := object.Key("AuthMode")
ok.String(string(v.AuthMode))
}
if v.DefaultS3Location != nil {
ok := object.Key("DefaultS3Location")
ok.String(*v.DefaultS3Location)
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.EngineSecurityGroupId != nil {
ok := object.Key("EngineSecurityGroupId")
ok.String(*v.EngineSecurityGroupId)
}
if v.IdpAuthUrl != nil {
ok := object.Key("IdpAuthUrl")
ok.String(*v.IdpAuthUrl)
}
if v.IdpRelayStateParameterName != nil {
ok := object.Key("IdpRelayStateParameterName")
ok.String(*v.IdpRelayStateParameterName)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.ServiceRole != nil {
ok := object.Key("ServiceRole")
ok.String(*v.ServiceRole)
}
if v.SubnetIds != nil {
ok := object.Key("SubnetIds")
if err := awsAwsjson11_serializeDocumentSubnetIdList(v.SubnetIds, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.UserRole != nil {
ok := object.Key("UserRole")
ok.String(*v.UserRole)
}
if v.VpcId != nil {
ok := object.Key("VpcId")
ok.String(*v.VpcId)
}
if v.WorkspaceSecurityGroupId != nil {
ok := object.Key("WorkspaceSecurityGroupId")
ok.String(*v.WorkspaceSecurityGroupId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentCreateStudioSessionMappingInput(v *CreateStudioSessionMappingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IdentityId != nil {
ok := object.Key("IdentityId")
ok.String(*v.IdentityId)
}
if v.IdentityName != nil {
ok := object.Key("IdentityName")
ok.String(*v.IdentityName)
}
if len(v.IdentityType) > 0 {
ok := object.Key("IdentityType")
ok.String(string(v.IdentityType))
}
if v.SessionPolicyArn != nil {
ok := object.Key("SessionPolicyArn")
ok.String(*v.SessionPolicyArn)
}
if v.StudioId != nil {
ok := object.Key("StudioId")
ok.String(*v.StudioId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteSecurityConfigurationInput(v *DeleteSecurityConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteStudioInput(v *DeleteStudioInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StudioId != nil {
ok := object.Key("StudioId")
ok.String(*v.StudioId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteStudioSessionMappingInput(v *DeleteStudioSessionMappingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IdentityId != nil {
ok := object.Key("IdentityId")
ok.String(*v.IdentityId)
}
if v.IdentityName != nil {
ok := object.Key("IdentityName")
ok.String(*v.IdentityName)
}
if len(v.IdentityType) > 0 {
ok := object.Key("IdentityType")
ok.String(string(v.IdentityType))
}
if v.StudioId != nil {
ok := object.Key("StudioId")
ok.String(*v.StudioId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeClusterInput(v *DescribeClusterInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeJobFlowsInput(v *DescribeJobFlowsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CreatedAfter != nil {
ok := object.Key("CreatedAfter")
ok.Double(smithytime.FormatEpochSeconds(*v.CreatedAfter))
}
if v.CreatedBefore != nil {
ok := object.Key("CreatedBefore")
ok.Double(smithytime.FormatEpochSeconds(*v.CreatedBefore))
}
if v.JobFlowIds != nil {
ok := object.Key("JobFlowIds")
if err := awsAwsjson11_serializeDocumentXmlStringList(v.JobFlowIds, ok); err != nil {
return err
}
}
if v.JobFlowStates != nil {
ok := object.Key("JobFlowStates")
if err := awsAwsjson11_serializeDocumentJobFlowExecutionStateList(v.JobFlowStates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeNotebookExecutionInput(v *DescribeNotebookExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NotebookExecutionId != nil {
ok := object.Key("NotebookExecutionId")
ok.String(*v.NotebookExecutionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeReleaseLabelInput(v *DescribeReleaseLabelInput, 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.ReleaseLabel != nil {
ok := object.Key("ReleaseLabel")
ok.String(*v.ReleaseLabel)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeSecurityConfigurationInput(v *DescribeSecurityConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeStepInput(v *DescribeStepInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.StepId != nil {
ok := object.Key("StepId")
ok.String(*v.StepId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeStudioInput(v *DescribeStudioInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StudioId != nil {
ok := object.Key("StudioId")
ok.String(*v.StudioId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetAutoTerminationPolicyInput(v *GetAutoTerminationPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetBlockPublicAccessConfigurationInput(v *GetBlockPublicAccessConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsAwsjson11_serializeOpDocumentGetClusterSessionCredentialsInput(v *GetClusterSessionCredentialsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.ExecutionRoleArn != nil {
ok := object.Key("ExecutionRoleArn")
ok.String(*v.ExecutionRoleArn)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetManagedScalingPolicyInput(v *GetManagedScalingPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetStudioSessionMappingInput(v *GetStudioSessionMappingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IdentityId != nil {
ok := object.Key("IdentityId")
ok.String(*v.IdentityId)
}
if v.IdentityName != nil {
ok := object.Key("IdentityName")
ok.String(*v.IdentityName)
}
if len(v.IdentityType) > 0 {
ok := object.Key("IdentityType")
ok.String(string(v.IdentityType))
}
if v.StudioId != nil {
ok := object.Key("StudioId")
ok.String(*v.StudioId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListBootstrapActionsInput(v *ListBootstrapActionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListClustersInput(v *ListClustersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterStates != nil {
ok := object.Key("ClusterStates")
if err := awsAwsjson11_serializeDocumentClusterStateList(v.ClusterStates, ok); err != nil {
return err
}
}
if v.CreatedAfter != nil {
ok := object.Key("CreatedAfter")
ok.Double(smithytime.FormatEpochSeconds(*v.CreatedAfter))
}
if v.CreatedBefore != nil {
ok := object.Key("CreatedBefore")
ok.Double(smithytime.FormatEpochSeconds(*v.CreatedBefore))
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListInstanceFleetsInput(v *ListInstanceFleetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListInstanceGroupsInput(v *ListInstanceGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListInstancesInput(v *ListInstancesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.InstanceFleetId != nil {
ok := object.Key("InstanceFleetId")
ok.String(*v.InstanceFleetId)
}
if len(v.InstanceFleetType) > 0 {
ok := object.Key("InstanceFleetType")
ok.String(string(v.InstanceFleetType))
}
if v.InstanceGroupId != nil {
ok := object.Key("InstanceGroupId")
ok.String(*v.InstanceGroupId)
}
if v.InstanceGroupTypes != nil {
ok := object.Key("InstanceGroupTypes")
if err := awsAwsjson11_serializeDocumentInstanceGroupTypeList(v.InstanceGroupTypes, ok); err != nil {
return err
}
}
if v.InstanceStates != nil {
ok := object.Key("InstanceStates")
if err := awsAwsjson11_serializeDocumentInstanceStateList(v.InstanceStates, ok); err != nil {
return err
}
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListNotebookExecutionsInput(v *ListNotebookExecutionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EditorId != nil {
ok := object.Key("EditorId")
ok.String(*v.EditorId)
}
if v.ExecutionEngineId != nil {
ok := object.Key("ExecutionEngineId")
ok.String(*v.ExecutionEngineId)
}
if v.From != nil {
ok := object.Key("From")
ok.Double(smithytime.FormatEpochSeconds(*v.From))
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if len(v.Status) > 0 {
ok := object.Key("Status")
ok.String(string(v.Status))
}
if v.To != nil {
ok := object.Key("To")
ok.Double(smithytime.FormatEpochSeconds(*v.To))
}
return nil
}
func awsAwsjson11_serializeOpDocumentListReleaseLabelsInput(v *ListReleaseLabelsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsAwsjson11_serializeDocumentReleaseLabelFilter(v.Filters, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListSecurityConfigurationsInput(v *ListSecurityConfigurationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListStepsInput(v *ListStepsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if v.StepIds != nil {
ok := object.Key("StepIds")
if err := awsAwsjson11_serializeDocumentXmlStringList(v.StepIds, ok); err != nil {
return err
}
}
if v.StepStates != nil {
ok := object.Key("StepStates")
if err := awsAwsjson11_serializeDocumentStepStateList(v.StepStates, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentListStudioSessionMappingsInput(v *ListStudioSessionMappingsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.IdentityType) > 0 {
ok := object.Key("IdentityType")
ok.String(string(v.IdentityType))
}
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if v.StudioId != nil {
ok := object.Key("StudioId")
ok.String(*v.StudioId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListStudiosInput(v *ListStudiosInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListSupportedInstanceTypesInput(v *ListSupportedInstanceTypesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Marker != nil {
ok := object.Key("Marker")
ok.String(*v.Marker)
}
if v.ReleaseLabel != nil {
ok := object.Key("ReleaseLabel")
ok.String(*v.ReleaseLabel)
}
return nil
}
func awsAwsjson11_serializeOpDocumentModifyClusterInput(v *ModifyClusterInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.StepConcurrencyLevel != nil {
ok := object.Key("StepConcurrencyLevel")
ok.Integer(*v.StepConcurrencyLevel)
}
return nil
}
func awsAwsjson11_serializeOpDocumentModifyInstanceFleetInput(v *ModifyInstanceFleetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.InstanceFleet != nil {
ok := object.Key("InstanceFleet")
if err := awsAwsjson11_serializeDocumentInstanceFleetModifyConfig(v.InstanceFleet, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentModifyInstanceGroupsInput(v *ModifyInstanceGroupsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.InstanceGroups != nil {
ok := object.Key("InstanceGroups")
if err := awsAwsjson11_serializeDocumentInstanceGroupModifyConfigList(v.InstanceGroups, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutAutoScalingPolicyInput(v *PutAutoScalingPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AutoScalingPolicy != nil {
ok := object.Key("AutoScalingPolicy")
if err := awsAwsjson11_serializeDocumentAutoScalingPolicy(v.AutoScalingPolicy, ok); err != nil {
return err
}
}
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.InstanceGroupId != nil {
ok := object.Key("InstanceGroupId")
ok.String(*v.InstanceGroupId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutAutoTerminationPolicyInput(v *PutAutoTerminationPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AutoTerminationPolicy != nil {
ok := object.Key("AutoTerminationPolicy")
if err := awsAwsjson11_serializeDocumentAutoTerminationPolicy(v.AutoTerminationPolicy, ok); err != nil {
return err
}
}
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutBlockPublicAccessConfigurationInput(v *PutBlockPublicAccessConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BlockPublicAccessConfiguration != nil {
ok := object.Key("BlockPublicAccessConfiguration")
if err := awsAwsjson11_serializeDocumentBlockPublicAccessConfiguration(v.BlockPublicAccessConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutManagedScalingPolicyInput(v *PutManagedScalingPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.ManagedScalingPolicy != nil {
ok := object.Key("ManagedScalingPolicy")
if err := awsAwsjson11_serializeDocumentManagedScalingPolicy(v.ManagedScalingPolicy, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentRemoveAutoScalingPolicyInput(v *RemoveAutoScalingPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
if v.InstanceGroupId != nil {
ok := object.Key("InstanceGroupId")
ok.String(*v.InstanceGroupId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRemoveAutoTerminationPolicyInput(v *RemoveAutoTerminationPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRemoveManagedScalingPolicyInput(v *RemoveManagedScalingPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClusterId != nil {
ok := object.Key("ClusterId")
ok.String(*v.ClusterId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentRemoveTagsInput(v *RemoveTagsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceId != nil {
ok := object.Key("ResourceId")
ok.String(*v.ResourceId)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentStringList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentRunJobFlowInput(v *RunJobFlowInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalInfo != nil {
ok := object.Key("AdditionalInfo")
ok.String(*v.AdditionalInfo)
}
if v.AmiVersion != nil {
ok := object.Key("AmiVersion")
ok.String(*v.AmiVersion)
}
if v.Applications != nil {
ok := object.Key("Applications")
if err := awsAwsjson11_serializeDocumentApplicationList(v.Applications, ok); err != nil {
return err
}
}
if v.AutoScalingRole != nil {
ok := object.Key("AutoScalingRole")
ok.String(*v.AutoScalingRole)
}
if v.AutoTerminationPolicy != nil {
ok := object.Key("AutoTerminationPolicy")
if err := awsAwsjson11_serializeDocumentAutoTerminationPolicy(v.AutoTerminationPolicy, ok); err != nil {
return err
}
}
if v.BootstrapActions != nil {
ok := object.Key("BootstrapActions")
if err := awsAwsjson11_serializeDocumentBootstrapActionConfigList(v.BootstrapActions, ok); err != nil {
return err
}
}
if v.Configurations != nil {
ok := object.Key("Configurations")
if err := awsAwsjson11_serializeDocumentConfigurationList(v.Configurations, ok); err != nil {
return err
}
}
if v.CustomAmiId != nil {
ok := object.Key("CustomAmiId")
ok.String(*v.CustomAmiId)
}
if v.EbsRootVolumeSize != nil {
ok := object.Key("EbsRootVolumeSize")
ok.Integer(*v.EbsRootVolumeSize)
}
if v.Instances != nil {
ok := object.Key("Instances")
if err := awsAwsjson11_serializeDocumentJobFlowInstancesConfig(v.Instances, ok); err != nil {
return err
}
}
if v.JobFlowRole != nil {
ok := object.Key("JobFlowRole")
ok.String(*v.JobFlowRole)
}
if v.KerberosAttributes != nil {
ok := object.Key("KerberosAttributes")
if err := awsAwsjson11_serializeDocumentKerberosAttributes(v.KerberosAttributes, ok); err != nil {
return err
}
}
if v.LogEncryptionKmsKeyId != nil {
ok := object.Key("LogEncryptionKmsKeyId")
ok.String(*v.LogEncryptionKmsKeyId)
}
if v.LogUri != nil {
ok := object.Key("LogUri")
ok.String(*v.LogUri)
}
if v.ManagedScalingPolicy != nil {
ok := object.Key("ManagedScalingPolicy")
if err := awsAwsjson11_serializeDocumentManagedScalingPolicy(v.ManagedScalingPolicy, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.NewSupportedProducts != nil {
ok := object.Key("NewSupportedProducts")
if err := awsAwsjson11_serializeDocumentNewSupportedProductsList(v.NewSupportedProducts, ok); err != nil {
return err
}
}
if v.OSReleaseLabel != nil {
ok := object.Key("OSReleaseLabel")
ok.String(*v.OSReleaseLabel)
}
if v.PlacementGroupConfigs != nil {
ok := object.Key("PlacementGroupConfigs")
if err := awsAwsjson11_serializeDocumentPlacementGroupConfigList(v.PlacementGroupConfigs, ok); err != nil {
return err
}
}
if v.ReleaseLabel != nil {
ok := object.Key("ReleaseLabel")
ok.String(*v.ReleaseLabel)
}
if len(v.RepoUpgradeOnBoot) > 0 {
ok := object.Key("RepoUpgradeOnBoot")
ok.String(string(v.RepoUpgradeOnBoot))
}
if len(v.ScaleDownBehavior) > 0 {
ok := object.Key("ScaleDownBehavior")
ok.String(string(v.ScaleDownBehavior))
}
if v.SecurityConfiguration != nil {
ok := object.Key("SecurityConfiguration")
ok.String(*v.SecurityConfiguration)
}
if v.ServiceRole != nil {
ok := object.Key("ServiceRole")
ok.String(*v.ServiceRole)
}
if v.StepConcurrencyLevel != nil {
ok := object.Key("StepConcurrencyLevel")
ok.Integer(*v.StepConcurrencyLevel)
}
if v.Steps != nil {
ok := object.Key("Steps")
if err := awsAwsjson11_serializeDocumentStepConfigList(v.Steps, ok); err != nil {
return err
}
}
if v.SupportedProducts != nil {
ok := object.Key("SupportedProducts")
if err := awsAwsjson11_serializeDocumentSupportedProductsList(v.SupportedProducts, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.VisibleToAllUsers {
ok := object.Key("VisibleToAllUsers")
ok.Boolean(v.VisibleToAllUsers)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSetTerminationProtectionInput(v *SetTerminationProtectionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobFlowIds != nil {
ok := object.Key("JobFlowIds")
if err := awsAwsjson11_serializeDocumentXmlStringList(v.JobFlowIds, ok); err != nil {
return err
}
}
{
ok := object.Key("TerminationProtected")
ok.Boolean(v.TerminationProtected)
}
return nil
}
func awsAwsjson11_serializeOpDocumentSetVisibleToAllUsersInput(v *SetVisibleToAllUsersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobFlowIds != nil {
ok := object.Key("JobFlowIds")
if err := awsAwsjson11_serializeDocumentXmlStringList(v.JobFlowIds, ok); err != nil {
return err
}
}
{
ok := object.Key("VisibleToAllUsers")
ok.Boolean(v.VisibleToAllUsers)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartNotebookExecutionInput(v *StartNotebookExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EditorId != nil {
ok := object.Key("EditorId")
ok.String(*v.EditorId)
}
if v.EnvironmentVariables != nil {
ok := object.Key("EnvironmentVariables")
if err := awsAwsjson11_serializeDocumentEnvironmentVariablesMap(v.EnvironmentVariables, ok); err != nil {
return err
}
}
if v.ExecutionEngine != nil {
ok := object.Key("ExecutionEngine")
if err := awsAwsjson11_serializeDocumentExecutionEngineConfig(v.ExecutionEngine, ok); err != nil {
return err
}
}
if v.NotebookExecutionName != nil {
ok := object.Key("NotebookExecutionName")
ok.String(*v.NotebookExecutionName)
}
if v.NotebookInstanceSecurityGroupId != nil {
ok := object.Key("NotebookInstanceSecurityGroupId")
ok.String(*v.NotebookInstanceSecurityGroupId)
}
if v.NotebookParams != nil {
ok := object.Key("NotebookParams")
ok.String(*v.NotebookParams)
}
if v.NotebookS3Location != nil {
ok := object.Key("NotebookS3Location")
if err := awsAwsjson11_serializeDocumentNotebookS3LocationFromInput(v.NotebookS3Location, ok); err != nil {
return err
}
}
if len(v.OutputNotebookFormat) > 0 {
ok := object.Key("OutputNotebookFormat")
ok.String(string(v.OutputNotebookFormat))
}
if v.OutputNotebookS3Location != nil {
ok := object.Key("OutputNotebookS3Location")
if err := awsAwsjson11_serializeDocumentOutputNotebookS3LocationFromInput(v.OutputNotebookS3Location, ok); err != nil {
return err
}
}
if v.RelativePath != nil {
ok := object.Key("RelativePath")
ok.String(*v.RelativePath)
}
if v.ServiceRole != nil {
ok := object.Key("ServiceRole")
ok.String(*v.ServiceRole)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopNotebookExecutionInput(v *StopNotebookExecutionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NotebookExecutionId != nil {
ok := object.Key("NotebookExecutionId")
ok.String(*v.NotebookExecutionId)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTerminateJobFlowsInput(v *TerminateJobFlowsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.JobFlowIds != nil {
ok := object.Key("JobFlowIds")
if err := awsAwsjson11_serializeDocumentXmlStringList(v.JobFlowIds, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateStudioInput(v *UpdateStudioInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultS3Location != nil {
ok := object.Key("DefaultS3Location")
ok.String(*v.DefaultS3Location)
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.StudioId != nil {
ok := object.Key("StudioId")
ok.String(*v.StudioId)
}
if v.SubnetIds != nil {
ok := object.Key("SubnetIds")
if err := awsAwsjson11_serializeDocumentSubnetIdList(v.SubnetIds, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUpdateStudioSessionMappingInput(v *UpdateStudioSessionMappingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IdentityId != nil {
ok := object.Key("IdentityId")
ok.String(*v.IdentityId)
}
if v.IdentityName != nil {
ok := object.Key("IdentityName")
ok.String(*v.IdentityName)
}
if len(v.IdentityType) > 0 {
ok := object.Key("IdentityType")
ok.String(string(v.IdentityType))
}
if v.SessionPolicyArn != nil {
ok := object.Key("SessionPolicyArn")
ok.String(*v.SessionPolicyArn)
}
if v.StudioId != nil {
ok := object.Key("StudioId")
ok.String(*v.StudioId)
}
return nil
}
| 5,961 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emr
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/emr/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAddInstanceFleet struct {
}
func (*validateOpAddInstanceFleet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddInstanceFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddInstanceFleetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddInstanceFleetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddInstanceGroups struct {
}
func (*validateOpAddInstanceGroups) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddInstanceGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddInstanceGroupsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddInstanceGroupsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddJobFlowSteps struct {
}
func (*validateOpAddJobFlowSteps) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddJobFlowSteps) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddJobFlowStepsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddJobFlowStepsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddTags struct {
}
func (*validateOpAddTags) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddTagsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddTagsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCancelSteps struct {
}
func (*validateOpCancelSteps) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCancelSteps) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CancelStepsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCancelStepsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSecurityConfiguration struct {
}
func (*validateOpCreateSecurityConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSecurityConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSecurityConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSecurityConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateStudio struct {
}
func (*validateOpCreateStudio) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateStudio) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateStudioInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateStudioInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateStudioSessionMapping struct {
}
func (*validateOpCreateStudioSessionMapping) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateStudioSessionMapping) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateStudioSessionMappingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateStudioSessionMappingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSecurityConfiguration struct {
}
func (*validateOpDeleteSecurityConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSecurityConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSecurityConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSecurityConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteStudio struct {
}
func (*validateOpDeleteStudio) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteStudio) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteStudioInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteStudioInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteStudioSessionMapping struct {
}
func (*validateOpDeleteStudioSessionMapping) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteStudioSessionMapping) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteStudioSessionMappingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteStudioSessionMappingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeCluster struct {
}
func (*validateOpDescribeCluster) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeClusterInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeClusterInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeNotebookExecution struct {
}
func (*validateOpDescribeNotebookExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeNotebookExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeNotebookExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeNotebookExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeSecurityConfiguration struct {
}
func (*validateOpDescribeSecurityConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeSecurityConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeSecurityConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeSecurityConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeStep struct {
}
func (*validateOpDescribeStep) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeStep) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeStepInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeStepInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeStudio struct {
}
func (*validateOpDescribeStudio) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeStudio) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeStudioInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeStudioInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAutoTerminationPolicy struct {
}
func (*validateOpGetAutoTerminationPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAutoTerminationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAutoTerminationPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAutoTerminationPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetClusterSessionCredentials struct {
}
func (*validateOpGetClusterSessionCredentials) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetClusterSessionCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetClusterSessionCredentialsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetClusterSessionCredentialsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetManagedScalingPolicy struct {
}
func (*validateOpGetManagedScalingPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetManagedScalingPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetManagedScalingPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetManagedScalingPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetStudioSessionMapping struct {
}
func (*validateOpGetStudioSessionMapping) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetStudioSessionMapping) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetStudioSessionMappingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetStudioSessionMappingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListBootstrapActions struct {
}
func (*validateOpListBootstrapActions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListBootstrapActions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListBootstrapActionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListBootstrapActionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListInstanceFleets struct {
}
func (*validateOpListInstanceFleets) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListInstanceFleets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListInstanceFleetsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListInstanceFleetsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListInstanceGroups struct {
}
func (*validateOpListInstanceGroups) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListInstanceGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListInstanceGroupsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListInstanceGroupsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListInstances struct {
}
func (*validateOpListInstances) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListInstances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListInstancesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListInstancesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListSteps struct {
}
func (*validateOpListSteps) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListSteps) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListStepsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListStepsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListSupportedInstanceTypes struct {
}
func (*validateOpListSupportedInstanceTypes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListSupportedInstanceTypes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListSupportedInstanceTypesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListSupportedInstanceTypesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpModifyCluster struct {
}
func (*validateOpModifyCluster) ID() string {
return "OperationInputValidation"
}
func (m *validateOpModifyCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ModifyClusterInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpModifyClusterInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpModifyInstanceFleet struct {
}
func (*validateOpModifyInstanceFleet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpModifyInstanceFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ModifyInstanceFleetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpModifyInstanceFleetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpModifyInstanceGroups struct {
}
func (*validateOpModifyInstanceGroups) ID() string {
return "OperationInputValidation"
}
func (m *validateOpModifyInstanceGroups) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ModifyInstanceGroupsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpModifyInstanceGroupsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutAutoScalingPolicy struct {
}
func (*validateOpPutAutoScalingPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutAutoScalingPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutAutoScalingPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutAutoScalingPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutAutoTerminationPolicy struct {
}
func (*validateOpPutAutoTerminationPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutAutoTerminationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutAutoTerminationPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutAutoTerminationPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutBlockPublicAccessConfiguration struct {
}
func (*validateOpPutBlockPublicAccessConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutBlockPublicAccessConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutBlockPublicAccessConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutBlockPublicAccessConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutManagedScalingPolicy struct {
}
func (*validateOpPutManagedScalingPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutManagedScalingPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutManagedScalingPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutManagedScalingPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveAutoScalingPolicy struct {
}
func (*validateOpRemoveAutoScalingPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveAutoScalingPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveAutoScalingPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveAutoScalingPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveAutoTerminationPolicy struct {
}
func (*validateOpRemoveAutoTerminationPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveAutoTerminationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveAutoTerminationPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveAutoTerminationPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveManagedScalingPolicy struct {
}
func (*validateOpRemoveManagedScalingPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveManagedScalingPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveManagedScalingPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveManagedScalingPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveTags struct {
}
func (*validateOpRemoveTags) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveTagsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveTagsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRunJobFlow struct {
}
func (*validateOpRunJobFlow) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRunJobFlow) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RunJobFlowInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRunJobFlowInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSetTerminationProtection struct {
}
func (*validateOpSetTerminationProtection) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSetTerminationProtection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SetTerminationProtectionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSetTerminationProtectionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSetVisibleToAllUsers struct {
}
func (*validateOpSetVisibleToAllUsers) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSetVisibleToAllUsers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SetVisibleToAllUsersInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSetVisibleToAllUsersInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartNotebookExecution struct {
}
func (*validateOpStartNotebookExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartNotebookExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartNotebookExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartNotebookExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopNotebookExecution struct {
}
func (*validateOpStopNotebookExecution) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopNotebookExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopNotebookExecutionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopNotebookExecutionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTerminateJobFlows struct {
}
func (*validateOpTerminateJobFlows) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTerminateJobFlows) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TerminateJobFlowsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTerminateJobFlowsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateStudio struct {
}
func (*validateOpUpdateStudio) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateStudio) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateStudioInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateStudioInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateStudioSessionMapping struct {
}
func (*validateOpUpdateStudioSessionMapping) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateStudioSessionMapping) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateStudioSessionMappingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateStudioSessionMappingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAddInstanceFleetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddInstanceFleet{}, middleware.After)
}
func addOpAddInstanceGroupsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddInstanceGroups{}, middleware.After)
}
func addOpAddJobFlowStepsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddJobFlowSteps{}, middleware.After)
}
func addOpAddTagsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddTags{}, middleware.After)
}
func addOpCancelStepsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCancelSteps{}, middleware.After)
}
func addOpCreateSecurityConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSecurityConfiguration{}, middleware.After)
}
func addOpCreateStudioValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateStudio{}, middleware.After)
}
func addOpCreateStudioSessionMappingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateStudioSessionMapping{}, middleware.After)
}
func addOpDeleteSecurityConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSecurityConfiguration{}, middleware.After)
}
func addOpDeleteStudioValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteStudio{}, middleware.After)
}
func addOpDeleteStudioSessionMappingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteStudioSessionMapping{}, middleware.After)
}
func addOpDescribeClusterValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeCluster{}, middleware.After)
}
func addOpDescribeNotebookExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeNotebookExecution{}, middleware.After)
}
func addOpDescribeSecurityConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeSecurityConfiguration{}, middleware.After)
}
func addOpDescribeStepValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeStep{}, middleware.After)
}
func addOpDescribeStudioValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeStudio{}, middleware.After)
}
func addOpGetAutoTerminationPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAutoTerminationPolicy{}, middleware.After)
}
func addOpGetClusterSessionCredentialsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetClusterSessionCredentials{}, middleware.After)
}
func addOpGetManagedScalingPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetManagedScalingPolicy{}, middleware.After)
}
func addOpGetStudioSessionMappingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetStudioSessionMapping{}, middleware.After)
}
func addOpListBootstrapActionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListBootstrapActions{}, middleware.After)
}
func addOpListInstanceFleetsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListInstanceFleets{}, middleware.After)
}
func addOpListInstanceGroupsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListInstanceGroups{}, middleware.After)
}
func addOpListInstancesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListInstances{}, middleware.After)
}
func addOpListStepsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListSteps{}, middleware.After)
}
func addOpListSupportedInstanceTypesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListSupportedInstanceTypes{}, middleware.After)
}
func addOpModifyClusterValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpModifyCluster{}, middleware.After)
}
func addOpModifyInstanceFleetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpModifyInstanceFleet{}, middleware.After)
}
func addOpModifyInstanceGroupsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpModifyInstanceGroups{}, middleware.After)
}
func addOpPutAutoScalingPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutAutoScalingPolicy{}, middleware.After)
}
func addOpPutAutoTerminationPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutAutoTerminationPolicy{}, middleware.After)
}
func addOpPutBlockPublicAccessConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutBlockPublicAccessConfiguration{}, middleware.After)
}
func addOpPutManagedScalingPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutManagedScalingPolicy{}, middleware.After)
}
func addOpRemoveAutoScalingPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveAutoScalingPolicy{}, middleware.After)
}
func addOpRemoveAutoTerminationPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveAutoTerminationPolicy{}, middleware.After)
}
func addOpRemoveManagedScalingPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveManagedScalingPolicy{}, middleware.After)
}
func addOpRemoveTagsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveTags{}, middleware.After)
}
func addOpRunJobFlowValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRunJobFlow{}, middleware.After)
}
func addOpSetTerminationProtectionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSetTerminationProtection{}, middleware.After)
}
func addOpSetVisibleToAllUsersValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSetVisibleToAllUsers{}, middleware.After)
}
func addOpStartNotebookExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartNotebookExecution{}, middleware.After)
}
func addOpStopNotebookExecutionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopNotebookExecution{}, middleware.After)
}
func addOpTerminateJobFlowsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTerminateJobFlows{}, middleware.After)
}
func addOpUpdateStudioValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateStudio{}, middleware.After)
}
func addOpUpdateStudioSessionMappingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateStudioSessionMapping{}, middleware.After)
}
func validateAutoScalingPolicy(v *types.AutoScalingPolicy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AutoScalingPolicy"}
if v.Constraints == nil {
invalidParams.Add(smithy.NewErrParamRequired("Constraints"))
} else if v.Constraints != nil {
if err := validateScalingConstraints(v.Constraints); err != nil {
invalidParams.AddNested("Constraints", err.(smithy.InvalidParamsError))
}
}
if v.Rules == nil {
invalidParams.Add(smithy.NewErrParamRequired("Rules"))
} else if v.Rules != nil {
if err := validateScalingRuleList(v.Rules); err != nil {
invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBlockPublicAccessConfiguration(v *types.BlockPublicAccessConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BlockPublicAccessConfiguration"}
if v.PermittedPublicSecurityGroupRuleRanges != nil {
if err := validatePortRanges(v.PermittedPublicSecurityGroupRuleRanges); err != nil {
invalidParams.AddNested("PermittedPublicSecurityGroupRuleRanges", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBootstrapActionConfig(v *types.BootstrapActionConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BootstrapActionConfig"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ScriptBootstrapAction == nil {
invalidParams.Add(smithy.NewErrParamRequired("ScriptBootstrapAction"))
} else if v.ScriptBootstrapAction != nil {
if err := validateScriptBootstrapActionConfig(v.ScriptBootstrapAction); err != nil {
invalidParams.AddNested("ScriptBootstrapAction", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBootstrapActionConfigList(v []types.BootstrapActionConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BootstrapActionConfigList"}
for i := range v {
if err := validateBootstrapActionConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchAlarmDefinition(v *types.CloudWatchAlarmDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchAlarmDefinition"}
if len(v.ComparisonOperator) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ComparisonOperator"))
}
if v.MetricName == nil {
invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
}
if v.Period == nil {
invalidParams.Add(smithy.NewErrParamRequired("Period"))
}
if v.Threshold == nil {
invalidParams.Add(smithy.NewErrParamRequired("Threshold"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateComputeLimits(v *types.ComputeLimits) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ComputeLimits"}
if len(v.UnitType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("UnitType"))
}
if v.MinimumCapacityUnits == nil {
invalidParams.Add(smithy.NewErrParamRequired("MinimumCapacityUnits"))
}
if v.MaximumCapacityUnits == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaximumCapacityUnits"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEbsBlockDeviceConfig(v *types.EbsBlockDeviceConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EbsBlockDeviceConfig"}
if v.VolumeSpecification == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeSpecification"))
} else if v.VolumeSpecification != nil {
if err := validateVolumeSpecification(v.VolumeSpecification); err != nil {
invalidParams.AddNested("VolumeSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEbsBlockDeviceConfigList(v []types.EbsBlockDeviceConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EbsBlockDeviceConfigList"}
for i := range v {
if err := validateEbsBlockDeviceConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEbsConfiguration(v *types.EbsConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EbsConfiguration"}
if v.EbsBlockDeviceConfigs != nil {
if err := validateEbsBlockDeviceConfigList(v.EbsBlockDeviceConfigs); err != nil {
invalidParams.AddNested("EbsBlockDeviceConfigs", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateExecutionEngineConfig(v *types.ExecutionEngineConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ExecutionEngineConfig"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHadoopJarStepConfig(v *types.HadoopJarStepConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HadoopJarStepConfig"}
if v.Jar == nil {
invalidParams.Add(smithy.NewErrParamRequired("Jar"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceFleetConfig(v *types.InstanceFleetConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceFleetConfig"}
if len(v.InstanceFleetType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("InstanceFleetType"))
}
if v.InstanceTypeConfigs != nil {
if err := validateInstanceTypeConfigList(v.InstanceTypeConfigs); err != nil {
invalidParams.AddNested("InstanceTypeConfigs", err.(smithy.InvalidParamsError))
}
}
if v.LaunchSpecifications != nil {
if err := validateInstanceFleetProvisioningSpecifications(v.LaunchSpecifications); err != nil {
invalidParams.AddNested("LaunchSpecifications", err.(smithy.InvalidParamsError))
}
}
if v.ResizeSpecifications != nil {
if err := validateInstanceFleetResizingSpecifications(v.ResizeSpecifications); err != nil {
invalidParams.AddNested("ResizeSpecifications", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceFleetConfigList(v []types.InstanceFleetConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceFleetConfigList"}
for i := range v {
if err := validateInstanceFleetConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceFleetModifyConfig(v *types.InstanceFleetModifyConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceFleetModifyConfig"}
if v.InstanceFleetId == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceFleetId"))
}
if v.ResizeSpecifications != nil {
if err := validateInstanceFleetResizingSpecifications(v.ResizeSpecifications); err != nil {
invalidParams.AddNested("ResizeSpecifications", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceFleetProvisioningSpecifications(v *types.InstanceFleetProvisioningSpecifications) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceFleetProvisioningSpecifications"}
if v.SpotSpecification != nil {
if err := validateSpotProvisioningSpecification(v.SpotSpecification); err != nil {
invalidParams.AddNested("SpotSpecification", err.(smithy.InvalidParamsError))
}
}
if v.OnDemandSpecification != nil {
if err := validateOnDemandProvisioningSpecification(v.OnDemandSpecification); err != nil {
invalidParams.AddNested("OnDemandSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceFleetResizingSpecifications(v *types.InstanceFleetResizingSpecifications) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceFleetResizingSpecifications"}
if v.SpotResizeSpecification != nil {
if err := validateSpotResizingSpecification(v.SpotResizeSpecification); err != nil {
invalidParams.AddNested("SpotResizeSpecification", err.(smithy.InvalidParamsError))
}
}
if v.OnDemandResizeSpecification != nil {
if err := validateOnDemandResizingSpecification(v.OnDemandResizeSpecification); err != nil {
invalidParams.AddNested("OnDemandResizeSpecification", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceGroupConfig(v *types.InstanceGroupConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceGroupConfig"}
if len(v.InstanceRole) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("InstanceRole"))
}
if v.InstanceType == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceType"))
}
if v.InstanceCount == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceCount"))
}
if v.EbsConfiguration != nil {
if err := validateEbsConfiguration(v.EbsConfiguration); err != nil {
invalidParams.AddNested("EbsConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.AutoScalingPolicy != nil {
if err := validateAutoScalingPolicy(v.AutoScalingPolicy); err != nil {
invalidParams.AddNested("AutoScalingPolicy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceGroupConfigList(v []types.InstanceGroupConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceGroupConfigList"}
for i := range v {
if err := validateInstanceGroupConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceGroupModifyConfig(v *types.InstanceGroupModifyConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceGroupModifyConfig"}
if v.InstanceGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceGroupModifyConfigList(v []types.InstanceGroupModifyConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceGroupModifyConfigList"}
for i := range v {
if err := validateInstanceGroupModifyConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceTypeConfig(v *types.InstanceTypeConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceTypeConfig"}
if v.InstanceType == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceType"))
}
if v.EbsConfiguration != nil {
if err := validateEbsConfiguration(v.EbsConfiguration); err != nil {
invalidParams.AddNested("EbsConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInstanceTypeConfigList(v []types.InstanceTypeConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InstanceTypeConfigList"}
for i := range v {
if err := validateInstanceTypeConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobFlowInstancesConfig(v *types.JobFlowInstancesConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobFlowInstancesConfig"}
if v.InstanceGroups != nil {
if err := validateInstanceGroupConfigList(v.InstanceGroups); err != nil {
invalidParams.AddNested("InstanceGroups", err.(smithy.InvalidParamsError))
}
}
if v.InstanceFleets != nil {
if err := validateInstanceFleetConfigList(v.InstanceFleets); err != nil {
invalidParams.AddNested("InstanceFleets", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKerberosAttributes(v *types.KerberosAttributes) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KerberosAttributes"}
if v.Realm == nil {
invalidParams.Add(smithy.NewErrParamRequired("Realm"))
}
if v.KdcAdminPassword == nil {
invalidParams.Add(smithy.NewErrParamRequired("KdcAdminPassword"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateManagedScalingPolicy(v *types.ManagedScalingPolicy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ManagedScalingPolicy"}
if v.ComputeLimits != nil {
if err := validateComputeLimits(v.ComputeLimits); err != nil {
invalidParams.AddNested("ComputeLimits", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOnDemandProvisioningSpecification(v *types.OnDemandProvisioningSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OnDemandProvisioningSpecification"}
if len(v.AllocationStrategy) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("AllocationStrategy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOnDemandResizingSpecification(v *types.OnDemandResizingSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OnDemandResizingSpecification"}
if v.TimeoutDurationMinutes == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeoutDurationMinutes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePlacementGroupConfig(v *types.PlacementGroupConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PlacementGroupConfig"}
if len(v.InstanceRole) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("InstanceRole"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePlacementGroupConfigList(v []types.PlacementGroupConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PlacementGroupConfigList"}
for i := range v {
if err := validatePlacementGroupConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePortRange(v *types.PortRange) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PortRange"}
if v.MinRange == nil {
invalidParams.Add(smithy.NewErrParamRequired("MinRange"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePortRanges(v []types.PortRange) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PortRanges"}
for i := range v {
if err := validatePortRange(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateScalingAction(v *types.ScalingAction) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ScalingAction"}
if v.SimpleScalingPolicyConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("SimpleScalingPolicyConfiguration"))
} else if v.SimpleScalingPolicyConfiguration != nil {
if err := validateSimpleScalingPolicyConfiguration(v.SimpleScalingPolicyConfiguration); err != nil {
invalidParams.AddNested("SimpleScalingPolicyConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateScalingConstraints(v *types.ScalingConstraints) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ScalingConstraints"}
if v.MinCapacity == nil {
invalidParams.Add(smithy.NewErrParamRequired("MinCapacity"))
}
if v.MaxCapacity == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaxCapacity"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateScalingRule(v *types.ScalingRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ScalingRule"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Action == nil {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
} else if v.Action != nil {
if err := validateScalingAction(v.Action); err != nil {
invalidParams.AddNested("Action", err.(smithy.InvalidParamsError))
}
}
if v.Trigger == nil {
invalidParams.Add(smithy.NewErrParamRequired("Trigger"))
} else if v.Trigger != nil {
if err := validateScalingTrigger(v.Trigger); err != nil {
invalidParams.AddNested("Trigger", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateScalingRuleList(v []types.ScalingRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ScalingRuleList"}
for i := range v {
if err := validateScalingRule(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateScalingTrigger(v *types.ScalingTrigger) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ScalingTrigger"}
if v.CloudWatchAlarmDefinition == nil {
invalidParams.Add(smithy.NewErrParamRequired("CloudWatchAlarmDefinition"))
} else if v.CloudWatchAlarmDefinition != nil {
if err := validateCloudWatchAlarmDefinition(v.CloudWatchAlarmDefinition); err != nil {
invalidParams.AddNested("CloudWatchAlarmDefinition", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateScriptBootstrapActionConfig(v *types.ScriptBootstrapActionConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ScriptBootstrapActionConfig"}
if v.Path == nil {
invalidParams.Add(smithy.NewErrParamRequired("Path"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSimpleScalingPolicyConfiguration(v *types.SimpleScalingPolicyConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SimpleScalingPolicyConfiguration"}
if v.ScalingAdjustment == nil {
invalidParams.Add(smithy.NewErrParamRequired("ScalingAdjustment"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSpotProvisioningSpecification(v *types.SpotProvisioningSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SpotProvisioningSpecification"}
if v.TimeoutDurationMinutes == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeoutDurationMinutes"))
}
if len(v.TimeoutAction) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("TimeoutAction"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSpotResizingSpecification(v *types.SpotResizingSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SpotResizingSpecification"}
if v.TimeoutDurationMinutes == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeoutDurationMinutes"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStepConfig(v *types.StepConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StepConfig"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.HadoopJarStep == nil {
invalidParams.Add(smithy.NewErrParamRequired("HadoopJarStep"))
} else if v.HadoopJarStep != nil {
if err := validateHadoopJarStepConfig(v.HadoopJarStep); err != nil {
invalidParams.AddNested("HadoopJarStep", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStepConfigList(v []types.StepConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StepConfigList"}
for i := range v {
if err := validateStepConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateVolumeSpecification(v *types.VolumeSpecification) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "VolumeSpecification"}
if v.VolumeType == nil {
invalidParams.Add(smithy.NewErrParamRequired("VolumeType"))
}
if v.SizeInGB == nil {
invalidParams.Add(smithy.NewErrParamRequired("SizeInGB"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddInstanceFleetInput(v *AddInstanceFleetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddInstanceFleetInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if v.InstanceFleet == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceFleet"))
} else if v.InstanceFleet != nil {
if err := validateInstanceFleetConfig(v.InstanceFleet); err != nil {
invalidParams.AddNested("InstanceFleet", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddInstanceGroupsInput(v *AddInstanceGroupsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddInstanceGroupsInput"}
if v.InstanceGroups == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceGroups"))
} else if v.InstanceGroups != nil {
if err := validateInstanceGroupConfigList(v.InstanceGroups); err != nil {
invalidParams.AddNested("InstanceGroups", err.(smithy.InvalidParamsError))
}
}
if v.JobFlowId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobFlowId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddJobFlowStepsInput(v *AddJobFlowStepsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddJobFlowStepsInput"}
if v.JobFlowId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobFlowId"))
}
if v.Steps == nil {
invalidParams.Add(smithy.NewErrParamRequired("Steps"))
} else if v.Steps != nil {
if err := validateStepConfigList(v.Steps); err != nil {
invalidParams.AddNested("Steps", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddTagsInput(v *AddTagsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddTagsInput"}
if v.ResourceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceId"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCancelStepsInput(v *CancelStepsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CancelStepsInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if v.StepIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("StepIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSecurityConfigurationInput(v *CreateSecurityConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSecurityConfigurationInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.SecurityConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("SecurityConfiguration"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateStudioInput(v *CreateStudioInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateStudioInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.AuthMode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("AuthMode"))
}
if v.VpcId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VpcId"))
}
if v.SubnetIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubnetIds"))
}
if v.ServiceRole == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceRole"))
}
if v.WorkspaceSecurityGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("WorkspaceSecurityGroupId"))
}
if v.EngineSecurityGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("EngineSecurityGroupId"))
}
if v.DefaultS3Location == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultS3Location"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateStudioSessionMappingInput(v *CreateStudioSessionMappingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateStudioSessionMappingInput"}
if v.StudioId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StudioId"))
}
if len(v.IdentityType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("IdentityType"))
}
if v.SessionPolicyArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionPolicyArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSecurityConfigurationInput(v *DeleteSecurityConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSecurityConfigurationInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteStudioInput(v *DeleteStudioInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteStudioInput"}
if v.StudioId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StudioId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteStudioSessionMappingInput(v *DeleteStudioSessionMappingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteStudioSessionMappingInput"}
if v.StudioId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StudioId"))
}
if len(v.IdentityType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("IdentityType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeClusterInput(v *DescribeClusterInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeClusterInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeNotebookExecutionInput(v *DescribeNotebookExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeNotebookExecutionInput"}
if v.NotebookExecutionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("NotebookExecutionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeSecurityConfigurationInput(v *DescribeSecurityConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeSecurityConfigurationInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeStepInput(v *DescribeStepInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeStepInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if v.StepId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StepId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeStudioInput(v *DescribeStudioInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeStudioInput"}
if v.StudioId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StudioId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAutoTerminationPolicyInput(v *GetAutoTerminationPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAutoTerminationPolicyInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetClusterSessionCredentialsInput(v *GetClusterSessionCredentialsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetClusterSessionCredentialsInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if v.ExecutionRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetManagedScalingPolicyInput(v *GetManagedScalingPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetManagedScalingPolicyInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetStudioSessionMappingInput(v *GetStudioSessionMappingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetStudioSessionMappingInput"}
if v.StudioId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StudioId"))
}
if len(v.IdentityType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("IdentityType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListBootstrapActionsInput(v *ListBootstrapActionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListBootstrapActionsInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListInstanceFleetsInput(v *ListInstanceFleetsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListInstanceFleetsInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListInstanceGroupsInput(v *ListInstanceGroupsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListInstanceGroupsInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListInstancesInput(v *ListInstancesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListInstancesInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListStepsInput(v *ListStepsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListStepsInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListSupportedInstanceTypesInput(v *ListSupportedInstanceTypesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListSupportedInstanceTypesInput"}
if v.ReleaseLabel == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReleaseLabel"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpModifyClusterInput(v *ModifyClusterInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ModifyClusterInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpModifyInstanceFleetInput(v *ModifyInstanceFleetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceFleetInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if v.InstanceFleet == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceFleet"))
} else if v.InstanceFleet != nil {
if err := validateInstanceFleetModifyConfig(v.InstanceFleet); err != nil {
invalidParams.AddNested("InstanceFleet", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpModifyInstanceGroupsInput(v *ModifyInstanceGroupsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ModifyInstanceGroupsInput"}
if v.InstanceGroups != nil {
if err := validateInstanceGroupModifyConfigList(v.InstanceGroups); err != nil {
invalidParams.AddNested("InstanceGroups", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutAutoScalingPolicyInput(v *PutAutoScalingPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAutoScalingPolicyInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if v.InstanceGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceGroupId"))
}
if v.AutoScalingPolicy == nil {
invalidParams.Add(smithy.NewErrParamRequired("AutoScalingPolicy"))
} else if v.AutoScalingPolicy != nil {
if err := validateAutoScalingPolicy(v.AutoScalingPolicy); err != nil {
invalidParams.AddNested("AutoScalingPolicy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutAutoTerminationPolicyInput(v *PutAutoTerminationPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAutoTerminationPolicyInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutBlockPublicAccessConfigurationInput(v *PutBlockPublicAccessConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutBlockPublicAccessConfigurationInput"}
if v.BlockPublicAccessConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("BlockPublicAccessConfiguration"))
} else if v.BlockPublicAccessConfiguration != nil {
if err := validateBlockPublicAccessConfiguration(v.BlockPublicAccessConfiguration); err != nil {
invalidParams.AddNested("BlockPublicAccessConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutManagedScalingPolicyInput(v *PutManagedScalingPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutManagedScalingPolicyInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if v.ManagedScalingPolicy == nil {
invalidParams.Add(smithy.NewErrParamRequired("ManagedScalingPolicy"))
} else if v.ManagedScalingPolicy != nil {
if err := validateManagedScalingPolicy(v.ManagedScalingPolicy); err != nil {
invalidParams.AddNested("ManagedScalingPolicy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveAutoScalingPolicyInput(v *RemoveAutoScalingPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveAutoScalingPolicyInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if v.InstanceGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("InstanceGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveAutoTerminationPolicyInput(v *RemoveAutoTerminationPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveAutoTerminationPolicyInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveManagedScalingPolicyInput(v *RemoveManagedScalingPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveManagedScalingPolicyInput"}
if v.ClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveTagsInput(v *RemoveTagsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveTagsInput"}
if v.ResourceId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceId"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRunJobFlowInput(v *RunJobFlowInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RunJobFlowInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Instances == nil {
invalidParams.Add(smithy.NewErrParamRequired("Instances"))
} else if v.Instances != nil {
if err := validateJobFlowInstancesConfig(v.Instances); err != nil {
invalidParams.AddNested("Instances", err.(smithy.InvalidParamsError))
}
}
if v.Steps != nil {
if err := validateStepConfigList(v.Steps); err != nil {
invalidParams.AddNested("Steps", err.(smithy.InvalidParamsError))
}
}
if v.BootstrapActions != nil {
if err := validateBootstrapActionConfigList(v.BootstrapActions); err != nil {
invalidParams.AddNested("BootstrapActions", err.(smithy.InvalidParamsError))
}
}
if v.KerberosAttributes != nil {
if err := validateKerberosAttributes(v.KerberosAttributes); err != nil {
invalidParams.AddNested("KerberosAttributes", err.(smithy.InvalidParamsError))
}
}
if v.ManagedScalingPolicy != nil {
if err := validateManagedScalingPolicy(v.ManagedScalingPolicy); err != nil {
invalidParams.AddNested("ManagedScalingPolicy", err.(smithy.InvalidParamsError))
}
}
if v.PlacementGroupConfigs != nil {
if err := validatePlacementGroupConfigList(v.PlacementGroupConfigs); err != nil {
invalidParams.AddNested("PlacementGroupConfigs", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSetTerminationProtectionInput(v *SetTerminationProtectionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SetTerminationProtectionInput"}
if v.JobFlowIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobFlowIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSetVisibleToAllUsersInput(v *SetVisibleToAllUsersInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SetVisibleToAllUsersInput"}
if v.JobFlowIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobFlowIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartNotebookExecutionInput(v *StartNotebookExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartNotebookExecutionInput"}
if v.ExecutionEngine == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionEngine"))
} else if v.ExecutionEngine != nil {
if err := validateExecutionEngineConfig(v.ExecutionEngine); err != nil {
invalidParams.AddNested("ExecutionEngine", err.(smithy.InvalidParamsError))
}
}
if v.ServiceRole == nil {
invalidParams.Add(smithy.NewErrParamRequired("ServiceRole"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopNotebookExecutionInput(v *StopNotebookExecutionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopNotebookExecutionInput"}
if v.NotebookExecutionId == nil {
invalidParams.Add(smithy.NewErrParamRequired("NotebookExecutionId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTerminateJobFlowsInput(v *TerminateJobFlowsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TerminateJobFlowsInput"}
if v.JobFlowIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobFlowIds"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateStudioInput(v *UpdateStudioInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateStudioInput"}
if v.StudioId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StudioId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateStudioSessionMappingInput(v *UpdateStudioSessionMappingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateStudioSessionMappingInput"}
if v.StudioId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StudioId"))
}
if len(v.IdentityType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("IdentityType"))
}
if v.SessionPolicyArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("SessionPolicyArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 2,728 |
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 EMR 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: "elasticmapreduce.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "elasticmapreduce-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "elasticmapreduce.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-4",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce-fips.ca-central-1.amazonaws.com",
},
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-ca-central-1",
}: endpoints.Endpoint{
Hostname: "elasticmapreduce-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "elasticmapreduce-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: "elasticmapreduce-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: "elasticmapreduce-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: "elasticmapreduce-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: "elasticmapreduce-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "elasticmapreduce.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "elasticmapreduce-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "elasticmapreduce.{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: "elasticmapreduce-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "elasticmapreduce.{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{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-iso-west-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "elasticmapreduce.{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: "elasticmapreduce-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "elasticmapreduce.{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: "elasticmapreduce-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "elasticmapreduce.{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: "elasticmapreduce.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "elasticmapreduce-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "elasticmapreduce.{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: "elasticmapreduce.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: "elasticmapreduce.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce.us-gov-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "elasticmapreduce.us-gov-west-1.amazonaws.com",
Protocols: []string{"https"},
},
},
},
}
| 519 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type ActionOnFailure string
// Enum values for ActionOnFailure
const (
ActionOnFailureTerminateJobFlow ActionOnFailure = "TERMINATE_JOB_FLOW"
ActionOnFailureTerminateCluster ActionOnFailure = "TERMINATE_CLUSTER"
ActionOnFailureCancelAndWait ActionOnFailure = "CANCEL_AND_WAIT"
ActionOnFailureContinue ActionOnFailure = "CONTINUE"
)
// Values returns all known values for ActionOnFailure. 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 (ActionOnFailure) Values() []ActionOnFailure {
return []ActionOnFailure{
"TERMINATE_JOB_FLOW",
"TERMINATE_CLUSTER",
"CANCEL_AND_WAIT",
"CONTINUE",
}
}
type AdjustmentType string
// Enum values for AdjustmentType
const (
AdjustmentTypeChangeInCapacity AdjustmentType = "CHANGE_IN_CAPACITY"
AdjustmentTypePercentChangeInCapacity AdjustmentType = "PERCENT_CHANGE_IN_CAPACITY"
AdjustmentTypeExactCapacity AdjustmentType = "EXACT_CAPACITY"
)
// Values returns all known values for AdjustmentType. 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 (AdjustmentType) Values() []AdjustmentType {
return []AdjustmentType{
"CHANGE_IN_CAPACITY",
"PERCENT_CHANGE_IN_CAPACITY",
"EXACT_CAPACITY",
}
}
type AuthMode string
// Enum values for AuthMode
const (
AuthModeSso AuthMode = "SSO"
AuthModeIam AuthMode = "IAM"
)
// Values returns all known values for AuthMode. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (AuthMode) Values() []AuthMode {
return []AuthMode{
"SSO",
"IAM",
}
}
type AutoScalingPolicyState string
// Enum values for AutoScalingPolicyState
const (
AutoScalingPolicyStatePending AutoScalingPolicyState = "PENDING"
AutoScalingPolicyStateAttaching AutoScalingPolicyState = "ATTACHING"
AutoScalingPolicyStateAttached AutoScalingPolicyState = "ATTACHED"
AutoScalingPolicyStateDetaching AutoScalingPolicyState = "DETACHING"
AutoScalingPolicyStateDetached AutoScalingPolicyState = "DETACHED"
AutoScalingPolicyStateFailed AutoScalingPolicyState = "FAILED"
)
// Values returns all known values for AutoScalingPolicyState. 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 (AutoScalingPolicyState) Values() []AutoScalingPolicyState {
return []AutoScalingPolicyState{
"PENDING",
"ATTACHING",
"ATTACHED",
"DETACHING",
"DETACHED",
"FAILED",
}
}
type AutoScalingPolicyStateChangeReasonCode string
// Enum values for AutoScalingPolicyStateChangeReasonCode
const (
AutoScalingPolicyStateChangeReasonCodeUserRequest AutoScalingPolicyStateChangeReasonCode = "USER_REQUEST"
AutoScalingPolicyStateChangeReasonCodeProvisionFailure AutoScalingPolicyStateChangeReasonCode = "PROVISION_FAILURE"
AutoScalingPolicyStateChangeReasonCodeCleanupFailure AutoScalingPolicyStateChangeReasonCode = "CLEANUP_FAILURE"
)
// Values returns all known values for AutoScalingPolicyStateChangeReasonCode.
// 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 (AutoScalingPolicyStateChangeReasonCode) Values() []AutoScalingPolicyStateChangeReasonCode {
return []AutoScalingPolicyStateChangeReasonCode{
"USER_REQUEST",
"PROVISION_FAILURE",
"CLEANUP_FAILURE",
}
}
type CancelStepsRequestStatus string
// Enum values for CancelStepsRequestStatus
const (
CancelStepsRequestStatusSubmitted CancelStepsRequestStatus = "SUBMITTED"
CancelStepsRequestStatusFailed CancelStepsRequestStatus = "FAILED"
)
// Values returns all known values for CancelStepsRequestStatus. 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 (CancelStepsRequestStatus) Values() []CancelStepsRequestStatus {
return []CancelStepsRequestStatus{
"SUBMITTED",
"FAILED",
}
}
type ClusterState string
// Enum values for ClusterState
const (
ClusterStateStarting ClusterState = "STARTING"
ClusterStateBootstrapping ClusterState = "BOOTSTRAPPING"
ClusterStateRunning ClusterState = "RUNNING"
ClusterStateWaiting ClusterState = "WAITING"
ClusterStateTerminating ClusterState = "TERMINATING"
ClusterStateTerminated ClusterState = "TERMINATED"
ClusterStateTerminatedWithErrors ClusterState = "TERMINATED_WITH_ERRORS"
)
// Values returns all known values for ClusterState. 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 (ClusterState) Values() []ClusterState {
return []ClusterState{
"STARTING",
"BOOTSTRAPPING",
"RUNNING",
"WAITING",
"TERMINATING",
"TERMINATED",
"TERMINATED_WITH_ERRORS",
}
}
type ClusterStateChangeReasonCode string
// Enum values for ClusterStateChangeReasonCode
const (
ClusterStateChangeReasonCodeInternalError ClusterStateChangeReasonCode = "INTERNAL_ERROR"
ClusterStateChangeReasonCodeValidationError ClusterStateChangeReasonCode = "VALIDATION_ERROR"
ClusterStateChangeReasonCodeInstanceFailure ClusterStateChangeReasonCode = "INSTANCE_FAILURE"
ClusterStateChangeReasonCodeInstanceFleetTimeout ClusterStateChangeReasonCode = "INSTANCE_FLEET_TIMEOUT"
ClusterStateChangeReasonCodeBootstrapFailure ClusterStateChangeReasonCode = "BOOTSTRAP_FAILURE"
ClusterStateChangeReasonCodeUserRequest ClusterStateChangeReasonCode = "USER_REQUEST"
ClusterStateChangeReasonCodeStepFailure ClusterStateChangeReasonCode = "STEP_FAILURE"
ClusterStateChangeReasonCodeAllStepsCompleted ClusterStateChangeReasonCode = "ALL_STEPS_COMPLETED"
)
// Values returns all known values for ClusterStateChangeReasonCode. 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 (ClusterStateChangeReasonCode) Values() []ClusterStateChangeReasonCode {
return []ClusterStateChangeReasonCode{
"INTERNAL_ERROR",
"VALIDATION_ERROR",
"INSTANCE_FAILURE",
"INSTANCE_FLEET_TIMEOUT",
"BOOTSTRAP_FAILURE",
"USER_REQUEST",
"STEP_FAILURE",
"ALL_STEPS_COMPLETED",
}
}
type ComparisonOperator string
// Enum values for ComparisonOperator
const (
ComparisonOperatorGreaterThanOrEqual ComparisonOperator = "GREATER_THAN_OR_EQUAL"
ComparisonOperatorGreaterThan ComparisonOperator = "GREATER_THAN"
ComparisonOperatorLessThan ComparisonOperator = "LESS_THAN"
ComparisonOperatorLessThanOrEqual ComparisonOperator = "LESS_THAN_OR_EQUAL"
)
// Values returns all known values for ComparisonOperator. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ComparisonOperator) Values() []ComparisonOperator {
return []ComparisonOperator{
"GREATER_THAN_OR_EQUAL",
"GREATER_THAN",
"LESS_THAN",
"LESS_THAN_OR_EQUAL",
}
}
type ComputeLimitsUnitType string
// Enum values for ComputeLimitsUnitType
const (
ComputeLimitsUnitTypeInstanceFleetUnits ComputeLimitsUnitType = "InstanceFleetUnits"
ComputeLimitsUnitTypeInstances ComputeLimitsUnitType = "Instances"
ComputeLimitsUnitTypeVcpu ComputeLimitsUnitType = "VCPU"
)
// Values returns all known values for ComputeLimitsUnitType. 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 (ComputeLimitsUnitType) Values() []ComputeLimitsUnitType {
return []ComputeLimitsUnitType{
"InstanceFleetUnits",
"Instances",
"VCPU",
}
}
type ExecutionEngineType string
// Enum values for ExecutionEngineType
const (
ExecutionEngineTypeEmr ExecutionEngineType = "EMR"
)
// Values returns all known values for ExecutionEngineType. 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 (ExecutionEngineType) Values() []ExecutionEngineType {
return []ExecutionEngineType{
"EMR",
}
}
type IdentityType string
// Enum values for IdentityType
const (
IdentityTypeUser IdentityType = "USER"
IdentityTypeGroup IdentityType = "GROUP"
)
// Values returns all known values for IdentityType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (IdentityType) Values() []IdentityType {
return []IdentityType{
"USER",
"GROUP",
}
}
type InstanceCollectionType string
// Enum values for InstanceCollectionType
const (
InstanceCollectionTypeInstanceFleet InstanceCollectionType = "INSTANCE_FLEET"
InstanceCollectionTypeInstanceGroup InstanceCollectionType = "INSTANCE_GROUP"
)
// Values returns all known values for InstanceCollectionType. 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 (InstanceCollectionType) Values() []InstanceCollectionType {
return []InstanceCollectionType{
"INSTANCE_FLEET",
"INSTANCE_GROUP",
}
}
type InstanceFleetState string
// Enum values for InstanceFleetState
const (
InstanceFleetStateProvisioning InstanceFleetState = "PROVISIONING"
InstanceFleetStateBootstrapping InstanceFleetState = "BOOTSTRAPPING"
InstanceFleetStateRunning InstanceFleetState = "RUNNING"
InstanceFleetStateResizing InstanceFleetState = "RESIZING"
InstanceFleetStateSuspended InstanceFleetState = "SUSPENDED"
InstanceFleetStateTerminating InstanceFleetState = "TERMINATING"
InstanceFleetStateTerminated InstanceFleetState = "TERMINATED"
)
// Values returns all known values for InstanceFleetState. 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 (InstanceFleetState) Values() []InstanceFleetState {
return []InstanceFleetState{
"PROVISIONING",
"BOOTSTRAPPING",
"RUNNING",
"RESIZING",
"SUSPENDED",
"TERMINATING",
"TERMINATED",
}
}
type InstanceFleetStateChangeReasonCode string
// Enum values for InstanceFleetStateChangeReasonCode
const (
InstanceFleetStateChangeReasonCodeInternalError InstanceFleetStateChangeReasonCode = "INTERNAL_ERROR"
InstanceFleetStateChangeReasonCodeValidationError InstanceFleetStateChangeReasonCode = "VALIDATION_ERROR"
InstanceFleetStateChangeReasonCodeInstanceFailure InstanceFleetStateChangeReasonCode = "INSTANCE_FAILURE"
InstanceFleetStateChangeReasonCodeClusterTerminated InstanceFleetStateChangeReasonCode = "CLUSTER_TERMINATED"
)
// Values returns all known values for InstanceFleetStateChangeReasonCode. 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 (InstanceFleetStateChangeReasonCode) Values() []InstanceFleetStateChangeReasonCode {
return []InstanceFleetStateChangeReasonCode{
"INTERNAL_ERROR",
"VALIDATION_ERROR",
"INSTANCE_FAILURE",
"CLUSTER_TERMINATED",
}
}
type InstanceFleetType string
// Enum values for InstanceFleetType
const (
InstanceFleetTypeMaster InstanceFleetType = "MASTER"
InstanceFleetTypeCore InstanceFleetType = "CORE"
InstanceFleetTypeTask InstanceFleetType = "TASK"
)
// Values returns all known values for InstanceFleetType. 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 (InstanceFleetType) Values() []InstanceFleetType {
return []InstanceFleetType{
"MASTER",
"CORE",
"TASK",
}
}
type InstanceGroupState string
// Enum values for InstanceGroupState
const (
InstanceGroupStateProvisioning InstanceGroupState = "PROVISIONING"
InstanceGroupStateBootstrapping InstanceGroupState = "BOOTSTRAPPING"
InstanceGroupStateRunning InstanceGroupState = "RUNNING"
InstanceGroupStateReconfiguring InstanceGroupState = "RECONFIGURING"
InstanceGroupStateResizing InstanceGroupState = "RESIZING"
InstanceGroupStateSuspended InstanceGroupState = "SUSPENDED"
InstanceGroupStateTerminating InstanceGroupState = "TERMINATING"
InstanceGroupStateTerminated InstanceGroupState = "TERMINATED"
InstanceGroupStateArrested InstanceGroupState = "ARRESTED"
InstanceGroupStateShuttingDown InstanceGroupState = "SHUTTING_DOWN"
InstanceGroupStateEnded InstanceGroupState = "ENDED"
)
// Values returns all known values for InstanceGroupState. 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 (InstanceGroupState) Values() []InstanceGroupState {
return []InstanceGroupState{
"PROVISIONING",
"BOOTSTRAPPING",
"RUNNING",
"RECONFIGURING",
"RESIZING",
"SUSPENDED",
"TERMINATING",
"TERMINATED",
"ARRESTED",
"SHUTTING_DOWN",
"ENDED",
}
}
type InstanceGroupStateChangeReasonCode string
// Enum values for InstanceGroupStateChangeReasonCode
const (
InstanceGroupStateChangeReasonCodeInternalError InstanceGroupStateChangeReasonCode = "INTERNAL_ERROR"
InstanceGroupStateChangeReasonCodeValidationError InstanceGroupStateChangeReasonCode = "VALIDATION_ERROR"
InstanceGroupStateChangeReasonCodeInstanceFailure InstanceGroupStateChangeReasonCode = "INSTANCE_FAILURE"
InstanceGroupStateChangeReasonCodeClusterTerminated InstanceGroupStateChangeReasonCode = "CLUSTER_TERMINATED"
)
// Values returns all known values for InstanceGroupStateChangeReasonCode. 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 (InstanceGroupStateChangeReasonCode) Values() []InstanceGroupStateChangeReasonCode {
return []InstanceGroupStateChangeReasonCode{
"INTERNAL_ERROR",
"VALIDATION_ERROR",
"INSTANCE_FAILURE",
"CLUSTER_TERMINATED",
}
}
type InstanceGroupType string
// Enum values for InstanceGroupType
const (
InstanceGroupTypeMaster InstanceGroupType = "MASTER"
InstanceGroupTypeCore InstanceGroupType = "CORE"
InstanceGroupTypeTask InstanceGroupType = "TASK"
)
// Values returns all known values for InstanceGroupType. 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 (InstanceGroupType) Values() []InstanceGroupType {
return []InstanceGroupType{
"MASTER",
"CORE",
"TASK",
}
}
type InstanceRoleType string
// Enum values for InstanceRoleType
const (
InstanceRoleTypeMaster InstanceRoleType = "MASTER"
InstanceRoleTypeCore InstanceRoleType = "CORE"
InstanceRoleTypeTask InstanceRoleType = "TASK"
)
// Values returns all known values for InstanceRoleType. 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 (InstanceRoleType) Values() []InstanceRoleType {
return []InstanceRoleType{
"MASTER",
"CORE",
"TASK",
}
}
type InstanceState string
// Enum values for InstanceState
const (
InstanceStateAwaitingFulfillment InstanceState = "AWAITING_FULFILLMENT"
InstanceStateProvisioning InstanceState = "PROVISIONING"
InstanceStateBootstrapping InstanceState = "BOOTSTRAPPING"
InstanceStateRunning InstanceState = "RUNNING"
InstanceStateTerminated InstanceState = "TERMINATED"
)
// Values returns all known values for InstanceState. 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 (InstanceState) Values() []InstanceState {
return []InstanceState{
"AWAITING_FULFILLMENT",
"PROVISIONING",
"BOOTSTRAPPING",
"RUNNING",
"TERMINATED",
}
}
type InstanceStateChangeReasonCode string
// Enum values for InstanceStateChangeReasonCode
const (
InstanceStateChangeReasonCodeInternalError InstanceStateChangeReasonCode = "INTERNAL_ERROR"
InstanceStateChangeReasonCodeValidationError InstanceStateChangeReasonCode = "VALIDATION_ERROR"
InstanceStateChangeReasonCodeInstanceFailure InstanceStateChangeReasonCode = "INSTANCE_FAILURE"
InstanceStateChangeReasonCodeBootstrapFailure InstanceStateChangeReasonCode = "BOOTSTRAP_FAILURE"
InstanceStateChangeReasonCodeClusterTerminated InstanceStateChangeReasonCode = "CLUSTER_TERMINATED"
)
// Values returns all known values for InstanceStateChangeReasonCode. 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 (InstanceStateChangeReasonCode) Values() []InstanceStateChangeReasonCode {
return []InstanceStateChangeReasonCode{
"INTERNAL_ERROR",
"VALIDATION_ERROR",
"INSTANCE_FAILURE",
"BOOTSTRAP_FAILURE",
"CLUSTER_TERMINATED",
}
}
type JobFlowExecutionState string
// Enum values for JobFlowExecutionState
const (
JobFlowExecutionStateStarting JobFlowExecutionState = "STARTING"
JobFlowExecutionStateBootstrapping JobFlowExecutionState = "BOOTSTRAPPING"
JobFlowExecutionStateRunning JobFlowExecutionState = "RUNNING"
JobFlowExecutionStateWaiting JobFlowExecutionState = "WAITING"
JobFlowExecutionStateShuttingDown JobFlowExecutionState = "SHUTTING_DOWN"
JobFlowExecutionStateTerminated JobFlowExecutionState = "TERMINATED"
JobFlowExecutionStateCompleted JobFlowExecutionState = "COMPLETED"
JobFlowExecutionStateFailed JobFlowExecutionState = "FAILED"
)
// Values returns all known values for JobFlowExecutionState. 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 (JobFlowExecutionState) Values() []JobFlowExecutionState {
return []JobFlowExecutionState{
"STARTING",
"BOOTSTRAPPING",
"RUNNING",
"WAITING",
"SHUTTING_DOWN",
"TERMINATED",
"COMPLETED",
"FAILED",
}
}
type MarketType string
// Enum values for MarketType
const (
MarketTypeOnDemand MarketType = "ON_DEMAND"
MarketTypeSpot MarketType = "SPOT"
)
// Values returns all known values for MarketType. 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 (MarketType) Values() []MarketType {
return []MarketType{
"ON_DEMAND",
"SPOT",
}
}
type NotebookExecutionStatus string
// Enum values for NotebookExecutionStatus
const (
NotebookExecutionStatusStartPending NotebookExecutionStatus = "START_PENDING"
NotebookExecutionStatusStarting NotebookExecutionStatus = "STARTING"
NotebookExecutionStatusRunning NotebookExecutionStatus = "RUNNING"
NotebookExecutionStatusFinishing NotebookExecutionStatus = "FINISHING"
NotebookExecutionStatusFinished NotebookExecutionStatus = "FINISHED"
NotebookExecutionStatusFailing NotebookExecutionStatus = "FAILING"
NotebookExecutionStatusFailed NotebookExecutionStatus = "FAILED"
NotebookExecutionStatusStopPending NotebookExecutionStatus = "STOP_PENDING"
NotebookExecutionStatusStopping NotebookExecutionStatus = "STOPPING"
NotebookExecutionStatusStopped NotebookExecutionStatus = "STOPPED"
)
// Values returns all known values for NotebookExecutionStatus. 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 (NotebookExecutionStatus) Values() []NotebookExecutionStatus {
return []NotebookExecutionStatus{
"START_PENDING",
"STARTING",
"RUNNING",
"FINISHING",
"FINISHED",
"FAILING",
"FAILED",
"STOP_PENDING",
"STOPPING",
"STOPPED",
}
}
type OnDemandCapacityReservationPreference string
// Enum values for OnDemandCapacityReservationPreference
const (
OnDemandCapacityReservationPreferenceOpen OnDemandCapacityReservationPreference = "open"
OnDemandCapacityReservationPreferenceNone OnDemandCapacityReservationPreference = "none"
)
// Values returns all known values for OnDemandCapacityReservationPreference. 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 (OnDemandCapacityReservationPreference) Values() []OnDemandCapacityReservationPreference {
return []OnDemandCapacityReservationPreference{
"open",
"none",
}
}
type OnDemandCapacityReservationUsageStrategy string
// Enum values for OnDemandCapacityReservationUsageStrategy
const (
OnDemandCapacityReservationUsageStrategyUseCapacityReservationsFirst OnDemandCapacityReservationUsageStrategy = "use-capacity-reservations-first"
)
// Values returns all known values for OnDemandCapacityReservationUsageStrategy.
// 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 (OnDemandCapacityReservationUsageStrategy) Values() []OnDemandCapacityReservationUsageStrategy {
return []OnDemandCapacityReservationUsageStrategy{
"use-capacity-reservations-first",
}
}
type OnDemandProvisioningAllocationStrategy string
// Enum values for OnDemandProvisioningAllocationStrategy
const (
OnDemandProvisioningAllocationStrategyLowestPrice OnDemandProvisioningAllocationStrategy = "lowest-price"
)
// Values returns all known values for OnDemandProvisioningAllocationStrategy.
// 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 (OnDemandProvisioningAllocationStrategy) Values() []OnDemandProvisioningAllocationStrategy {
return []OnDemandProvisioningAllocationStrategy{
"lowest-price",
}
}
type OutputNotebookFormat string
// Enum values for OutputNotebookFormat
const (
OutputNotebookFormatHtml OutputNotebookFormat = "HTML"
)
// Values returns all known values for OutputNotebookFormat. 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 (OutputNotebookFormat) Values() []OutputNotebookFormat {
return []OutputNotebookFormat{
"HTML",
}
}
type PlacementGroupStrategy string
// Enum values for PlacementGroupStrategy
const (
PlacementGroupStrategySpread PlacementGroupStrategy = "SPREAD"
PlacementGroupStrategyPartition PlacementGroupStrategy = "PARTITION"
PlacementGroupStrategyCluster PlacementGroupStrategy = "CLUSTER"
PlacementGroupStrategyNone PlacementGroupStrategy = "NONE"
)
// Values returns all known values for PlacementGroupStrategy. 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 (PlacementGroupStrategy) Values() []PlacementGroupStrategy {
return []PlacementGroupStrategy{
"SPREAD",
"PARTITION",
"CLUSTER",
"NONE",
}
}
type ReconfigurationType string
// Enum values for ReconfigurationType
const (
ReconfigurationTypeOverwrite ReconfigurationType = "OVERWRITE"
ReconfigurationTypeMerge ReconfigurationType = "MERGE"
)
// Values returns all known values for ReconfigurationType. 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 (ReconfigurationType) Values() []ReconfigurationType {
return []ReconfigurationType{
"OVERWRITE",
"MERGE",
}
}
type RepoUpgradeOnBoot string
// Enum values for RepoUpgradeOnBoot
const (
RepoUpgradeOnBootSecurity RepoUpgradeOnBoot = "SECURITY"
RepoUpgradeOnBootNone RepoUpgradeOnBoot = "NONE"
)
// Values returns all known values for RepoUpgradeOnBoot. 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 (RepoUpgradeOnBoot) Values() []RepoUpgradeOnBoot {
return []RepoUpgradeOnBoot{
"SECURITY",
"NONE",
}
}
type ScaleDownBehavior string
// Enum values for ScaleDownBehavior
const (
ScaleDownBehaviorTerminateAtInstanceHour ScaleDownBehavior = "TERMINATE_AT_INSTANCE_HOUR"
ScaleDownBehaviorTerminateAtTaskCompletion ScaleDownBehavior = "TERMINATE_AT_TASK_COMPLETION"
)
// Values returns all known values for ScaleDownBehavior. 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 (ScaleDownBehavior) Values() []ScaleDownBehavior {
return []ScaleDownBehavior{
"TERMINATE_AT_INSTANCE_HOUR",
"TERMINATE_AT_TASK_COMPLETION",
}
}
type SpotProvisioningAllocationStrategy string
// Enum values for SpotProvisioningAllocationStrategy
const (
SpotProvisioningAllocationStrategyCapacityOptimized SpotProvisioningAllocationStrategy = "capacity-optimized"
SpotProvisioningAllocationStrategyPriceCapacityOptimized SpotProvisioningAllocationStrategy = "price-capacity-optimized"
SpotProvisioningAllocationStrategyLowestPrice SpotProvisioningAllocationStrategy = "lowest-price"
SpotProvisioningAllocationStrategyDiversified SpotProvisioningAllocationStrategy = "diversified"
)
// Values returns all known values for SpotProvisioningAllocationStrategy. 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 (SpotProvisioningAllocationStrategy) Values() []SpotProvisioningAllocationStrategy {
return []SpotProvisioningAllocationStrategy{
"capacity-optimized",
"price-capacity-optimized",
"lowest-price",
"diversified",
}
}
type SpotProvisioningTimeoutAction string
// Enum values for SpotProvisioningTimeoutAction
const (
SpotProvisioningTimeoutActionSwitchToOnDemand SpotProvisioningTimeoutAction = "SWITCH_TO_ON_DEMAND"
SpotProvisioningTimeoutActionTerminateCluster SpotProvisioningTimeoutAction = "TERMINATE_CLUSTER"
)
// Values returns all known values for SpotProvisioningTimeoutAction. 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 (SpotProvisioningTimeoutAction) Values() []SpotProvisioningTimeoutAction {
return []SpotProvisioningTimeoutAction{
"SWITCH_TO_ON_DEMAND",
"TERMINATE_CLUSTER",
}
}
type Statistic string
// Enum values for Statistic
const (
StatisticSampleCount Statistic = "SAMPLE_COUNT"
StatisticAverage Statistic = "AVERAGE"
StatisticSum Statistic = "SUM"
StatisticMinimum Statistic = "MINIMUM"
StatisticMaximum Statistic = "MAXIMUM"
)
// Values returns all known values for Statistic. 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 (Statistic) Values() []Statistic {
return []Statistic{
"SAMPLE_COUNT",
"AVERAGE",
"SUM",
"MINIMUM",
"MAXIMUM",
}
}
type StepCancellationOption string
// Enum values for StepCancellationOption
const (
StepCancellationOptionSendInterrupt StepCancellationOption = "SEND_INTERRUPT"
StepCancellationOptionTerminateProcess StepCancellationOption = "TERMINATE_PROCESS"
)
// Values returns all known values for StepCancellationOption. 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 (StepCancellationOption) Values() []StepCancellationOption {
return []StepCancellationOption{
"SEND_INTERRUPT",
"TERMINATE_PROCESS",
}
}
type StepExecutionState string
// Enum values for StepExecutionState
const (
StepExecutionStatePending StepExecutionState = "PENDING"
StepExecutionStateRunning StepExecutionState = "RUNNING"
StepExecutionStateContinue StepExecutionState = "CONTINUE"
StepExecutionStateCompleted StepExecutionState = "COMPLETED"
StepExecutionStateCancelled StepExecutionState = "CANCELLED"
StepExecutionStateFailed StepExecutionState = "FAILED"
StepExecutionStateInterrupted StepExecutionState = "INTERRUPTED"
)
// Values returns all known values for StepExecutionState. 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 (StepExecutionState) Values() []StepExecutionState {
return []StepExecutionState{
"PENDING",
"RUNNING",
"CONTINUE",
"COMPLETED",
"CANCELLED",
"FAILED",
"INTERRUPTED",
}
}
type StepState string
// Enum values for StepState
const (
StepStatePending StepState = "PENDING"
StepStateCancelPending StepState = "CANCEL_PENDING"
StepStateRunning StepState = "RUNNING"
StepStateCompleted StepState = "COMPLETED"
StepStateCancelled StepState = "CANCELLED"
StepStateFailed StepState = "FAILED"
StepStateInterrupted StepState = "INTERRUPTED"
)
// Values returns all known values for StepState. 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 (StepState) Values() []StepState {
return []StepState{
"PENDING",
"CANCEL_PENDING",
"RUNNING",
"COMPLETED",
"CANCELLED",
"FAILED",
"INTERRUPTED",
}
}
type StepStateChangeReasonCode string
// Enum values for StepStateChangeReasonCode
const (
StepStateChangeReasonCodeNone StepStateChangeReasonCode = "NONE"
)
// Values returns all known values for StepStateChangeReasonCode. 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 (StepStateChangeReasonCode) Values() []StepStateChangeReasonCode {
return []StepStateChangeReasonCode{
"NONE",
}
}
type Unit string
// Enum values for Unit
const (
UnitNone Unit = "NONE"
UnitSeconds Unit = "SECONDS"
UnitMicroSeconds Unit = "MICRO_SECONDS"
UnitMilliSeconds Unit = "MILLI_SECONDS"
UnitBytes Unit = "BYTES"
UnitKiloBytes Unit = "KILO_BYTES"
UnitMegaBytes Unit = "MEGA_BYTES"
UnitGigaBytes Unit = "GIGA_BYTES"
UnitTeraBytes Unit = "TERA_BYTES"
UnitBits Unit = "BITS"
UnitKiloBits Unit = "KILO_BITS"
UnitMegaBits Unit = "MEGA_BITS"
UnitGigaBits Unit = "GIGA_BITS"
UnitTeraBits Unit = "TERA_BITS"
UnitPercent Unit = "PERCENT"
UnitCount Unit = "COUNT"
UnitBytesPerSecond Unit = "BYTES_PER_SECOND"
UnitKiloBytesPerSecond Unit = "KILO_BYTES_PER_SECOND"
UnitMegaBytesPerSecond Unit = "MEGA_BYTES_PER_SECOND"
UnitGigaBytesPerSecond Unit = "GIGA_BYTES_PER_SECOND"
UnitTeraBytesPerSecond Unit = "TERA_BYTES_PER_SECOND"
UnitBitsPerSecond Unit = "BITS_PER_SECOND"
UnitKiloBitsPerSecond Unit = "KILO_BITS_PER_SECOND"
UnitMegaBitsPerSecond Unit = "MEGA_BITS_PER_SECOND"
UnitGigaBitsPerSecond Unit = "GIGA_BITS_PER_SECOND"
UnitTeraBitsPerSecond Unit = "TERA_BITS_PER_SECOND"
UnitCountPerSecond Unit = "COUNT_PER_SECOND"
)
// Values returns all known values for Unit. 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 (Unit) Values() []Unit {
return []Unit{
"NONE",
"SECONDS",
"MICRO_SECONDS",
"MILLI_SECONDS",
"BYTES",
"KILO_BYTES",
"MEGA_BYTES",
"GIGA_BYTES",
"TERA_BYTES",
"BITS",
"KILO_BITS",
"MEGA_BITS",
"GIGA_BITS",
"TERA_BITS",
"PERCENT",
"COUNT",
"BYTES_PER_SECOND",
"KILO_BYTES_PER_SECOND",
"MEGA_BYTES_PER_SECOND",
"GIGA_BYTES_PER_SECOND",
"TERA_BYTES_PER_SECOND",
"BITS_PER_SECOND",
"KILO_BITS_PER_SECOND",
"MEGA_BITS_PER_SECOND",
"GIGA_BITS_PER_SECOND",
"TERA_BITS_PER_SECOND",
"COUNT_PER_SECOND",
}
}
| 952 |
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"
)
// Indicates that an error occurred while processing the request and that the
// request was not completed.
type InternalServerError struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerError) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerError) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerError) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerError"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// This exception occurs when there is an internal failure in the Amazon EMR
// service.
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// This exception occurs when there is something wrong with user input.
type InvalidRequestException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ *string
noSmithyDocumentSerde
}
func (e *InvalidRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidRequestException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 91 |
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"
)
// With Amazon EMR release version 4.0 and later, the only accepted parameter is
// the application name. To pass arguments to applications, you use configuration
// classifications specified using configuration JSON objects. For more
// information, see Configuring Applications (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html)
// . With earlier Amazon EMR releases, the application is any Amazon or third-party
// software that you can add to the cluster. This structure contains a list of
// strings that indicates the software to use with the cluster and accepts a user
// argument list. Amazon EMR accepts and forwards the argument list to the
// corresponding installation script as bootstrap action argument.
type Application struct {
// This option is for advanced users only. This is meta information about
// third-party applications that third-party vendors use for testing purposes.
AdditionalInfo map[string]string
// Arguments for Amazon EMR to pass to the application.
Args []string
// The name of the application.
Name *string
// The version of the application.
Version *string
noSmithyDocumentSerde
}
// An automatic scaling policy for a core instance group or task instance group in
// an Amazon EMR cluster. An automatic scaling policy defines how an instance group
// dynamically adds and terminates Amazon EC2 instances in response to the value of
// a CloudWatch metric. See PutAutoScalingPolicy .
type AutoScalingPolicy struct {
// The upper and lower Amazon EC2 instance limits for an automatic scaling policy.
// Automatic scaling activity will not cause an instance group to grow above or
// below these limits.
//
// This member is required.
Constraints *ScalingConstraints
// The scale-in and scale-out rules that comprise the automatic scaling policy.
//
// This member is required.
Rules []ScalingRule
noSmithyDocumentSerde
}
// An automatic scaling policy for a core instance group or task instance group in
// an Amazon EMR cluster. The automatic scaling policy defines how an instance
// group dynamically adds and terminates Amazon EC2 instances in response to the
// value of a CloudWatch metric. See PutAutoScalingPolicy .
type AutoScalingPolicyDescription struct {
// The upper and lower Amazon EC2 instance limits for an automatic scaling policy.
// Automatic scaling activity will not cause an instance group to grow above or
// below these limits.
Constraints *ScalingConstraints
// The scale-in and scale-out rules that comprise the automatic scaling policy.
Rules []ScalingRule
// The status of an automatic scaling policy.
Status *AutoScalingPolicyStatus
noSmithyDocumentSerde
}
// The reason for an AutoScalingPolicyStatus change.
type AutoScalingPolicyStateChangeReason struct {
// The code indicating the reason for the change in status. USER_REQUEST indicates
// that the scaling policy status was changed by a user. PROVISION_FAILURE
// indicates that the status change was because the policy failed to provision.
// CLEANUP_FAILURE indicates an error.
Code AutoScalingPolicyStateChangeReasonCode
// A friendly, more verbose message that accompanies an automatic scaling policy
// state change.
Message *string
noSmithyDocumentSerde
}
// The status of an automatic scaling policy.
type AutoScalingPolicyStatus struct {
// Indicates the status of the automatic scaling policy.
State AutoScalingPolicyState
// The reason for a change in status.
StateChangeReason *AutoScalingPolicyStateChangeReason
noSmithyDocumentSerde
}
// An auto-termination policy for an Amazon EMR cluster. An auto-termination
// policy defines the amount of idle time in seconds after which a cluster
// automatically terminates. For alternative cluster termination options, see
// Control cluster termination (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-termination.html)
// .
type AutoTerminationPolicy struct {
// Specifies the amount of idle time in seconds after which the cluster
// automatically terminates. You can specify a minimum of 60 seconds and a maximum
// of 604800 seconds (seven days).
IdleTimeout int64
noSmithyDocumentSerde
}
// A configuration for Amazon EMR block public access. When
// BlockPublicSecurityGroupRules is set to true , Amazon EMR prevents cluster
// creation if one of the cluster's security groups has a rule that allows inbound
// traffic from 0.0.0.0/0 or ::/0 on a port, unless the port is specified as an
// exception using PermittedPublicSecurityGroupRuleRanges .
type BlockPublicAccessConfiguration struct {
// Indicates whether Amazon EMR block public access is enabled ( true ) or disabled
// ( false ). By default, the value is false for accounts that have created Amazon
// EMR clusters before July 2019. For accounts created after this, the default is
// true .
//
// This member is required.
BlockPublicSecurityGroupRules bool
// The classification within a configuration.
Classification *string
// A list of additional configurations to apply within a configuration object.
Configurations []Configuration
// Specifies ports and port ranges that are permitted to have security group rules
// that allow inbound traffic from all public sources. For example, if Port 23
// (Telnet) is specified for PermittedPublicSecurityGroupRuleRanges , Amazon EMR
// allows cluster creation if a security group associated with the cluster has a
// rule that allows inbound traffic on Port 23 from IPv4 0.0.0.0/0 or IPv6 port
// ::/0 as the source. By default, Port 22, which is used for SSH access to the
// cluster Amazon EC2 instances, is in the list of
// PermittedPublicSecurityGroupRuleRanges .
PermittedPublicSecurityGroupRuleRanges []PortRange
// A set of properties specified within a configuration classification.
Properties map[string]string
noSmithyDocumentSerde
}
// Properties that describe the Amazon Web Services principal that created the
// BlockPublicAccessConfiguration using the PutBlockPublicAccessConfiguration
// action as well as the date and time that the configuration was created. Each
// time a configuration for block public access is updated, Amazon EMR updates this
// metadata.
type BlockPublicAccessConfigurationMetadata struct {
// The Amazon Resource Name that created or last modified the configuration.
//
// This member is required.
CreatedByArn *string
// The date and time that the configuration was created.
//
// This member is required.
CreationDateTime *time.Time
noSmithyDocumentSerde
}
// Configuration of a bootstrap action.
type BootstrapActionConfig struct {
// The name of the bootstrap action.
//
// This member is required.
Name *string
// The script run by the bootstrap action.
//
// This member is required.
ScriptBootstrapAction *ScriptBootstrapActionConfig
noSmithyDocumentSerde
}
// Reports the configuration of a bootstrap action in a cluster (job flow).
type BootstrapActionDetail struct {
// A description of the bootstrap action.
BootstrapActionConfig *BootstrapActionConfig
noSmithyDocumentSerde
}
// Specification of the status of a CancelSteps request. Available only in Amazon
// EMR version 4.8.0 and later, excluding version 5.0.0.
type CancelStepsInfo struct {
// The reason for the failure if the CancelSteps request fails.
Reason *string
// The status of a CancelSteps Request. The value may be SUBMITTED or FAILED.
Status CancelStepsRequestStatus
// The encrypted StepId of a step.
StepId *string
noSmithyDocumentSerde
}
// The definition of a CloudWatch metric alarm, which determines when an automatic
// scaling activity is triggered. When the defined alarm conditions are satisfied,
// scaling activity begins.
type CloudWatchAlarmDefinition struct {
// Determines how the metric specified by MetricName is compared to the value
// specified by Threshold .
//
// This member is required.
ComparisonOperator ComparisonOperator
// The name of the CloudWatch metric that is watched to determine an alarm
// condition.
//
// This member is required.
MetricName *string
// The period, in seconds, over which the statistic is applied. CloudWatch metrics
// for Amazon EMR are emitted every five minutes (300 seconds), so if you specify a
// CloudWatch metric, specify 300 .
//
// This member is required.
Period *int32
// The value against which the specified statistic is compared.
//
// This member is required.
Threshold *float64
// A CloudWatch metric dimension.
Dimensions []MetricDimension
// The number of periods, in five-minute increments, during which the alarm
// condition must exist before the alarm triggers automatic scaling activity. The
// default value is 1 .
EvaluationPeriods *int32
// The namespace for the CloudWatch metric. The default is AWS/ElasticMapReduce .
Namespace *string
// The statistic to apply to the metric associated with the alarm. The default is
// AVERAGE .
Statistic Statistic
// The unit of measure associated with the CloudWatch metric being watched. The
// value specified for Unit must correspond to the units specified in the
// CloudWatch metric.
Unit Unit
noSmithyDocumentSerde
}
// The detailed description of the cluster.
type Cluster struct {
// The applications installed on this cluster.
Applications []Application
// An IAM role for automatic scaling policies. The default role is
// EMR_AutoScaling_DefaultRole . The IAM role provides permissions that the
// automatic scaling feature requires to launch and terminate Amazon EC2 instances
// in an instance group.
AutoScalingRole *string
// Specifies whether the cluster should terminate after completing all steps.
AutoTerminate bool
// The Amazon Resource Name of the cluster.
ClusterArn *string
// Applies only to Amazon EMR releases 4.x and later. The list of configurations
// that are supplied to the Amazon EMR cluster.
Configurations []Configuration
// Available only in Amazon EMR releases 5.7.0 and later. The ID of a custom
// Amazon EBS-backed Linux AMI if the cluster uses a custom AMI.
CustomAmiId *string
// The size, in GiB, of the Amazon EBS root device volume of the Linux AMI that is
// used for each Amazon EC2 instance. Available in Amazon EMR releases 4.x and
// later.
EbsRootVolumeSize *int32
// Provides information about the Amazon EC2 instances in a cluster grouped by
// category. For example, key name, subnet ID, IAM instance profile, and so on.
Ec2InstanceAttributes *Ec2InstanceAttributes
// The unique identifier for the cluster.
Id *string
// The instance fleet configuration is available only in Amazon EMR releases 4.8.0
// and later, excluding 5.0.x versions. The instance group configuration of the
// cluster. A value of INSTANCE_GROUP indicates a uniform instance group
// configuration. A value of INSTANCE_FLEET indicates an instance fleets
// configuration.
InstanceCollectionType InstanceCollectionType
// Attributes for Kerberos configuration when Kerberos authentication is enabled
// using a security configuration. For more information see Use Kerberos
// Authentication (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-kerberos.html)
// in the Amazon EMR Management Guide.
KerberosAttributes *KerberosAttributes
// The KMS key used for encrypting log files. This attribute is only available
// with Amazon EMR 5.30.0 and later, excluding Amazon EMR 6.0.0.
LogEncryptionKmsKeyId *string
// The path to the Amazon S3 location where logs for this cluster are stored.
LogUri *string
// The DNS name of the master node. If the cluster is on a private subnet, this is
// the private DNS name. On a public subnet, this is the public DNS name.
MasterPublicDnsName *string
// The name of the cluster.
Name *string
// An approximation of the cost of the cluster, represented in m1.small/hours.
// This value is incremented one time for every hour an m1.small instance runs.
// Larger instances are weighted more, so an Amazon EC2 instance that is roughly
// four times more expensive would result in the normalized instance hours being
// incremented by four. This result is only an approximation and does not reflect
// the actual billing rate.
NormalizedInstanceHours *int32
// The Amazon Linux release specified in a cluster launch RunJobFlow request. If
// no Amazon Linux release was specified, the default Amazon Linux release is shown
// in the response.
OSReleaseLabel *string
// The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.
OutpostArn *string
// Placement group configured for an Amazon EMR cluster.
PlacementGroups []PlacementGroupConfig
// The Amazon EMR release label, which determines the version of open-source
// application packages installed on the cluster. Release labels are in the form
// emr-x.x.x , where x.x.x is an Amazon EMR release version such as emr-5.14.0 .
// For more information about Amazon EMR release versions and included application
// versions and features, see https://docs.aws.amazon.com/emr/latest/ReleaseGuide/ (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/)
// . The release label applies only to Amazon EMR releases version 4.0 and later.
// Earlier versions use AmiVersion .
ReleaseLabel *string
// Applies only when CustomAmiID is used. Specifies the type of updates that the
// Amazon Linux AMI package repositories apply when an instance boots using the
// AMI.
RepoUpgradeOnBoot RepoUpgradeOnBoot
// The AMI version requested for this cluster.
RequestedAmiVersion *string
// The AMI version running on this cluster.
RunningAmiVersion *string
// The way that individual Amazon EC2 instances terminate when an automatic
// scale-in activity occurs or an instance group is resized.
// TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the
// instance-hour boundary, regardless of when the request to terminate the instance
// was submitted. This option is only available with Amazon EMR 5.1.0 and later and
// is the default for clusters created using that version.
// TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list
// and drains tasks from nodes before terminating the Amazon EC2 instances,
// regardless of the instance-hour boundary. With either behavior, Amazon EMR
// removes the least active nodes first and blocks instance termination if it could
// lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION is available only in
// Amazon EMR releases 4.1.0 and later, and is the default for versions of Amazon
// EMR earlier than 5.1.0.
ScaleDownBehavior ScaleDownBehavior
// The name of the security configuration applied to the cluster.
SecurityConfiguration *string
// The IAM role that Amazon EMR assumes in order to access Amazon Web Services
// resources on your behalf.
ServiceRole *string
// The current status details about the cluster.
Status *ClusterStatus
// Specifies the number of steps that can be executed concurrently.
StepConcurrencyLevel *int32
// A list of tags associated with a cluster.
Tags []Tag
// Indicates whether Amazon EMR will lock the cluster to prevent the Amazon EC2
// instances from being terminated by an API call or user intervention, or in the
// event of a cluster error.
TerminationProtected bool
// Indicates whether the cluster is visible to IAM principals in the Amazon Web
// Services account associated with the cluster. When true , IAM principals in the
// Amazon Web Services account can perform Amazon EMR cluster actions on the
// cluster that their IAM policies allow. When false , only the IAM principal that
// created the cluster and the Amazon Web Services account root user can perform
// Amazon EMR actions, regardless of IAM permissions policies attached to other IAM
// principals. The default value is true if a value is not provided when creating
// a cluster using the Amazon EMR API RunJobFlow command, the CLI create-cluster (https://docs.aws.amazon.com/cli/latest/reference/emr/create-cluster.html)
// command, or the Amazon Web Services Management Console.
VisibleToAllUsers bool
noSmithyDocumentSerde
}
// The reason that the cluster changed to its current state.
type ClusterStateChangeReason struct {
// The programmatic code for the state change reason.
Code ClusterStateChangeReasonCode
// The descriptive message for the state change reason.
Message *string
noSmithyDocumentSerde
}
// The detailed status of the cluster.
type ClusterStatus struct {
// A list of tuples that provides information about the errors that caused a
// cluster to terminate. This structure can contain up to 10 different ErrorDetail
// tuples.
ErrorDetails []ErrorDetail
// The current state of the cluster.
State ClusterState
// The reason for the cluster status change.
StateChangeReason *ClusterStateChangeReason
// A timeline that represents the status of a cluster over the lifetime of the
// cluster.
Timeline *ClusterTimeline
noSmithyDocumentSerde
}
// The summary description of the cluster.
type ClusterSummary struct {
// The Amazon Resource Name of the cluster.
ClusterArn *string
// The unique identifier for the cluster.
Id *string
// The name of the cluster.
Name *string
// An approximation of the cost of the cluster, represented in m1.small/hours.
// This value is incremented one time for every hour an m1.small instance runs.
// Larger instances are weighted more, so an Amazon EC2 instance that is roughly
// four times more expensive would result in the normalized instance hours being
// incremented by four. This result is only an approximation and does not reflect
// the actual billing rate.
NormalizedInstanceHours *int32
// The Amazon Resource Name (ARN) of the Outpost where the cluster is launched.
OutpostArn *string
// The details about the current status of the cluster.
Status *ClusterStatus
noSmithyDocumentSerde
}
// Represents the timeline of the cluster's lifecycle.
type ClusterTimeline struct {
// The creation date and time of the cluster.
CreationDateTime *time.Time
// The date and time when the cluster was terminated.
EndDateTime *time.Time
// The date and time when the cluster was ready to run steps.
ReadyDateTime *time.Time
noSmithyDocumentSerde
}
// An entity describing an executable that runs on a cluster.
type Command struct {
// Arguments for Amazon EMR to pass to the command for execution.
Args []string
// The name of the command.
Name *string
// The Amazon S3 location of the command script.
ScriptPath *string
noSmithyDocumentSerde
}
// The Amazon EC2 unit limits for a managed scaling policy. The managed scaling
// activity of a cluster can not be above or below these limits. The limit only
// applies to the core and task nodes. The master node cannot be scaled after
// initial configuration.
type ComputeLimits struct {
// The upper boundary of Amazon EC2 units. It is measured through vCPU cores or
// instances for instance groups and measured through units for instance fleets.
// Managed scaling activities are not allowed beyond this boundary. The limit only
// applies to the core and task nodes. The master node cannot be scaled after
// initial configuration.
//
// This member is required.
MaximumCapacityUnits *int32
// The lower boundary of Amazon EC2 units. It is measured through vCPU cores or
// instances for instance groups and measured through units for instance fleets.
// Managed scaling activities are not allowed beyond this boundary. The limit only
// applies to the core and task nodes. The master node cannot be scaled after
// initial configuration.
//
// This member is required.
MinimumCapacityUnits *int32
// The unit type used for specifying a managed scaling policy.
//
// This member is required.
UnitType ComputeLimitsUnitType
// The upper boundary of Amazon EC2 units for core node type in a cluster. It is
// measured through vCPU cores or instances for instance groups and measured
// through units for instance fleets. The core units are not allowed to scale
// beyond this boundary. The parameter is used to split capacity allocation between
// core and task nodes.
MaximumCoreCapacityUnits *int32
// The upper boundary of On-Demand Amazon EC2 units. It is measured through vCPU
// cores or instances for instance groups and measured through units for instance
// fleets. The On-Demand units are not allowed to scale beyond this boundary. The
// parameter is used to split capacity allocation between On-Demand and Spot
// Instances.
MaximumOnDemandCapacityUnits *int32
noSmithyDocumentSerde
}
// Amazon EMR releases 4.x or later. An optional configuration specification to be
// used when provisioning cluster instances, which can include configurations for
// applications and software bundled with Amazon EMR. A configuration consists of a
// classification, properties, and optional nested configurations. A classification
// refers to an application-specific configuration file. Properties are the
// settings you want to change in that file. For more information, see Configuring
// Applications (https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html)
// .
type Configuration struct {
// The classification within a configuration.
Classification *string
// A list of additional configurations to apply within a configuration object.
Configurations []Configuration
// A set of properties specified within a configuration classification.
Properties map[string]string
noSmithyDocumentSerde
}
// The credentials that you can use to connect to cluster endpoints. Credentials
// consist of a username and a password.
//
// The following types satisfy this interface:
//
// CredentialsMemberUsernamePassword
type Credentials interface {
isCredentials()
}
// The username and password that you use to connect to cluster endpoints.
type CredentialsMemberUsernamePassword struct {
Value UsernamePassword
noSmithyDocumentSerde
}
func (*CredentialsMemberUsernamePassword) isCredentials() {}
// Configuration of requested EBS block device associated with the instance group.
type EbsBlockDevice struct {
// The device name that is exposed to the instance, such as /dev/sdh.
Device *string
// EBS volume specifications such as volume type, IOPS, size (GiB) and throughput
// (MiB/s) that are requested for the EBS volume attached to an Amazon EC2 instance
// in the cluster.
VolumeSpecification *VolumeSpecification
noSmithyDocumentSerde
}
// Configuration of requested EBS block device associated with the instance group
// with count of volumes that are associated to every instance.
type EbsBlockDeviceConfig struct {
// EBS volume specifications such as volume type, IOPS, size (GiB) and throughput
// (MiB/s) that are requested for the EBS volume attached to an Amazon EC2 instance
// in the cluster.
//
// This member is required.
VolumeSpecification *VolumeSpecification
// Number of EBS volumes with a specific volume configuration that are associated
// with every instance in the instance group
VolumesPerInstance *int32
noSmithyDocumentSerde
}
// The Amazon EBS configuration of a cluster instance.
type EbsConfiguration struct {
// An array of Amazon EBS volume specifications attached to a cluster instance.
EbsBlockDeviceConfigs []EbsBlockDeviceConfig
// Indicates whether an Amazon EBS volume is EBS-optimized.
EbsOptimized *bool
noSmithyDocumentSerde
}
// EBS block device that's attached to an Amazon EC2 instance.
type EbsVolume struct {
// The device name that is exposed to the instance, such as /dev/sdh.
Device *string
// The volume identifier of the EBS volume.
VolumeId *string
noSmithyDocumentSerde
}
// Provides information about the Amazon EC2 instances in a cluster grouped by
// category. For example, key name, subnet ID, IAM instance profile, and so on.
type Ec2InstanceAttributes struct {
// A list of additional Amazon EC2 security group IDs for the master node.
AdditionalMasterSecurityGroups []string
// A list of additional Amazon EC2 security group IDs for the core and task nodes.
AdditionalSlaveSecurityGroups []string
// The Availability Zone in which the cluster will run.
Ec2AvailabilityZone *string
// The name of the Amazon EC2 key pair to use when connecting with SSH into the
// master node as a user named "hadoop".
Ec2KeyName *string
// Set this parameter to the identifier of the Amazon VPC subnet where you want
// the cluster to launch. If you do not specify this value, and your account
// supports EC2-Classic, the cluster launches in EC2-Classic.
Ec2SubnetId *string
// The identifier of the Amazon EC2 security group for the master node.
EmrManagedMasterSecurityGroup *string
// The identifier of the Amazon EC2 security group for the core and task nodes.
EmrManagedSlaveSecurityGroup *string
// The IAM role that was specified when the cluster was launched. The Amazon EC2
// instances of the cluster assume this role.
IamInstanceProfile *string
// Applies to clusters configured with the instance fleets option. Specifies one
// or more Availability Zones in which to launch Amazon EC2 cluster instances when
// the EC2-Classic network configuration is supported. Amazon EMR chooses the
// Availability Zone with the best fit from among the list of
// RequestedEc2AvailabilityZones , and then launches all cluster instances within
// that Availability Zone. If you do not specify this value, Amazon EMR chooses the
// Availability Zone for you. RequestedEc2SubnetIDs and
// RequestedEc2AvailabilityZones cannot be specified together.
RequestedEc2AvailabilityZones []string
// Applies to clusters configured with the instance fleets option. Specifies the
// unique identifier of one or more Amazon EC2 subnets in which to launch Amazon
// EC2 cluster instances. Subnets must exist within the same VPC. Amazon EMR
// chooses the Amazon EC2 subnet with the best fit from among the list of
// RequestedEc2SubnetIds , and then launches all cluster instances within that
// Subnet. If this value is not specified, and the account and Region support
// EC2-Classic networks, the cluster launches instances in the EC2-Classic network
// and uses RequestedEc2AvailabilityZones instead of this setting. If EC2-Classic
// is not supported, and no Subnet is specified, Amazon EMR chooses the subnet for
// you. RequestedEc2SubnetIDs and RequestedEc2AvailabilityZones cannot be
// specified together.
RequestedEc2SubnetIds []string
// The identifier of the Amazon EC2 security group for the Amazon EMR service to
// access clusters in VPC private subnets.
ServiceAccessSecurityGroup *string
noSmithyDocumentSerde
}
// A tuple that provides information about an error that caused a cluster to
// terminate.
type ErrorDetail struct {
// The name or code associated with the error.
ErrorCode *string
// A list of key value pairs that provides contextual information about why an
// error occured.
ErrorData []map[string]string
// A message that describes the error.
ErrorMessage *string
noSmithyDocumentSerde
}
// Specifies the execution engine (cluster) to run the notebook and perform the
// notebook execution, for example, an Amazon EMR cluster.
type ExecutionEngineConfig struct {
// The unique identifier of the execution engine. For an Amazon EMR cluster, this
// is the cluster ID.
//
// This member is required.
Id *string
// The execution role ARN required for the notebook execution.
ExecutionRoleArn *string
// An optional unique ID of an Amazon EC2 security group to associate with the
// master instance of the Amazon EMR cluster for this notebook execution. For more
// information see Specifying Amazon EC2 Security Groups for Amazon EMR Notebooks (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-notebooks-security-groups.html)
// in the EMR Management Guide.
MasterInstanceSecurityGroupId *string
// The type of execution engine. A value of EMR specifies an Amazon EMR cluster.
Type ExecutionEngineType
noSmithyDocumentSerde
}
// The details of the step failure. The service attempts to detect the root cause
// for many common failures.
type FailureDetails struct {
// The path to the log file where the step failure root cause was originally
// recorded.
LogFile *string
// The descriptive message including the error the Amazon EMR service has
// identified as the cause of step failure. This is text from an error log that
// describes the root cause of the failure.
Message *string
// The reason for the step failure. In the case where the service cannot
// successfully determine the root cause of the failure, it returns "Unknown Error"
// as a reason.
Reason *string
noSmithyDocumentSerde
}
// A job flow step consisting of a JAR file whose main function will be executed.
// The main function submits a job for Hadoop to execute and waits for the job to
// finish or fail.
type HadoopJarStepConfig struct {
// A path to a JAR file run during the step.
//
// This member is required.
Jar *string
// A list of command line arguments passed to the JAR file's main function when
// executed.
Args []string
// The name of the main class in the specified Java file. If not specified, the
// JAR file should specify a Main-Class in its manifest file.
MainClass *string
// A list of Java properties that are set when the step runs. You can use these
// properties to pass key-value pairs to your main function.
Properties []KeyValue
noSmithyDocumentSerde
}
// A cluster step consisting of a JAR file whose main function will be executed.
// The main function submits a job for Hadoop to execute and waits for the job to
// finish or fail.
type HadoopStepConfig struct {
// The list of command line arguments to pass to the JAR file's main function for
// execution.
Args []string
// The path to the JAR file that runs during the step.
Jar *string
// The name of the main class in the specified Java file. If not specified, the
// JAR file should specify a main class in its manifest file.
MainClass *string
// The list of Java properties that are set when the step runs. You can use these
// properties to pass key-value pairs to your main function.
Properties map[string]string
noSmithyDocumentSerde
}
// Represents an Amazon EC2 instance provisioned as part of cluster.
type Instance struct {
// The list of Amazon EBS volumes that are attached to this instance.
EbsVolumes []EbsVolume
// The unique identifier of the instance in Amazon EC2.
Ec2InstanceId *string
// The unique identifier for the instance in Amazon EMR.
Id *string
// The unique identifier of the instance fleet to which an Amazon EC2 instance
// belongs.
InstanceFleetId *string
// The identifier of the instance group to which this instance belongs.
InstanceGroupId *string
// The Amazon EC2 instance type, for example m3.xlarge .
InstanceType *string
// The instance purchasing option. Valid values are ON_DEMAND or SPOT .
Market MarketType
// The private DNS name of the instance.
PrivateDnsName *string
// The private IP address of the instance.
PrivateIpAddress *string
// The public DNS name of the instance.
PublicDnsName *string
// The public IP address of the instance.
PublicIpAddress *string
// The current status of the instance.
Status *InstanceStatus
noSmithyDocumentSerde
}
// Describes an instance fleet, which is a group of Amazon EC2 instances that host
// a particular node type (master, core, or task) in an Amazon EMR cluster.
// Instance fleets can consist of a mix of instance types and On-Demand and Spot
// Instances, which are provisioned to meet a defined target capacity. The instance
// fleet configuration is available only in Amazon EMR releases 4.8.0 and later,
// excluding 5.0.x versions.
type InstanceFleet struct {
// The unique identifier of the instance fleet.
Id *string
// The node type that the instance fleet hosts. Valid values are MASTER, CORE, or
// TASK.
InstanceFleetType InstanceFleetType
// An array of specifications for the instance types that comprise an instance
// fleet.
InstanceTypeSpecifications []InstanceTypeSpecification
// Describes the launch specification for an instance fleet.
LaunchSpecifications *InstanceFleetProvisioningSpecifications
// A friendly name for the instance fleet.
Name *string
// The number of On-Demand units that have been provisioned for the instance fleet
// to fulfill TargetOnDemandCapacity . This provisioned capacity might be less than
// or greater than TargetOnDemandCapacity .
ProvisionedOnDemandCapacity *int32
// The number of Spot units that have been provisioned for this instance fleet to
// fulfill TargetSpotCapacity . This provisioned capacity might be less than or
// greater than TargetSpotCapacity .
ProvisionedSpotCapacity *int32
// The resize specification for the instance fleet.
ResizeSpecifications *InstanceFleetResizingSpecifications
// The current status of the instance fleet.
Status *InstanceFleetStatus
// The target capacity of On-Demand units for the instance fleet, which determines
// how many On-Demand Instances to provision. When the instance fleet launches,
// Amazon EMR tries to provision On-Demand Instances as specified by
// InstanceTypeConfig . Each instance configuration has a specified
// WeightedCapacity . When an On-Demand Instance is provisioned, the
// WeightedCapacity units count toward the target capacity. Amazon EMR provisions
// instances until the target capacity is totally fulfilled, even if this results
// in an overage. For example, if there are 2 units remaining to fulfill capacity,
// and Amazon EMR can only provision an instance with a WeightedCapacity of 5
// units, the instance is provisioned, and the target capacity is exceeded by 3
// units. You can use InstanceFleet$ProvisionedOnDemandCapacity to determine the
// Spot capacity units that have been provisioned for the instance fleet. If not
// specified or set to 0, only Spot Instances are provisioned for the instance
// fleet using TargetSpotCapacity . At least one of TargetSpotCapacity and
// TargetOnDemandCapacity should be greater than 0. For a master instance fleet,
// only one of TargetSpotCapacity and TargetOnDemandCapacity can be specified, and
// its value must be 1.
TargetOnDemandCapacity *int32
// The target capacity of Spot units for the instance fleet, which determines how
// many Spot Instances to provision. When the instance fleet launches, Amazon EMR
// tries to provision Spot Instances as specified by InstanceTypeConfig . Each
// instance configuration has a specified WeightedCapacity . When a Spot instance
// is provisioned, the WeightedCapacity units count toward the target capacity.
// Amazon EMR provisions instances until the target capacity is totally fulfilled,
// even if this results in an overage. For example, if there are 2 units remaining
// to fulfill capacity, and Amazon EMR can only provision an instance with a
// WeightedCapacity of 5 units, the instance is provisioned, and the target
// capacity is exceeded by 3 units. You can use
// InstanceFleet$ProvisionedSpotCapacity to determine the Spot capacity units that
// have been provisioned for the instance fleet. If not specified or set to 0, only
// On-Demand Instances are provisioned for the instance fleet. At least one of
// TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a
// master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity
// can be specified, and its value must be 1.
TargetSpotCapacity *int32
noSmithyDocumentSerde
}
// The configuration that defines an instance fleet. The instance fleet
// configuration is available only in Amazon EMR releases 4.8.0 and later,
// excluding 5.0.x versions.
type InstanceFleetConfig struct {
// The node type that the instance fleet hosts. Valid values are MASTER, CORE, and
// TASK.
//
// This member is required.
InstanceFleetType InstanceFleetType
// The instance type configurations that define the Amazon EC2 instances in the
// instance fleet.
InstanceTypeConfigs []InstanceTypeConfig
// The launch specification for the instance fleet.
LaunchSpecifications *InstanceFleetProvisioningSpecifications
// The friendly name of the instance fleet.
Name *string
// The resize specification for the instance fleet.
ResizeSpecifications *InstanceFleetResizingSpecifications
// The target capacity of On-Demand units for the instance fleet, which determines
// how many On-Demand Instances to provision. When the instance fleet launches,
// Amazon EMR tries to provision On-Demand Instances as specified by
// InstanceTypeConfig . Each instance configuration has a specified
// WeightedCapacity . When an On-Demand Instance is provisioned, the
// WeightedCapacity units count toward the target capacity. Amazon EMR provisions
// instances until the target capacity is totally fulfilled, even if this results
// in an overage. For example, if there are 2 units remaining to fulfill capacity,
// and Amazon EMR can only provision an instance with a WeightedCapacity of 5
// units, the instance is provisioned, and the target capacity is exceeded by 3
// units. If not specified or set to 0, only Spot Instances are provisioned for the
// instance fleet using TargetSpotCapacity . At least one of TargetSpotCapacity
// and TargetOnDemandCapacity should be greater than 0. For a master instance
// fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity can be
// specified, and its value must be 1.
TargetOnDemandCapacity *int32
// The target capacity of Spot units for the instance fleet, which determines how
// many Spot Instances to provision. When the instance fleet launches, Amazon EMR
// tries to provision Spot Instances as specified by InstanceTypeConfig . Each
// instance configuration has a specified WeightedCapacity . When a Spot Instance
// is provisioned, the WeightedCapacity units count toward the target capacity.
// Amazon EMR provisions instances until the target capacity is totally fulfilled,
// even if this results in an overage. For example, if there are 2 units remaining
// to fulfill capacity, and Amazon EMR can only provision an instance with a
// WeightedCapacity of 5 units, the instance is provisioned, and the target
// capacity is exceeded by 3 units. If not specified or set to 0, only On-Demand
// Instances are provisioned for the instance fleet. At least one of
// TargetSpotCapacity and TargetOnDemandCapacity should be greater than 0. For a
// master instance fleet, only one of TargetSpotCapacity and TargetOnDemandCapacity
// can be specified, and its value must be 1.
TargetSpotCapacity *int32
noSmithyDocumentSerde
}
// Configuration parameters for an instance fleet modification request. The
// instance fleet configuration is available only in Amazon EMR releases 4.8.0 and
// later, excluding 5.0.x versions.
type InstanceFleetModifyConfig struct {
// A unique identifier for the instance fleet.
//
// This member is required.
InstanceFleetId *string
// The resize specification for the instance fleet.
ResizeSpecifications *InstanceFleetResizingSpecifications
// The target capacity of On-Demand units for the instance fleet. For more
// information see InstanceFleetConfig$TargetOnDemandCapacity .
TargetOnDemandCapacity *int32
// The target capacity of Spot units for the instance fleet. For more information,
// see InstanceFleetConfig$TargetSpotCapacity .
TargetSpotCapacity *int32
noSmithyDocumentSerde
}
// The launch specification for Spot Instances in the fleet, which determines the
// defined duration, provisioning timeout behavior, and allocation strategy. The
// instance fleet configuration is available only in Amazon EMR releases 4.8.0 and
// later, excluding 5.0.x versions. On-Demand and Spot instance allocation
// strategies are available in Amazon EMR releases 5.12.1 and later.
type InstanceFleetProvisioningSpecifications struct {
// The launch specification for On-Demand Instances in the instance fleet, which
// determines the allocation strategy. The instance fleet configuration is
// available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.
// On-Demand Instances allocation strategy is available in Amazon EMR releases
// 5.12.1 and later.
OnDemandSpecification *OnDemandProvisioningSpecification
// The launch specification for Spot instances in the fleet, which determines the
// defined duration, provisioning timeout behavior, and allocation strategy.
SpotSpecification *SpotProvisioningSpecification
noSmithyDocumentSerde
}
// The resize specification for On-Demand and Spot Instances in the fleet.
type InstanceFleetResizingSpecifications struct {
// The resize specification for On-Demand Instances in the instance fleet, which
// contains the resize timeout period.
OnDemandResizeSpecification *OnDemandResizingSpecification
// The resize specification for Spot Instances in the instance fleet, which
// contains the resize timeout period.
SpotResizeSpecification *SpotResizingSpecification
noSmithyDocumentSerde
}
// Provides status change reason details for the instance fleet. The instance
// fleet configuration is available only in Amazon EMR releases 4.8.0 and later,
// excluding 5.0.x versions.
type InstanceFleetStateChangeReason struct {
// A code corresponding to the reason the state change occurred.
Code InstanceFleetStateChangeReasonCode
// An explanatory message.
Message *string
noSmithyDocumentSerde
}
// The status of the instance fleet. The instance fleet configuration is available
// only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.
type InstanceFleetStatus struct {
// A code representing the instance fleet status.
// - PROVISIONING —The instance fleet is provisioning Amazon EC2 resources and is
// not yet ready to run jobs.
// - BOOTSTRAPPING —Amazon EC2 instances and other resources have been
// provisioned and the bootstrap actions specified for the instances are underway.
// - RUNNING —Amazon EC2 instances and other resources are running. They are
// either executing jobs or waiting to execute jobs.
// - RESIZING —A resize operation is underway. Amazon EC2 instances are either
// being added or removed.
// - SUSPENDED —A resize operation could not complete. Existing Amazon EC2
// instances are running, but instances can't be added or removed.
// - TERMINATING —The instance fleet is terminating Amazon EC2 instances.
// - TERMINATED —The instance fleet is no longer active, and all Amazon EC2
// instances have been terminated.
State InstanceFleetState
// Provides status change reason details for the instance fleet.
StateChangeReason *InstanceFleetStateChangeReason
// Provides historical timestamps for the instance fleet, including the time of
// creation, the time it became ready to run jobs, and the time of termination.
Timeline *InstanceFleetTimeline
noSmithyDocumentSerde
}
// Provides historical timestamps for the instance fleet, including the time of
// creation, the time it became ready to run jobs, and the time of termination. The
// instance fleet configuration is available only in Amazon EMR releases 4.8.0 and
// later, excluding 5.0.x versions.
type InstanceFleetTimeline struct {
// The time and date the instance fleet was created.
CreationDateTime *time.Time
// The time and date the instance fleet terminated.
EndDateTime *time.Time
// The time and date the instance fleet was ready to run jobs.
ReadyDateTime *time.Time
noSmithyDocumentSerde
}
// This entity represents an instance group, which is a group of instances that
// have common purpose. For example, CORE instance group is used for HDFS.
type InstanceGroup struct {
// An automatic scaling policy for a core instance group or task instance group in
// an Amazon EMR cluster. The automatic scaling policy defines how an instance
// group dynamically adds and terminates Amazon EC2 instances in response to the
// value of a CloudWatch metric. See PutAutoScalingPolicy.
AutoScalingPolicy *AutoScalingPolicyDescription
// If specified, indicates that the instance group uses Spot Instances. This is
// the maximum price you are willing to pay for Spot Instances. Specify
// OnDemandPrice to set the amount equal to the On-Demand price, or specify an
// amount in USD.
BidPrice *string
// Amazon EMR releases 4.x or later. The list of configurations supplied for an
// Amazon EMR cluster instance group. You can specify a separate configuration for
// each instance group (master, core, and task).
Configurations []Configuration
// The version number of the requested configuration specification for this
// instance group.
ConfigurationsVersion int64
// The custom AMI ID to use for the provisioned instance group.
CustomAmiId *string
// The EBS block devices that are mapped to this instance group.
EbsBlockDevices []EbsBlockDevice
// If the instance group is EBS-optimized. An Amazon EBS-optimized instance uses
// an optimized configuration stack and provides additional, dedicated capacity for
// Amazon EBS I/O.
EbsOptimized *bool
// The identifier of the instance group.
Id *string
// The type of the instance group. Valid values are MASTER, CORE or TASK.
InstanceGroupType InstanceGroupType
// The Amazon EC2 instance type for all instances in the instance group.
InstanceType *string
// A list of configurations that were successfully applied for an instance group
// last time.
LastSuccessfullyAppliedConfigurations []Configuration
// The version number of a configuration specification that was successfully
// applied for an instance group last time.
LastSuccessfullyAppliedConfigurationsVersion int64
// The marketplace to provision instances for this group. Valid values are
// ON_DEMAND or SPOT.
Market MarketType
// The name of the instance group.
Name *string
// The target number of instances for the instance group.
RequestedInstanceCount *int32
// The number of instances currently running in this instance group.
RunningInstanceCount *int32
// Policy for customizing shrink operations.
ShrinkPolicy *ShrinkPolicy
// The current status of the instance group.
Status *InstanceGroupStatus
noSmithyDocumentSerde
}
// Configuration defining a new instance group.
type InstanceGroupConfig struct {
// Target number of instances for the instance group.
//
// This member is required.
InstanceCount *int32
// The role of the instance group in the cluster.
//
// This member is required.
InstanceRole InstanceRoleType
// The Amazon EC2 instance type for all instances in the instance group.
//
// This member is required.
InstanceType *string
// An automatic scaling policy for a core instance group or task instance group in
// an Amazon EMR cluster. The automatic scaling policy defines how an instance
// group dynamically adds and terminates Amazon EC2 instances in response to the
// value of a CloudWatch metric. See PutAutoScalingPolicy .
AutoScalingPolicy *AutoScalingPolicy
// If specified, indicates that the instance group uses Spot Instances. This is
// the maximum price you are willing to pay for Spot Instances. Specify
// OnDemandPrice to set the amount equal to the On-Demand price, or specify an
// amount in USD.
BidPrice *string
// Amazon EMR releases 4.x or later. The list of configurations supplied for an
// Amazon EMR cluster instance group. You can specify a separate configuration for
// each instance group (master, core, and task).
Configurations []Configuration
// The custom AMI ID to use for the provisioned instance group.
CustomAmiId *string
// EBS configurations that will be attached to each Amazon EC2 instance in the
// instance group.
EbsConfiguration *EbsConfiguration
// Market type of the Amazon EC2 instances used to create a cluster node.
Market MarketType
// Friendly name given to the instance group.
Name *string
noSmithyDocumentSerde
}
// Detailed information about an instance group.
type InstanceGroupDetail struct {
// The date/time the instance group was created.
//
// This member is required.
CreationDateTime *time.Time
// Target number of instances to run in the instance group.
//
// This member is required.
InstanceRequestCount *int32
// Instance group role in the cluster
//
// This member is required.
InstanceRole InstanceRoleType
// Actual count of running instances.
//
// This member is required.
InstanceRunningCount *int32
// Amazon EC2 instance type.
//
// This member is required.
InstanceType *string
// Market type of the Amazon EC2 instances used to create a cluster node.
//
// This member is required.
Market MarketType
// State of instance group. The following values are no longer supported:
// STARTING, TERMINATED, and FAILED.
//
// This member is required.
State InstanceGroupState
// If specified, indicates that the instance group uses Spot Instances. This is
// the maximum price you are willing to pay for Spot Instances. Specify
// OnDemandPrice to set the amount equal to the On-Demand price, or specify an
// amount in USD.
BidPrice *string
// The custom AMI ID to use for the provisioned instance group.
CustomAmiId *string
// The date/time the instance group was terminated.
EndDateTime *time.Time
// Unique identifier for the instance group.
InstanceGroupId *string
// Details regarding the state of the instance group.
LastStateChangeReason *string
// Friendly name for the instance group.
Name *string
// The date/time the instance group was available to the cluster.
ReadyDateTime *time.Time
// The date/time the instance group was started.
StartDateTime *time.Time
noSmithyDocumentSerde
}
// Modify the size or configurations of an instance group.
type InstanceGroupModifyConfig struct {
// Unique ID of the instance group to modify.
//
// This member is required.
InstanceGroupId *string
// A list of new or modified configurations to apply for an instance group.
Configurations []Configuration
// The Amazon EC2 InstanceIds to terminate. After you terminate the instances, the
// instance group will not return to its original requested size.
EC2InstanceIdsToTerminate []string
// Target size for the instance group.
InstanceCount *int32
// Type of reconfiguration requested. Valid values are MERGE and OVERWRITE.
ReconfigurationType ReconfigurationType
// Policy for customizing shrink operations.
ShrinkPolicy *ShrinkPolicy
noSmithyDocumentSerde
}
// The status change reason details for the instance group.
type InstanceGroupStateChangeReason struct {
// The programmable code for the state change reason.
Code InstanceGroupStateChangeReasonCode
// The status change reason description.
Message *string
noSmithyDocumentSerde
}
// The details of the instance group status.
type InstanceGroupStatus struct {
// The current state of the instance group.
State InstanceGroupState
// The status change reason details for the instance group.
StateChangeReason *InstanceGroupStateChangeReason
// The timeline of the instance group status over time.
Timeline *InstanceGroupTimeline
noSmithyDocumentSerde
}
// The timeline of the instance group lifecycle.
type InstanceGroupTimeline struct {
// The creation date and time of the instance group.
CreationDateTime *time.Time
// The date and time when the instance group terminated.
EndDateTime *time.Time
// The date and time when the instance group became ready to perform tasks.
ReadyDateTime *time.Time
noSmithyDocumentSerde
}
// Custom policy for requesting termination protection or termination of specific
// instances when shrinking an instance group.
type InstanceResizePolicy struct {
// Decommissioning timeout override for the specific list of instances to be
// terminated.
InstanceTerminationTimeout *int32
// Specific list of instances to be protected when shrinking an instance group.
InstancesToProtect []string
// Specific list of instances to be terminated when shrinking an instance group.
InstancesToTerminate []string
noSmithyDocumentSerde
}
// The details of the status change reason for the instance.
type InstanceStateChangeReason struct {
// The programmable code for the state change reason.
Code InstanceStateChangeReasonCode
// The status change reason description.
Message *string
noSmithyDocumentSerde
}
// The instance status details.
type InstanceStatus struct {
// The current state of the instance.
State InstanceState
// The details of the status change reason for the instance.
StateChangeReason *InstanceStateChangeReason
// The timeline of the instance status over time.
Timeline *InstanceTimeline
noSmithyDocumentSerde
}
// The timeline of the instance lifecycle.
type InstanceTimeline struct {
// The creation date and time of the instance.
CreationDateTime *time.Time
// The date and time when the instance was terminated.
EndDateTime *time.Time
// The date and time when the instance was ready to perform tasks.
ReadyDateTime *time.Time
noSmithyDocumentSerde
}
// An instance type configuration for each instance type in an instance fleet,
// which determines the Amazon EC2 instances Amazon EMR attempts to provision to
// fulfill On-Demand and Spot target capacities. When you use an allocation
// strategy, you can include a maximum of 30 instance type configurations for a
// fleet. For more information about how to use an allocation strategy, see
// Configure Instance Fleets (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-instance-fleet.html)
// . Without an allocation strategy, you may specify a maximum of five instance
// type configurations for a fleet. The instance fleet configuration is available
// only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.
type InstanceTypeConfig struct {
// An Amazon EC2 instance type, such as m3.xlarge .
//
// This member is required.
InstanceType *string
// The bid price for each Amazon EC2 Spot Instance type as defined by InstanceType
// . Expressed in USD. If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice
// is provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
BidPrice *string
// The bid price, as a percentage of On-Demand price, for each Amazon EC2 Spot
// Instance as defined by InstanceType . Expressed as a number (for example, 20
// specifies 20%). If neither BidPrice nor BidPriceAsPercentageOfOnDemandPrice is
// provided, BidPriceAsPercentageOfOnDemandPrice defaults to 100%.
BidPriceAsPercentageOfOnDemandPrice *float64
// A configuration classification that applies when provisioning cluster
// instances, which can include configurations for applications and software that
// run on the cluster.
Configurations []Configuration
// The custom AMI ID to use for the instance type.
CustomAmiId *string
// The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each
// instance as defined by InstanceType .
EbsConfiguration *EbsConfiguration
// The number of units that a provisioned instance of this type provides toward
// fulfilling the target capacities defined in InstanceFleetConfig . This value is
// 1 for a master instance fleet, and must be 1 or greater for core and task
// instance fleets. Defaults to 1 if not specified.
WeightedCapacity *int32
noSmithyDocumentSerde
}
// The configuration specification for each instance type in an instance fleet.
// The instance fleet configuration is available only in Amazon EMR releases 4.8.0
// and later, excluding 5.0.x versions.
type InstanceTypeSpecification struct {
// The bid price for each Amazon EC2 Spot Instance type as defined by InstanceType
// . Expressed in USD.
BidPrice *string
// The bid price, as a percentage of On-Demand price, for each Amazon EC2 Spot
// Instance as defined by InstanceType . Expressed as a number (for example, 20
// specifies 20%).
BidPriceAsPercentageOfOnDemandPrice *float64
// A configuration classification that applies when provisioning cluster
// instances, which can include configurations for applications and software
// bundled with Amazon EMR.
Configurations []Configuration
// The custom AMI ID to use for the instance type.
CustomAmiId *string
// The configuration of Amazon Elastic Block Store (Amazon EBS) attached to each
// instance as defined by InstanceType .
EbsBlockDevices []EbsBlockDevice
// Evaluates to TRUE when the specified InstanceType is EBS-optimized.
EbsOptimized *bool
// The Amazon EC2 instance type, for example m3.xlarge .
InstanceType *string
// The number of units that a provisioned instance of this type provides toward
// fulfilling the target capacities defined in InstanceFleetConfig . Capacity
// values represent performance characteristics such as vCPUs, memory, or I/O. If
// not specified, the default value is 1.
WeightedCapacity *int32
noSmithyDocumentSerde
}
// A description of a cluster (job flow).
type JobFlowDetail struct {
// Describes the execution status of the job flow.
//
// This member is required.
ExecutionStatusDetail *JobFlowExecutionStatusDetail
// Describes the Amazon EC2 instances of the job flow.
//
// This member is required.
Instances *JobFlowInstancesDetail
// The job flow identifier.
//
// This member is required.
JobFlowId *string
// The name of the job flow.
//
// This member is required.
Name *string
// Applies only to Amazon EMR AMI versions 3.x and 2.x. For Amazon EMR releases
// 4.0 and later, ReleaseLabel is used. To specify a custom AMI, use CustomAmiID .
AmiVersion *string
// An IAM role for automatic scaling policies. The default role is
// EMR_AutoScaling_DefaultRole . The IAM role provides a way for the automatic
// scaling feature to get the required permissions it needs to launch and terminate
// Amazon EC2 instances in an instance group.
AutoScalingRole *string
// A list of the bootstrap actions run by the job flow.
BootstrapActions []BootstrapActionDetail
// The IAM role that was specified when the job flow was launched. The Amazon EC2
// instances of the job flow assume this role.
JobFlowRole *string
// The KMS key used for encrypting log files. This attribute is only available
// with Amazon EMR 5.30.0 and later, excluding 6.0.0.
LogEncryptionKmsKeyId *string
// The location in Amazon S3 where log files for the job are stored.
LogUri *string
// The way that individual Amazon EC2 instances terminate when an automatic
// scale-in activity occurs or an instance group is resized.
// TERMINATE_AT_INSTANCE_HOUR indicates that Amazon EMR terminates nodes at the
// instance-hour boundary, regardless of when the request to terminate the instance
// was submitted. This option is only available with Amazon EMR 5.1.0 and later and
// is the default for clusters created using that version.
// TERMINATE_AT_TASK_COMPLETION indicates that Amazon EMR adds nodes to a deny list
// and drains tasks from nodes before terminating the Amazon EC2 instances,
// regardless of the instance-hour boundary. With either behavior, Amazon EMR
// removes the least active nodes first and blocks instance termination if it could
// lead to HDFS corruption. TERMINATE_AT_TASK_COMPLETION available only in Amazon
// EMR releases 4.1.0 and later, and is the default for releases of Amazon EMR
// earlier than 5.1.0.
ScaleDownBehavior ScaleDownBehavior
// The IAM role that is assumed by the Amazon EMR service to access Amazon Web
// Services resources on your behalf.
ServiceRole *string
// A list of steps run by the job flow.
Steps []StepDetail
// A list of strings set by third-party software when the job flow is launched. If
// you are not using third-party software to manage the job flow, this value is
// empty.
SupportedProducts []string
// Indicates whether the cluster is visible to IAM principals in the Amazon Web
// Services account associated with the cluster. When true , IAM principals in the
// Amazon Web Services account can perform Amazon EMR cluster actions that their
// IAM policies allow. When false , only the IAM principal that created the cluster
// and the Amazon Web Services account root user can perform Amazon EMR actions,
// regardless of IAM permissions policies attached to other IAM principals. The
// default value is true if a value is not provided when creating a cluster using
// the Amazon EMR API RunJobFlow command, the CLI create-cluster (https://docs.aws.amazon.com/cli/latest/reference/emr/create-cluster.html)
// command, or the Amazon Web Services Management Console.
VisibleToAllUsers bool
noSmithyDocumentSerde
}
// Describes the status of the cluster (job flow).
type JobFlowExecutionStatusDetail struct {
// The creation date and time of the job flow.
//
// This member is required.
CreationDateTime *time.Time
// The state of the job flow.
//
// This member is required.
State JobFlowExecutionState
// The completion date and time of the job flow.
EndDateTime *time.Time
// Description of the job flow last changed state.
LastStateChangeReason *string
// The date and time when the job flow was ready to start running bootstrap
// actions.
ReadyDateTime *time.Time
// The start date and time of the job flow.
StartDateTime *time.Time
noSmithyDocumentSerde
}
// A description of the Amazon EC2 instance on which the cluster (job flow) runs.
// A valid JobFlowInstancesConfig must contain either InstanceGroups or
// InstanceFleets. They cannot be used together. You may also have
// MasterInstanceType, SlaveInstanceType, and InstanceCount (all three must be
// present), but we don't recommend this configuration.
type JobFlowInstancesConfig struct {
// A list of additional Amazon EC2 security group IDs for the master node.
AdditionalMasterSecurityGroups []string
// A list of additional Amazon EC2 security group IDs for the core and task nodes.
AdditionalSlaveSecurityGroups []string
// The name of the Amazon EC2 key pair that can be used to connect to the master
// node using SSH as the user called "hadoop."
Ec2KeyName *string
// Applies to clusters that use the uniform instance group configuration. To
// launch the cluster in Amazon Virtual Private Cloud (Amazon VPC), set this
// parameter to the identifier of the Amazon VPC subnet where you want the cluster
// to launch. If you do not specify this value and your account supports
// EC2-Classic, the cluster launches in EC2-Classic.
Ec2SubnetId *string
// Applies to clusters that use the instance fleet configuration. When multiple
// Amazon EC2 subnet IDs are specified, Amazon EMR evaluates them and launches
// instances in the optimal subnet. The instance fleet configuration is available
// only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.
Ec2SubnetIds []string
// The identifier of the Amazon EC2 security group for the master node. If you
// specify EmrManagedMasterSecurityGroup , you must also specify
// EmrManagedSlaveSecurityGroup .
EmrManagedMasterSecurityGroup *string
// The identifier of the Amazon EC2 security group for the core and task nodes. If
// you specify EmrManagedSlaveSecurityGroup , you must also specify
// EmrManagedMasterSecurityGroup .
EmrManagedSlaveSecurityGroup *string
// Applies only to Amazon EMR release versions earlier than 4.0. The Hadoop
// version for the cluster. Valid inputs are "0.18" (no longer maintained), "0.20"
// (no longer maintained), "0.20.205" (no longer maintained), "1.0.3", "2.2.0", or
// "2.4.0". If you do not set this value, the default of 0.18 is used, unless the
// AmiVersion parameter is set in the RunJobFlow call, in which case the default
// version of Hadoop for that AMI version is used.
HadoopVersion *string
// The number of Amazon EC2 instances in the cluster.
InstanceCount *int32
// The instance fleet configuration is available only in Amazon EMR releases 4.8.0
// and later, excluding 5.0.x versions. Describes the Amazon EC2 instances and
// instance configurations for clusters that use the instance fleet configuration.
InstanceFleets []InstanceFleetConfig
// Configuration for the instance groups in a cluster.
InstanceGroups []InstanceGroupConfig
// Specifies whether the cluster should remain available after completing all
// steps. Defaults to true . For more information about configuring cluster
// termination, see Control Cluster Termination (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-termination.html)
// in the EMR Management Guide.
KeepJobFlowAliveWhenNoSteps bool
// The Amazon EC2 instance type of the master node.
MasterInstanceType *string
// The Availability Zone in which the cluster runs.
Placement *PlacementType
// The identifier of the Amazon EC2 security group for the Amazon EMR service to
// access clusters in VPC private subnets.
ServiceAccessSecurityGroup *string
// The Amazon EC2 instance type of the core and task nodes.
SlaveInstanceType *string
// Specifies whether to lock the cluster to prevent the Amazon EC2 instances from
// being terminated by API call, user intervention, or in the event of a job-flow
// error.
TerminationProtected bool
noSmithyDocumentSerde
}
// Specify the type of Amazon EC2 instances that the cluster (job flow) runs on.
type JobFlowInstancesDetail struct {
// The number of Amazon EC2 instances in the cluster. If the value is 1, the same
// instance serves as both the master and core and task node. If the value is
// greater than 1, one instance is the master node and all others are core and task
// nodes.
//
// This member is required.
InstanceCount *int32
// The Amazon EC2 master node instance type.
//
// This member is required.
MasterInstanceType *string
// The Amazon EC2 core and task node instance type.
//
// This member is required.
SlaveInstanceType *string
// The name of an Amazon EC2 key pair that can be used to connect to the master
// node using SSH.
Ec2KeyName *string
// For clusters launched within Amazon Virtual Private Cloud, this is the
// identifier of the subnet where the cluster was launched.
Ec2SubnetId *string
// The Hadoop version for the cluster.
HadoopVersion *string
// Details about the instance groups in a cluster.
InstanceGroups []InstanceGroupDetail
// Specifies whether the cluster should remain available after completing all
// steps.
KeepJobFlowAliveWhenNoSteps bool
// The Amazon EC2 instance identifier of the master node.
MasterInstanceId *string
// The DNS name of the master node. If the cluster is on a private subnet, this is
// the private DNS name. On a public subnet, this is the public DNS name.
MasterPublicDnsName *string
// An approximation of the cost of the cluster, represented in m1.small/hours.
// This value is increased one time for every hour that an m1.small instance runs.
// Larger instances are weighted more heavily, so an Amazon EC2 instance that is
// roughly four times more expensive would result in the normalized instance hours
// being increased incrementally four times. This result is only an approximation
// and does not reflect the actual billing rate.
NormalizedInstanceHours *int32
// The Amazon EC2 Availability Zone for the cluster.
Placement *PlacementType
// Specifies whether the Amazon EC2 instances in the cluster are protected from
// termination by API calls, user intervention, or in the event of a job-flow
// error.
TerminationProtected bool
noSmithyDocumentSerde
}
// Attributes for Kerberos configuration when Kerberos authentication is enabled
// using a security configuration. For more information see Use Kerberos
// Authentication (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-kerberos.html)
// in the Amazon EMR Management Guide.
type KerberosAttributes struct {
// The password used within the cluster for the kadmin service on the
// cluster-dedicated KDC, which maintains Kerberos principals, password policies,
// and keytabs for the cluster.
//
// This member is required.
KdcAdminPassword *string
// The name of the Kerberos realm to which all nodes in a cluster belong. For
// example, EC2.INTERNAL .
//
// This member is required.
Realm *string
// The Active Directory password for ADDomainJoinUser .
ADDomainJoinPassword *string
// Required only when establishing a cross-realm trust with an Active Directory
// domain. A user with sufficient privileges to join resources to the domain.
ADDomainJoinUser *string
// Required only when establishing a cross-realm trust with a KDC in a different
// realm. The cross-realm principal password, which must be identical across
// realms.
CrossRealmTrustPrincipalPassword *string
noSmithyDocumentSerde
}
// A key-value pair.
type KeyValue struct {
// The unique identifier of a key-value pair.
Key *string
// The value part of the identified key.
Value *string
noSmithyDocumentSerde
}
// Managed scaling policy for an Amazon EMR cluster. The policy specifies the
// limits for resources that can be added or terminated from a cluster. The policy
// only applies to the core and task nodes. The master node cannot be scaled after
// initial configuration.
type ManagedScalingPolicy struct {
// The Amazon EC2 unit limits for a managed scaling policy. The managed scaling
// activity of a cluster is not allowed to go above or below these limits. The
// limit only applies to the core and task nodes. The master node cannot be scaled
// after initial configuration.
ComputeLimits *ComputeLimits
noSmithyDocumentSerde
}
// A CloudWatch dimension, which is specified using a Key (known as a Name in
// CloudWatch), Value pair. By default, Amazon EMR uses one dimension whose Key is
// JobFlowID and Value is a variable representing the cluster ID, which is
// ${emr.clusterId} . This enables the rule to bootstrap when the cluster ID
// becomes available.
type MetricDimension struct {
// The dimension name.
Key *string
// The dimension value.
Value *string
noSmithyDocumentSerde
}
// A notebook execution. An execution is a specific instance that an Amazon EMR
// Notebook is run using the StartNotebookExecution action.
type NotebookExecution struct {
// The Amazon Resource Name (ARN) of the notebook execution.
Arn *string
// The unique identifier of the Amazon EMR Notebook that is used for the notebook
// execution.
EditorId *string
// The timestamp when notebook execution ended.
EndTime *time.Time
// The environment variables associated with the notebook execution.
EnvironmentVariables map[string]string
// The execution engine, such as an Amazon EMR cluster, used to run the Amazon EMR
// notebook and perform the notebook execution.
ExecutionEngine *ExecutionEngineConfig
// The reason for the latest status change of the notebook execution.
LastStateChangeReason *string
// The unique identifier of a notebook execution.
NotebookExecutionId *string
// A name for the notebook execution.
NotebookExecutionName *string
// The unique identifier of the Amazon EC2 security group associated with the
// Amazon EMR Notebook instance. For more information see Specifying Amazon EC2
// Security Groups for Amazon EMR Notebooks (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-notebooks-security-groups.html)
// in the Amazon EMR Management Guide.
NotebookInstanceSecurityGroupId *string
// Input parameters in JSON format passed to the Amazon EMR Notebook at runtime
// for execution.
NotebookParams *string
// The Amazon S3 location that stores the notebook execution input.
NotebookS3Location *NotebookS3LocationForOutput
// The output format for the notebook execution.
OutputNotebookFormat OutputNotebookFormat
// The Amazon S3 location for the notebook execution output.
OutputNotebookS3Location *OutputNotebookS3LocationForOutput
// The location of the notebook execution's output file in Amazon S3.
OutputNotebookURI *string
// The timestamp when notebook execution started.
StartTime *time.Time
// The status of the notebook execution.
// - START_PENDING indicates that the cluster has received the execution request
// but execution has not begun.
// - STARTING indicates that the execution is starting on the cluster.
// - RUNNING indicates that the execution is being processed by the cluster.
// - FINISHING indicates that execution processing is in the final stages.
// - FINISHED indicates that the execution has completed without error.
// - FAILING indicates that the execution is failing and will not finish
// successfully.
// - FAILED indicates that the execution failed.
// - STOP_PENDING indicates that the cluster has received a StopNotebookExecution
// request and the stop is pending.
// - STOPPING indicates that the cluster is in the process of stopping the
// execution as a result of a StopNotebookExecution request.
// - STOPPED indicates that the execution stopped because of a
// StopNotebookExecution request.
Status NotebookExecutionStatus
// A list of tags associated with a notebook execution. Tags are user-defined
// key-value pairs that consist of a required key string with a maximum of 128
// characters and an optional value string with a maximum of 256 characters.
Tags []Tag
noSmithyDocumentSerde
}
// Details for a notebook execution. The details include information such as the
// unique ID and status of the notebook execution.
type NotebookExecutionSummary struct {
// The unique identifier of the editor associated with the notebook execution.
EditorId *string
// The timestamp when notebook execution started.
EndTime *time.Time
// The unique ID of the execution engine for the notebook execution.
ExecutionEngineId *string
// The unique identifier of the notebook execution.
NotebookExecutionId *string
// The name of the notebook execution.
NotebookExecutionName *string
// The Amazon S3 location that stores the notebook execution input.
NotebookS3Location *NotebookS3LocationForOutput
// The timestamp when notebook execution started.
StartTime *time.Time
// The status of the notebook execution.
// - START_PENDING indicates that the cluster has received the execution request
// but execution has not begun.
// - STARTING indicates that the execution is starting on the cluster.
// - RUNNING indicates that the execution is being processed by the cluster.
// - FINISHING indicates that execution processing is in the final stages.
// - FINISHED indicates that the execution has completed without error.
// - FAILING indicates that the execution is failing and will not finish
// successfully.
// - FAILED indicates that the execution failed.
// - STOP_PENDING indicates that the cluster has received a StopNotebookExecution
// request and the stop is pending.
// - STOPPING indicates that the cluster is in the process of stopping the
// execution as a result of a StopNotebookExecution request.
// - STOPPED indicates that the execution stopped because of a
// StopNotebookExecution request.
Status NotebookExecutionStatus
noSmithyDocumentSerde
}
// The Amazon S3 location that stores the notebook execution input.
type NotebookS3LocationForOutput struct {
// The Amazon S3 bucket that stores the notebook execution input.
Bucket *string
// The key to the Amazon S3 location that stores the notebook execution input.
Key *string
noSmithyDocumentSerde
}
// The Amazon S3 location that stores the notebook execution input.
type NotebookS3LocationFromInput struct {
// The Amazon S3 bucket that stores the notebook execution input.
Bucket *string
// The key to the Amazon S3 location that stores the notebook execution input.
Key *string
noSmithyDocumentSerde
}
// Describes the strategy for using unused Capacity Reservations for fulfilling
// On-Demand capacity.
type OnDemandCapacityReservationOptions struct {
// Indicates the instance's Capacity Reservation preferences. Possible preferences
// include:
// - open - The instance can run in any open Capacity Reservation that has
// matching attributes (instance type, platform, Availability Zone).
// - none - The instance avoids running in a Capacity Reservation even if one is
// available. The instance runs as an On-Demand Instance.
CapacityReservationPreference OnDemandCapacityReservationPreference
// The ARN of the Capacity Reservation resource group in which to run the instance.
CapacityReservationResourceGroupArn *string
// Indicates whether to use unused Capacity Reservations for fulfilling On-Demand
// capacity. If you specify use-capacity-reservations-first , the fleet uses unused
// Capacity Reservations to fulfill On-Demand capacity up to the target On-Demand
// capacity. If multiple instance pools have unused Capacity Reservations, the
// On-Demand allocation strategy ( lowest-price ) is applied. If the number of
// unused Capacity Reservations is less than the On-Demand target capacity, the
// remaining On-Demand target capacity is launched according to the On-Demand
// allocation strategy ( lowest-price ). If you do not specify a value, the fleet
// fulfills the On-Demand capacity according to the chosen On-Demand allocation
// strategy.
UsageStrategy OnDemandCapacityReservationUsageStrategy
noSmithyDocumentSerde
}
// The launch specification for On-Demand Instances in the instance fleet, which
// determines the allocation strategy. The instance fleet configuration is
// available only in Amazon EMR releases 4.8.0 and later, excluding 5.0.x versions.
// On-Demand Instances allocation strategy is available in Amazon EMR releases
// 5.12.1 and later.
type OnDemandProvisioningSpecification struct {
// Specifies the strategy to use in launching On-Demand instance fleets.
// Currently, the only option is lowest-price (the default), which launches the
// lowest price first.
//
// This member is required.
AllocationStrategy OnDemandProvisioningAllocationStrategy
// The launch specification for On-Demand instances in the instance fleet, which
// determines the allocation strategy.
CapacityReservationOptions *OnDemandCapacityReservationOptions
noSmithyDocumentSerde
}
// The resize specification for On-Demand Instances in the instance fleet, which
// contains the resize timeout period.
type OnDemandResizingSpecification struct {
// On-Demand resize timeout in minutes. If On-Demand Instances are not provisioned
// within this time, the resize workflow stops. The minimum value is 5 minutes, and
// the maximum value is 10,080 minutes (7 days). The timeout applies to all resize
// workflows on the Instance Fleet. The resize could be triggered by Amazon EMR
// Managed Scaling or by the customer (via Amazon EMR Console, Amazon EMR CLI
// modify-instance-fleet or Amazon EMR SDK ModifyInstanceFleet API) or by Amazon
// EMR due to Amazon EC2 Spot Reclamation.
//
// This member is required.
TimeoutDurationMinutes *int32
noSmithyDocumentSerde
}
// The Amazon Linux release specified for a cluster in the RunJobFlow request.
type OSRelease struct {
// The Amazon Linux release specified for a cluster in the RunJobFlow request. The
// format is as shown in Amazon Linux 2 Release Notes (https://docs.aws.amazon.com/AL2/latest/relnotes/relnotes-20220218.html)
// . For example, 2.0.20220218.1.
Label *string
noSmithyDocumentSerde
}
// The Amazon S3 location that stores the notebook execution output.
type OutputNotebookS3LocationForOutput struct {
// The Amazon S3 bucket that stores the notebook execution output.
Bucket *string
// The key to the Amazon S3 location that stores the notebook execution output.
Key *string
noSmithyDocumentSerde
}
// The Amazon S3 location that stores the notebook execution output.
type OutputNotebookS3LocationFromInput struct {
// The Amazon S3 bucket that stores the notebook execution output.
Bucket *string
// The key to the Amazon S3 location that stores the notebook execution output.
Key *string
noSmithyDocumentSerde
}
// Placement group configuration for an Amazon EMR cluster. The configuration
// specifies the placement strategy that can be applied to instance roles during
// cluster creation. To use this configuration, consider attaching managed policy
// AmazonElasticMapReducePlacementGroupPolicy to the Amazon EMR role.
type PlacementGroupConfig struct {
// Role of the instance in the cluster. Starting with Amazon EMR release 5.23.0,
// the only supported instance role is MASTER .
//
// This member is required.
InstanceRole InstanceRoleType
// Amazon EC2 Placement Group strategy associated with instance role. Starting
// with Amazon EMR release 5.23.0, the only supported placement strategy is SPREAD
// for the MASTER instance role.
PlacementStrategy PlacementGroupStrategy
noSmithyDocumentSerde
}
// The Amazon EC2 Availability Zone configuration of the cluster (job flow).
type PlacementType struct {
// The Amazon EC2 Availability Zone for the cluster. AvailabilityZone is used for
// uniform instance groups, while AvailabilityZones (plural) is used for instance
// fleets.
AvailabilityZone *string
// When multiple Availability Zones are specified, Amazon EMR evaluates them and
// launches instances in the optimal Availability Zone. AvailabilityZones is used
// for instance fleets, while AvailabilityZone (singular) is used for uniform
// instance groups. The instance fleet configuration is available only in Amazon
// EMR releases 4.8.0 and later, excluding 5.0.x versions.
AvailabilityZones []string
noSmithyDocumentSerde
}
// A list of port ranges that are permitted to allow inbound traffic from all
// public IP addresses. To specify a single port, use the same value for MinRange
// and MaxRange .
type PortRange struct {
// The smallest port number in a specified range of port numbers.
//
// This member is required.
MinRange *int32
// The smallest port number in a specified range of port numbers.
MaxRange *int32
noSmithyDocumentSerde
}
// The release label filters by application or version prefix.
type ReleaseLabelFilter struct {
// Optional release label application filter. For example, spark@2.1.0 .
Application *string
// Optional release label version prefix filter. For example, emr-5 .
Prefix *string
noSmithyDocumentSerde
}
// The type of adjustment the automatic scaling activity makes when triggered, and
// the periodicity of the adjustment.
type ScalingAction struct {
// The type of adjustment the automatic scaling activity makes when triggered, and
// the periodicity of the adjustment.
//
// This member is required.
SimpleScalingPolicyConfiguration *SimpleScalingPolicyConfiguration
// Not available for instance groups. Instance groups use the market type
// specified for the group.
Market MarketType
noSmithyDocumentSerde
}
// The upper and lower Amazon EC2 instance limits for an automatic scaling policy.
// Automatic scaling activities triggered by automatic scaling rules will not cause
// an instance group to grow above or below these limits.
type ScalingConstraints struct {
// The upper boundary of Amazon EC2 instances in an instance group beyond which
// scaling activities are not allowed to grow. Scale-out activities will not add
// instances beyond this boundary.
//
// This member is required.
MaxCapacity *int32
// The lower boundary of Amazon EC2 instances in an instance group below which
// scaling activities are not allowed to shrink. Scale-in activities will not
// terminate instances below this boundary.
//
// This member is required.
MinCapacity *int32
noSmithyDocumentSerde
}
// A scale-in or scale-out rule that defines scaling activity, including the
// CloudWatch metric alarm that triggers activity, how Amazon EC2 instances are
// added or removed, and the periodicity of adjustments. The automatic scaling
// policy for an instance group can comprise one or more automatic scaling rules.
type ScalingRule struct {
// The conditions that trigger an automatic scaling activity.
//
// This member is required.
Action *ScalingAction
// The name used to identify an automatic scaling rule. Rule names must be unique
// within a scaling policy.
//
// This member is required.
Name *string
// The CloudWatch alarm definition that determines when automatic scaling activity
// is triggered.
//
// This member is required.
Trigger *ScalingTrigger
// A friendly, more verbose description of the automatic scaling rule.
Description *string
noSmithyDocumentSerde
}
// The conditions that trigger an automatic scaling activity.
type ScalingTrigger struct {
// The definition of a CloudWatch metric alarm. When the defined alarm conditions
// are met along with other trigger parameters, scaling activity begins.
//
// This member is required.
CloudWatchAlarmDefinition *CloudWatchAlarmDefinition
noSmithyDocumentSerde
}
// Configuration of the script to run during a bootstrap action.
type ScriptBootstrapActionConfig struct {
// Location in Amazon S3 of the script to run during a bootstrap action.
//
// This member is required.
Path *string
// A list of command line arguments to pass to the bootstrap action script.
Args []string
noSmithyDocumentSerde
}
// The creation date and time, and name, of a security configuration.
type SecurityConfigurationSummary struct {
// The date and time the security configuration was created.
CreationDateTime *time.Time
// The name of the security configuration.
Name *string
noSmithyDocumentSerde
}
// Details for an Amazon EMR Studio session mapping including creation time, user
// or group ID, Studio ID, and so on.
type SessionMappingDetail struct {
// The time the session mapping was created.
CreationTime *time.Time
// The globally unique identifier (GUID) of the user or group.
IdentityId *string
// The name of the user or group. For more information, see UserName (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserName)
// and DisplayName (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-DisplayName)
// in the IAM Identity Center Identity Store API Reference.
IdentityName *string
// Specifies whether the identity mapped to the Amazon EMR Studio is a user or a
// group.
IdentityType IdentityType
// The time the session mapping was last modified.
LastModifiedTime *time.Time
// The Amazon Resource Name (ARN) of the session policy associated with the user
// or group.
SessionPolicyArn *string
// The ID of the Amazon EMR Studio.
StudioId *string
noSmithyDocumentSerde
}
// Details for an Amazon EMR Studio session mapping. The details do not include
// the time the session mapping was last modified.
type SessionMappingSummary struct {
// The time the session mapping was created.
CreationTime *time.Time
// The globally unique identifier (GUID) of the user or group from the IAM
// Identity Center Identity Store.
IdentityId *string
// The name of the user or group. For more information, see UserName (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html#singlesignon-Type-User-UserName)
// and DisplayName (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_Group.html#singlesignon-Type-Group-DisplayName)
// in the IAM Identity Center Identity Store API Reference.
IdentityName *string
// Specifies whether the identity mapped to the Amazon EMR Studio is a user or a
// group.
IdentityType IdentityType
// The Amazon Resource Name (ARN) of the session policy associated with the user
// or group.
SessionPolicyArn *string
// The ID of the Amazon EMR Studio.
StudioId *string
noSmithyDocumentSerde
}
// Policy for customizing shrink operations. Allows configuration of
// decommissioning timeout and targeted instance shrinking.
type ShrinkPolicy struct {
// The desired timeout for decommissioning an instance. Overrides the default YARN
// decommissioning timeout.
DecommissionTimeout *int32
// Custom policy for requesting termination protection or termination of specific
// instances when shrinking an instance group.
InstanceResizePolicy *InstanceResizePolicy
noSmithyDocumentSerde
}
// An automatic scaling configuration, which describes how the policy adds or
// removes instances, the cooldown period, and the number of Amazon EC2 instances
// that will be added each time the CloudWatch metric alarm condition is satisfied.
type SimpleScalingPolicyConfiguration struct {
// The amount by which to scale in or scale out, based on the specified
// AdjustmentType . A positive value adds to the instance group's Amazon EC2
// instance count while a negative number removes instances. If AdjustmentType is
// set to EXACT_CAPACITY , the number should only be a positive integer. If
// AdjustmentType is set to PERCENT_CHANGE_IN_CAPACITY , the value should express
// the percentage as an integer. For example, -20 indicates a decrease in 20%
// increments of cluster capacity.
//
// This member is required.
ScalingAdjustment *int32
// The way in which Amazon EC2 instances are added (if ScalingAdjustment is a
// positive number) or terminated (if ScalingAdjustment is a negative number) each
// time the scaling activity is triggered. CHANGE_IN_CAPACITY is the default.
// CHANGE_IN_CAPACITY indicates that the Amazon EC2 instance count increments or
// decrements by ScalingAdjustment , which should be expressed as an integer.
// PERCENT_CHANGE_IN_CAPACITY indicates the instance count increments or decrements
// by the percentage specified by ScalingAdjustment , which should be expressed as
// an integer. For example, 20 indicates an increase in 20% increments of cluster
// capacity. EXACT_CAPACITY indicates the scaling activity results in an instance
// group with the number of Amazon EC2 instances specified by ScalingAdjustment ,
// which should be expressed as a positive integer.
AdjustmentType AdjustmentType
// The amount of time, in seconds, after a scaling activity completes before any
// further trigger-related scaling activities can start. The default value is 0.
CoolDown *int32
noSmithyDocumentSerde
}
// The returned release label application names or versions.
type SimplifiedApplication struct {
// The returned release label application name. For example, hadoop .
Name *string
// The returned release label application version. For example, 3.2.1 .
Version *string
noSmithyDocumentSerde
}
// The launch specification for Spot Instances in the instance fleet, which
// determines the defined duration, provisioning timeout behavior, and allocation
// strategy. The instance fleet configuration is available only in Amazon EMR
// releases 4.8.0 and later, excluding 5.0.x versions. Spot Instance allocation
// strategy is available in Amazon EMR releases 5.12.1 and later. Spot Instances
// with a defined duration (also known as Spot blocks) are no longer available to
// new customers from July 1, 2021. For customers who have previously used the
// feature, we will continue to support Spot Instances with a defined duration
// until December 31, 2022.
type SpotProvisioningSpecification struct {
// The action to take when TargetSpotCapacity has not been fulfilled when the
// TimeoutDurationMinutes has expired; that is, when all Spot Instances could not
// be provisioned within the Spot provisioning timeout. Valid values are
// TERMINATE_CLUSTER and SWITCH_TO_ON_DEMAND . SWITCH_TO_ON_DEMAND specifies that
// if no Spot Instances are available, On-Demand Instances should be provisioned to
// fulfill any remaining Spot capacity.
//
// This member is required.
TimeoutAction SpotProvisioningTimeoutAction
// The Spot provisioning timeout period in minutes. If Spot Instances are not
// provisioned within this time period, the TimeOutAction is taken. Minimum value
// is 5 and maximum value is 1440. The timeout applies only during initial
// provisioning, when the cluster is first created.
//
// This member is required.
TimeoutDurationMinutes *int32
// Specifies the strategy to use in launching Spot Instance fleets. Currently, the
// only option is capacity-optimized (the default), which launches instances from
// Spot Instance pools with optimal capacity for the number of instances that are
// launching.
AllocationStrategy SpotProvisioningAllocationStrategy
// The defined duration for Spot Instances (also known as Spot blocks) in minutes.
// When specified, the Spot Instance does not terminate before the defined duration
// expires, and defined duration pricing for Spot Instances applies. Valid values
// are 60, 120, 180, 240, 300, or 360. The duration period starts as soon as a Spot
// Instance receives its instance ID. At the end of the duration, Amazon EC2 marks
// the Spot Instance for termination and provides a Spot Instance termination
// notice, which gives the instance a two-minute warning before it terminates. Spot
// Instances with a defined duration (also known as Spot blocks) are no longer
// available to new customers from July 1, 2021. For customers who have previously
// used the feature, we will continue to support Spot Instances with a defined
// duration until December 31, 2022.
BlockDurationMinutes *int32
noSmithyDocumentSerde
}
// The resize specification for Spot Instances in the instance fleet, which
// contains the resize timeout period.
type SpotResizingSpecification struct {
// Spot resize timeout in minutes. If Spot Instances are not provisioned within
// this time, the resize workflow will stop provisioning of Spot instances. Minimum
// value is 5 minutes and maximum value is 10,080 minutes (7 days). The timeout
// applies to all resize workflows on the Instance Fleet. The resize could be
// triggered by Amazon EMR Managed Scaling or by the customer (via Amazon EMR
// Console, Amazon EMR CLI modify-instance-fleet or Amazon EMR SDK
// ModifyInstanceFleet API) or by Amazon EMR due to Amazon EC2 Spot Reclamation.
//
// This member is required.
TimeoutDurationMinutes *int32
noSmithyDocumentSerde
}
// This represents a step in a cluster.
type Step struct {
// The action to take when the cluster step fails. Possible values are
// TERMINATE_CLUSTER , CANCEL_AND_WAIT , and CONTINUE . TERMINATE_JOB_FLOW is
// provided for backward compatibility. We recommend using TERMINATE_CLUSTER
// instead. If a cluster's StepConcurrencyLevel is greater than 1 , do not use
// AddJobFlowSteps to submit a step with this parameter set to CANCEL_AND_WAIT or
// TERMINATE_CLUSTER . The step is not submitted and the action fails with a
// message that the ActionOnFailure setting is not valid. If you change a
// cluster's StepConcurrencyLevel to be greater than 1 while a step is running,
// the ActionOnFailure parameter may not behave as you expect. In this case, for a
// step that fails with this parameter set to CANCEL_AND_WAIT , pending steps and
// the running step are not canceled; for a step that fails with this parameter set
// to TERMINATE_CLUSTER , the cluster does not terminate.
ActionOnFailure ActionOnFailure
// The Hadoop job configuration of the cluster step.
Config *HadoopStepConfig
// The Amazon Resource Name (ARN) of the runtime role for a step on the cluster.
// The runtime role can be a cross-account IAM role. The runtime role ARN is a
// combination of account ID, role name, and role type using the following format:
// arn:partition:service:region:account:resource . For example,
// arn:aws:IAM::1234567890:role/ReadOnly is a correctly formatted runtime role ARN.
ExecutionRoleArn *string
// The identifier of the cluster step.
Id *string
// The name of the cluster step.
Name *string
// The current execution status details of the cluster step.
Status *StepStatus
noSmithyDocumentSerde
}
// Specification for a cluster (job flow) step.
type StepConfig struct {
// The JAR file used for the step.
//
// This member is required.
HadoopJarStep *HadoopJarStepConfig
// The name of the step.
//
// This member is required.
Name *string
// The action to take when the step fails. Use one of the following values:
// - TERMINATE_CLUSTER - Shuts down the cluster.
// - CANCEL_AND_WAIT - Cancels any pending steps and returns the cluster to the
// WAITING state.
// - CONTINUE - Continues to the next step in the queue.
// - TERMINATE_JOB_FLOW - Shuts down the cluster. TERMINATE_JOB_FLOW is provided
// for backward compatibility. We recommend using TERMINATE_CLUSTER instead.
// If a cluster's StepConcurrencyLevel is greater than 1 , do not use
// AddJobFlowSteps to submit a step with this parameter set to CANCEL_AND_WAIT or
// TERMINATE_CLUSTER . The step is not submitted and the action fails with a
// message that the ActionOnFailure setting is not valid. If you change a
// cluster's StepConcurrencyLevel to be greater than 1 while a step is running,
// the ActionOnFailure parameter may not behave as you expect. In this case, for a
// step that fails with this parameter set to CANCEL_AND_WAIT , pending steps and
// the running step are not canceled; for a step that fails with this parameter set
// to TERMINATE_CLUSTER , the cluster does not terminate.
ActionOnFailure ActionOnFailure
noSmithyDocumentSerde
}
// Combines the execution state and configuration of a step.
type StepDetail struct {
// The description of the step status.
//
// This member is required.
ExecutionStatusDetail *StepExecutionStatusDetail
// The step configuration.
//
// This member is required.
StepConfig *StepConfig
noSmithyDocumentSerde
}
// The execution state of a step.
type StepExecutionStatusDetail struct {
// The creation date and time of the step.
//
// This member is required.
CreationDateTime *time.Time
// The state of the step.
//
// This member is required.
State StepExecutionState
// The completion date and time of the step.
EndDateTime *time.Time
// A description of the step's current state.
LastStateChangeReason *string
// The start date and time of the step.
StartDateTime *time.Time
noSmithyDocumentSerde
}
// The details of the step state change reason.
type StepStateChangeReason struct {
// The programmable code for the state change reason. Note: Currently, the service
// provides no code for the state change.
Code StepStateChangeReasonCode
// The descriptive message for the state change reason.
Message *string
noSmithyDocumentSerde
}
// The execution status details of the cluster step.
type StepStatus struct {
// The details for the step failure including reason, message, and log file path
// where the root cause was identified.
FailureDetails *FailureDetails
// The execution state of the cluster step.
State StepState
// The reason for the step execution status change.
StateChangeReason *StepStateChangeReason
// The timeline of the cluster step status over time.
Timeline *StepTimeline
noSmithyDocumentSerde
}
// The summary of the cluster step.
type StepSummary struct {
// The action to take when the cluster step fails. Possible values are
// TERMINATE_CLUSTER, CANCEL_AND_WAIT, and CONTINUE. TERMINATE_JOB_FLOW is
// available for backward compatibility.
ActionOnFailure ActionOnFailure
// The Hadoop job configuration of the cluster step.
Config *HadoopStepConfig
// The identifier of the cluster step.
Id *string
// The name of the cluster step.
Name *string
// The current execution status details of the cluster step.
Status *StepStatus
noSmithyDocumentSerde
}
// The timeline of the cluster step lifecycle.
type StepTimeline struct {
// The date and time when the cluster step was created.
CreationDateTime *time.Time
// The date and time when the cluster step execution completed or failed.
EndDateTime *time.Time
// The date and time when the cluster step execution started.
StartDateTime *time.Time
noSmithyDocumentSerde
}
// Details for an Amazon EMR Studio including ID, creation time, name, and so on.
type Studio struct {
// Specifies whether the Amazon EMR Studio authenticates users with IAM or IAM
// Identity Center.
AuthMode AuthMode
// The time the Amazon EMR Studio was created.
CreationTime *time.Time
// The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook
// files.
DefaultS3Location *string
// The detailed description of the Amazon EMR Studio.
Description *string
// The ID of the Engine security group associated with the Amazon EMR Studio. The
// Engine security group allows inbound network traffic from resources in the
// Workspace security group.
EngineSecurityGroupId *string
// Your identity provider's authentication endpoint. Amazon EMR Studio redirects
// federated users to this endpoint for authentication when logging in to a Studio
// with the Studio URL.
IdpAuthUrl *string
// The name of your identity provider's RelayState parameter.
IdpRelayStateParameterName *string
// The name of the Amazon EMR Studio.
Name *string
// The name of the IAM role assumed by the Amazon EMR Studio.
ServiceRole *string
// The Amazon Resource Name (ARN) of the Amazon EMR Studio.
StudioArn *string
// The ID of the Amazon EMR Studio.
StudioId *string
// The list of IDs of the subnets associated with the Amazon EMR Studio.
SubnetIds []string
// A list of tags associated with the Amazon EMR Studio.
Tags []Tag
// The unique access URL of the Amazon EMR Studio.
Url *string
// The name of the IAM role assumed by users logged in to the Amazon EMR Studio. A
// Studio only requires a UserRole when you use IAM authentication.
UserRole *string
// The ID of the VPC associated with the Amazon EMR Studio.
VpcId *string
// The ID of the Workspace security group associated with the Amazon EMR Studio.
// The Workspace security group allows outbound network traffic to resources in the
// Engine security group and to the internet.
WorkspaceSecurityGroupId *string
noSmithyDocumentSerde
}
// Details for an Amazon EMR Studio, including ID, Name, VPC, and Description. The
// details do not include subnets, IAM roles, security groups, or tags associated
// with the Studio.
type StudioSummary struct {
// Specifies whether the Studio authenticates users using IAM or IAM Identity
// Center.
AuthMode AuthMode
// The time when the Amazon EMR Studio was created.
CreationTime *time.Time
// The detailed description of the Amazon EMR Studio.
Description *string
// The name of the Amazon EMR Studio.
Name *string
// The ID of the Amazon EMR Studio.
StudioId *string
// The unique access URL of the Amazon EMR Studio.
Url *string
// The ID of the Virtual Private Cloud (Amazon VPC) associated with the Amazon EMR
// Studio.
VpcId *string
noSmithyDocumentSerde
}
// An instance type that the specified Amazon EMR release supports.
type SupportedInstanceType struct {
// The CPU architecture, for example X86_64 or AARCH64 .
Architecture *string
// Indicates whether the SupportedInstanceType supports Amazon EBS optimization.
EbsOptimizedAvailable bool
// Indicates whether the SupportedInstanceType uses Amazon EBS optimization by
// default.
EbsOptimizedByDefault bool
// Indicates whether the SupportedInstanceType only supports Amazon EBS.
EbsStorageOnly bool
// The Amazon EC2 family and generation for the SupportedInstanceType .
InstanceFamilyId *string
// Indicates whether the SupportedInstanceType only supports 64-bit architecture.
Is64BitsOnly bool
// The amount of memory that is available to Amazon EMR from the
// SupportedInstanceType . The kernel and hypervisor software consume some memory,
// so this value might be lower than the overall memory for the instance type.
MemoryGB float32
// Number of disks for the SupportedInstanceType . This value is 0 for Amazon
// EBS-only instance types.
NumberOfDisks *int32
// StorageGB represents the storage capacity of the SupportedInstanceType . This
// value is 0 for Amazon EBS-only instance types.
StorageGB *int32
// The Amazon EC2 instance type (http://aws.amazon.com/ec2/instance-types/) , for
// example m5.xlarge , of the SupportedInstanceType .
Type *string
// The number of vCPUs available for the SupportedInstanceType .
VCPU *int32
noSmithyDocumentSerde
}
// The list of supported product configurations that allow user-supplied
// arguments. Amazon EMR accepts these arguments and forwards them to the
// corresponding installation script as bootstrap action arguments.
type SupportedProductConfig struct {
// The list of user-supplied arguments.
Args []string
// The name of the product configuration.
Name *string
noSmithyDocumentSerde
}
// A key-value pair containing user-defined metadata that you can associate with
// an Amazon EMR resource. Tags make it easier to associate clusters in various
// ways, such as grouping clusters to track your Amazon EMR resource allocation
// costs. For more information, see Tag Clusters (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags.html)
// .
type Tag struct {
// A user-defined key, which is the minimum required information for a valid tag.
// For more information, see Tag (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags.html)
// .
Key *string
// A user-defined value, which is optional in a tag. For more information, see Tag
// Clusters (https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-tags.html)
// .
Value *string
noSmithyDocumentSerde
}
// The username and password that you use to connect to cluster endpoints.
type UsernamePassword struct {
// The password associated with the temporary credentials that you use to connect
// to cluster endpoints.
Password *string
// The username associated with the temporary credentials that you use to connect
// to cluster endpoints.
Username *string
noSmithyDocumentSerde
}
// EBS volume specifications such as volume type, IOPS, size (GiB) and throughput
// (MiB/s) that are requested for the EBS volume attached to an Amazon EC2 instance
// in the cluster.
type VolumeSpecification struct {
// The volume size, in gibibytes (GiB). This can be a number from 1 - 1024. If the
// volume type is EBS-optimized, the minimum value is 10.
//
// This member is required.
SizeInGB *int32
// The volume type. Volume types supported are gp3, gp2, io1, st1, sc1, and
// standard.
//
// This member is required.
VolumeType *string
// The number of I/O operations per second (IOPS) that the volume supports.
Iops *int32
// The throughput, in mebibyte per second (MiB/s). This optional parameter can be
// a number from 125 - 1000 and is valid only for gp3 volumes.
Throughput *int32
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) isCredentials() {}
| 2,929 |
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/emr/types"
)
func ExampleCredentials_outputUsage() {
var union types.Credentials
// type switches can be used to check the union value
switch v := union.(type) {
case *types.CredentialsMemberUsernamePassword:
_ = v.Value // Value is types.UsernamePassword
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.UsernamePassword
| 27 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
import (
"context"
cryptorand "crypto/rand"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyrand "github.com/aws/smithy-go/rand"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "EMR containers"
const ServiceAPIVersion = "2020-10-01"
// Client provides the API client to make operations call for Amazon EMR
// Containers.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
resolveIdempotencyTokenProvider(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// Provides idempotency tokens values that will be automatically populated into
// idempotent API operations.
IdempotencyTokenProvider IdempotencyTokenProvider
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "emrcontainers", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func resolveIdempotencyTokenProvider(o *Options) {
if o.IdempotencyTokenProvider != nil {
return
}
o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
// IdempotencyTokenProvider interface for providing idempotency token
type IdempotencyTokenProvider interface {
GetIdempotencyToken() (string, error)
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 455 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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 emrcontainers
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"
)
// Cancels a job run. A job run is a unit of work, such as a Spark jar, PySpark
// script, or SparkSQL query, that you submit to Amazon EMR on EKS.
func (c *Client) CancelJobRun(ctx context.Context, params *CancelJobRunInput, optFns ...func(*Options)) (*CancelJobRunOutput, error) {
if params == nil {
params = &CancelJobRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CancelJobRun", params, optFns, c.addOperationCancelJobRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CancelJobRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type CancelJobRunInput struct {
// The ID of the job run to cancel.
//
// This member is required.
Id *string
// The ID of the virtual cluster for which the job run will be canceled.
//
// This member is required.
VirtualClusterId *string
noSmithyDocumentSerde
}
type CancelJobRunOutput struct {
// The output contains the ID of the cancelled job run.
Id *string
// The output contains the virtual cluster ID for which the job run is cancelled.
VirtualClusterId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCancelJobRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelJobRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelJobRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCancelJobRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelJobRun(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCancelJobRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "CancelJobRun",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a job template. Job template stores values of StartJobRun API request
// in a template and can be used to start a job run. Job template allows two use
// cases: avoid repeating recurring StartJobRun API request values, enforcing
// certain values in StartJobRun API request.
func (c *Client) CreateJobTemplate(ctx context.Context, params *CreateJobTemplateInput, optFns ...func(*Options)) (*CreateJobTemplateOutput, error) {
if params == nil {
params = &CreateJobTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateJobTemplate", params, optFns, c.addOperationCreateJobTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateJobTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateJobTemplateInput struct {
// The client token of the job template.
//
// This member is required.
ClientToken *string
// The job template data which holds values of StartJobRun API request.
//
// This member is required.
JobTemplateData *types.JobTemplateData
// The specified name of the job template.
//
// This member is required.
Name *string
// The KMS key ARN used to encrypt the job template.
KmsKeyArn *string
// The tags that are associated with the job template.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateJobTemplateOutput struct {
// This output display the ARN of the created job template.
Arn *string
// This output displays the date and time when the job template was created.
CreatedAt *time.Time
// This output display the created job template ID.
Id *string
// This output displays the name of the created job template.
Name *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateJobTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateJobTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateJobTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateJobTemplateMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateJobTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateJobTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateJobTemplate struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateJobTemplate) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateJobTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateJobTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateJobTemplateInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateJobTemplateMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateJobTemplate{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateJobTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "CreateJobTemplate",
}
}
| 191 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a managed endpoint. A managed endpoint is a gateway that connects
// Amazon EMR Studio to Amazon EMR on EKS so that Amazon EMR Studio can communicate
// with your virtual cluster.
func (c *Client) CreateManagedEndpoint(ctx context.Context, params *CreateManagedEndpointInput, optFns ...func(*Options)) (*CreateManagedEndpointOutput, error) {
if params == nil {
params = &CreateManagedEndpointInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateManagedEndpoint", params, optFns, c.addOperationCreateManagedEndpointMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateManagedEndpointOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateManagedEndpointInput struct {
// The client idempotency token for this create call.
//
// This member is required.
ClientToken *string
// The ARN of the execution role.
//
// This member is required.
ExecutionRoleArn *string
// The name of the managed endpoint.
//
// This member is required.
Name *string
// The Amazon EMR release version.
//
// This member is required.
ReleaseLabel *string
// The type of the managed endpoint.
//
// This member is required.
Type *string
// The ID of the virtual cluster for which a managed endpoint is created.
//
// This member is required.
VirtualClusterId *string
// The certificate ARN provided by users for the managed endpoint. This field is
// under deprecation and will be removed in future releases.
//
// Deprecated: Customer provided certificate-arn is deprecated and would be
// removed in future.
CertificateArn *string
// The configuration settings that will be used to override existing
// configurations.
ConfigurationOverrides *types.ConfigurationOverrides
// The tags of the managed endpoint.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateManagedEndpointOutput struct {
// The output contains the ARN of the managed endpoint.
Arn *string
// The output contains the ID of the managed endpoint.
Id *string
// The output contains the name of the managed endpoint.
Name *string
// The output contains the ID of the virtual cluster.
VirtualClusterId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateManagedEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateManagedEndpoint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateManagedEndpoint{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateManagedEndpointMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateManagedEndpointValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateManagedEndpoint(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateManagedEndpoint struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateManagedEndpoint) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateManagedEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateManagedEndpointInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateManagedEndpointInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateManagedEndpointMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateManagedEndpoint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateManagedEndpoint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "CreateManagedEndpoint",
}
}
| 212 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a virtual cluster. Virtual cluster is a managed entity on Amazon EMR on
// EKS. You can create, describe, list and delete virtual clusters. They do not
// consume any additional resource in your system. A single virtual cluster maps to
// a single Kubernetes namespace. Given this relationship, you can model virtual
// clusters the same way you model Kubernetes namespaces to meet your requirements.
func (c *Client) CreateVirtualCluster(ctx context.Context, params *CreateVirtualClusterInput, optFns ...func(*Options)) (*CreateVirtualClusterOutput, error) {
if params == nil {
params = &CreateVirtualClusterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateVirtualCluster", params, optFns, c.addOperationCreateVirtualClusterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateVirtualClusterOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateVirtualClusterInput struct {
// The client token of the virtual cluster.
//
// This member is required.
ClientToken *string
// The container provider of the virtual cluster.
//
// This member is required.
ContainerProvider *types.ContainerProvider
// The specified name of the virtual cluster.
//
// This member is required.
Name *string
// The tags assigned to the virtual cluster.
Tags map[string]string
noSmithyDocumentSerde
}
type CreateVirtualClusterOutput struct {
// This output contains the ARN of virtual cluster.
Arn *string
// This output contains the virtual cluster ID.
Id *string
// This output contains the name of the virtual cluster.
Name *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateVirtualClusterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateVirtualCluster{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateVirtualCluster{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateVirtualClusterMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateVirtualClusterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVirtualCluster(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateVirtualCluster struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateVirtualCluster) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateVirtualCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateVirtualClusterInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateVirtualClusterInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateVirtualClusterMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateVirtualCluster{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateVirtualCluster(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "CreateVirtualCluster",
}
}
| 185 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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 job template. Job template stores values of StartJobRun API request
// in a template and can be used to start a job run. Job template allows two use
// cases: avoid repeating recurring StartJobRun API request values, enforcing
// certain values in StartJobRun API request.
func (c *Client) DeleteJobTemplate(ctx context.Context, params *DeleteJobTemplateInput, optFns ...func(*Options)) (*DeleteJobTemplateOutput, error) {
if params == nil {
params = &DeleteJobTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteJobTemplate", params, optFns, c.addOperationDeleteJobTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteJobTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteJobTemplateInput struct {
// The ID of the job template that will be deleted.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DeleteJobTemplateOutput struct {
// This output contains the ID of the job template that was deleted.
Id *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteJobTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteJobTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteJobTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteJobTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteJobTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteJobTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "DeleteJobTemplate",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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 managed endpoint. A managed endpoint is a gateway that connects
// Amazon EMR Studio to Amazon EMR on EKS so that Amazon EMR Studio can communicate
// with your virtual cluster.
func (c *Client) DeleteManagedEndpoint(ctx context.Context, params *DeleteManagedEndpointInput, optFns ...func(*Options)) (*DeleteManagedEndpointOutput, error) {
if params == nil {
params = &DeleteManagedEndpointInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteManagedEndpoint", params, optFns, c.addOperationDeleteManagedEndpointMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteManagedEndpointOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteManagedEndpointInput struct {
// The ID of the managed endpoint.
//
// This member is required.
Id *string
// The ID of the endpoint's virtual cluster.
//
// This member is required.
VirtualClusterId *string
noSmithyDocumentSerde
}
type DeleteManagedEndpointOutput struct {
// The output displays the ID of the managed endpoint.
Id *string
// The output displays the ID of the endpoint's virtual cluster.
VirtualClusterId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteManagedEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteManagedEndpoint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteManagedEndpoint{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteManagedEndpointValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteManagedEndpoint(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteManagedEndpoint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "DeleteManagedEndpoint",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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 virtual cluster. Virtual cluster is a managed entity on Amazon EMR on
// EKS. You can create, describe, list and delete virtual clusters. They do not
// consume any additional resource in your system. A single virtual cluster maps to
// a single Kubernetes namespace. Given this relationship, you can model virtual
// clusters the same way you model Kubernetes namespaces to meet your requirements.
func (c *Client) DeleteVirtualCluster(ctx context.Context, params *DeleteVirtualClusterInput, optFns ...func(*Options)) (*DeleteVirtualClusterOutput, error) {
if params == nil {
params = &DeleteVirtualClusterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteVirtualCluster", params, optFns, c.addOperationDeleteVirtualClusterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteVirtualClusterOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteVirtualClusterInput struct {
// The ID of the virtual cluster that will be deleted.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DeleteVirtualClusterOutput struct {
// This output contains the ID of the virtual cluster that will be deleted.
Id *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteVirtualClusterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVirtualCluster{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVirtualCluster{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteVirtualClusterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVirtualCluster(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteVirtualCluster(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "DeleteVirtualCluster",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Displays detailed information about a job run. A job run is a unit of work,
// such as a Spark jar, PySpark script, or SparkSQL query, that you submit to
// Amazon EMR on EKS.
func (c *Client) DescribeJobRun(ctx context.Context, params *DescribeJobRunInput, optFns ...func(*Options)) (*DescribeJobRunOutput, error) {
if params == nil {
params = &DescribeJobRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeJobRun", params, optFns, c.addOperationDescribeJobRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeJobRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeJobRunInput struct {
// The ID of the job run request.
//
// This member is required.
Id *string
// The ID of the virtual cluster for which the job run is submitted.
//
// This member is required.
VirtualClusterId *string
noSmithyDocumentSerde
}
type DescribeJobRunOutput struct {
// The output displays information about a job run.
JobRun *types.JobRun
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeJobRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeJobRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeJobRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeJobRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeJobRun(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeJobRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "DescribeJobRun",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Displays detailed information about a specified job template. Job template
// stores values of StartJobRun API request in a template and can be used to start
// a job run. Job template allows two use cases: avoid repeating recurring
// StartJobRun API request values, enforcing certain values in StartJobRun API
// request.
func (c *Client) DescribeJobTemplate(ctx context.Context, params *DescribeJobTemplateInput, optFns ...func(*Options)) (*DescribeJobTemplateOutput, error) {
if params == nil {
params = &DescribeJobTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeJobTemplate", params, optFns, c.addOperationDescribeJobTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeJobTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeJobTemplateInput struct {
// The ID of the job template that will be described.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DescribeJobTemplateOutput struct {
// This output displays information about the specified job template.
JobTemplate *types.JobTemplate
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeJobTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeJobTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeJobTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeJobTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeJobTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeJobTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "DescribeJobTemplate",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Displays detailed information about a managed endpoint. A managed endpoint is a
// gateway that connects Amazon EMR Studio to Amazon EMR on EKS so that Amazon EMR
// Studio can communicate with your virtual cluster.
func (c *Client) DescribeManagedEndpoint(ctx context.Context, params *DescribeManagedEndpointInput, optFns ...func(*Options)) (*DescribeManagedEndpointOutput, error) {
if params == nil {
params = &DescribeManagedEndpointInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeManagedEndpoint", params, optFns, c.addOperationDescribeManagedEndpointMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeManagedEndpointOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeManagedEndpointInput struct {
// This output displays ID of the managed endpoint.
//
// This member is required.
Id *string
// The ID of the endpoint's virtual cluster.
//
// This member is required.
VirtualClusterId *string
noSmithyDocumentSerde
}
type DescribeManagedEndpointOutput struct {
// This output displays information about a managed endpoint.
Endpoint *types.Endpoint
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeManagedEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeManagedEndpoint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeManagedEndpoint{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeManagedEndpointValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeManagedEndpoint(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeManagedEndpoint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "DescribeManagedEndpoint",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Displays detailed information about a specified virtual cluster. Virtual
// cluster is a managed entity on Amazon EMR on EKS. You can create, describe, list
// and delete virtual clusters. They do not consume any additional resource in your
// system. A single virtual cluster maps to a single Kubernetes namespace. Given
// this relationship, you can model virtual clusters the same way you model
// Kubernetes namespaces to meet your requirements.
func (c *Client) DescribeVirtualCluster(ctx context.Context, params *DescribeVirtualClusterInput, optFns ...func(*Options)) (*DescribeVirtualClusterOutput, error) {
if params == nil {
params = &DescribeVirtualClusterInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeVirtualCluster", params, optFns, c.addOperationDescribeVirtualClusterMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeVirtualClusterOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeVirtualClusterInput struct {
// The ID of the virtual cluster that will be described.
//
// This member is required.
Id *string
noSmithyDocumentSerde
}
type DescribeVirtualClusterOutput struct {
// This output displays information about the specified virtual cluster.
VirtualCluster *types.VirtualCluster
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeVirtualClusterMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeVirtualCluster{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeVirtualCluster{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeVirtualClusterValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVirtualCluster(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeVirtualCluster(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "DescribeVirtualCluster",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Lists job runs based on a set of parameters. A job run is a unit of work, such
// as a Spark jar, PySpark script, or SparkSQL query, that you submit to Amazon EMR
// on EKS.
func (c *Client) ListJobRuns(ctx context.Context, params *ListJobRunsInput, optFns ...func(*Options)) (*ListJobRunsOutput, error) {
if params == nil {
params = &ListJobRunsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListJobRuns", params, optFns, c.addOperationListJobRunsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListJobRunsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListJobRunsInput struct {
// The ID of the virtual cluster for which to list the job run.
//
// This member is required.
VirtualClusterId *string
// The date and time after which the job runs were submitted.
CreatedAfter *time.Time
// The date and time before which the job runs were submitted.
CreatedBefore *time.Time
// The maximum number of job runs that can be listed.
MaxResults *int32
// The name of the job run.
Name *string
// The token for the next set of job runs to return.
NextToken *string
// The states of the job run.
States []types.JobRunState
noSmithyDocumentSerde
}
type ListJobRunsOutput struct {
// This output lists information about the specified job runs.
JobRuns []types.JobRun
// This output displays the token for the next set of job runs.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListJobRunsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListJobRuns{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListJobRuns{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListJobRunsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListJobRuns(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListJobRunsAPIClient is a client that implements the ListJobRuns operation.
type ListJobRunsAPIClient interface {
ListJobRuns(context.Context, *ListJobRunsInput, ...func(*Options)) (*ListJobRunsOutput, error)
}
var _ ListJobRunsAPIClient = (*Client)(nil)
// ListJobRunsPaginatorOptions is the paginator options for ListJobRuns
type ListJobRunsPaginatorOptions struct {
// The maximum number of job runs that can be listed.
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
}
// ListJobRunsPaginator is a paginator for ListJobRuns
type ListJobRunsPaginator struct {
options ListJobRunsPaginatorOptions
client ListJobRunsAPIClient
params *ListJobRunsInput
nextToken *string
firstPage bool
}
// NewListJobRunsPaginator returns a new ListJobRunsPaginator
func NewListJobRunsPaginator(client ListJobRunsAPIClient, params *ListJobRunsInput, optFns ...func(*ListJobRunsPaginatorOptions)) *ListJobRunsPaginator {
if params == nil {
params = &ListJobRunsInput{}
}
options := ListJobRunsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListJobRunsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListJobRunsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListJobRuns page.
func (p *ListJobRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobRunsOutput, 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.ListJobRuns(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_opListJobRuns(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "ListJobRuns",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Lists job templates based on a set of parameters. Job template stores values of
// StartJobRun API request in a template and can be used to start a job run. Job
// template allows two use cases: avoid repeating recurring StartJobRun API request
// values, enforcing certain values in StartJobRun API request.
func (c *Client) ListJobTemplates(ctx context.Context, params *ListJobTemplatesInput, optFns ...func(*Options)) (*ListJobTemplatesOutput, error) {
if params == nil {
params = &ListJobTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListJobTemplates", params, optFns, c.addOperationListJobTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListJobTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListJobTemplatesInput struct {
// The date and time after which the job templates were created.
CreatedAfter *time.Time
// The date and time before which the job templates were created.
CreatedBefore *time.Time
// The maximum number of job templates that can be listed.
MaxResults *int32
// The token for the next set of job templates to return.
NextToken *string
noSmithyDocumentSerde
}
type ListJobTemplatesOutput struct {
// This output displays the token for the next set of job templates.
NextToken *string
// This output lists information about the specified job templates.
Templates []types.JobTemplate
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListJobTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListJobTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListJobTemplates{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListJobTemplates(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListJobTemplatesAPIClient is a client that implements the ListJobTemplates
// operation.
type ListJobTemplatesAPIClient interface {
ListJobTemplates(context.Context, *ListJobTemplatesInput, ...func(*Options)) (*ListJobTemplatesOutput, error)
}
var _ ListJobTemplatesAPIClient = (*Client)(nil)
// ListJobTemplatesPaginatorOptions is the paginator options for ListJobTemplates
type ListJobTemplatesPaginatorOptions struct {
// The maximum number of job templates that can be listed.
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
}
// ListJobTemplatesPaginator is a paginator for ListJobTemplates
type ListJobTemplatesPaginator struct {
options ListJobTemplatesPaginatorOptions
client ListJobTemplatesAPIClient
params *ListJobTemplatesInput
nextToken *string
firstPage bool
}
// NewListJobTemplatesPaginator returns a new ListJobTemplatesPaginator
func NewListJobTemplatesPaginator(client ListJobTemplatesAPIClient, params *ListJobTemplatesInput, optFns ...func(*ListJobTemplatesPaginatorOptions)) *ListJobTemplatesPaginator {
if params == nil {
params = &ListJobTemplatesInput{}
}
options := ListJobTemplatesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListJobTemplatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListJobTemplatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListJobTemplates page.
func (p *ListJobTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobTemplatesOutput, 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.ListJobTemplates(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_opListJobTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "ListJobTemplates",
}
}
| 227 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Lists managed endpoints based on a set of parameters. A managed endpoint is a
// gateway that connects Amazon EMR Studio to Amazon EMR on EKS so that Amazon EMR
// Studio can communicate with your virtual cluster.
func (c *Client) ListManagedEndpoints(ctx context.Context, params *ListManagedEndpointsInput, optFns ...func(*Options)) (*ListManagedEndpointsOutput, error) {
if params == nil {
params = &ListManagedEndpointsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListManagedEndpoints", params, optFns, c.addOperationListManagedEndpointsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListManagedEndpointsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListManagedEndpointsInput struct {
// The ID of the virtual cluster.
//
// This member is required.
VirtualClusterId *string
// The date and time after which the endpoints are created.
CreatedAfter *time.Time
// The date and time before which the endpoints are created.
CreatedBefore *time.Time
// The maximum number of managed endpoints that can be listed.
MaxResults *int32
// The token for the next set of managed endpoints to return.
NextToken *string
// The states of the managed endpoints.
States []types.EndpointState
// The types of the managed endpoints.
Types []string
noSmithyDocumentSerde
}
type ListManagedEndpointsOutput struct {
// The managed endpoints to be listed.
Endpoints []types.Endpoint
// The token for the next set of endpoints to return.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListManagedEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListManagedEndpoints{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListManagedEndpoints{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListManagedEndpointsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListManagedEndpoints(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListManagedEndpointsAPIClient is a client that implements the
// ListManagedEndpoints operation.
type ListManagedEndpointsAPIClient interface {
ListManagedEndpoints(context.Context, *ListManagedEndpointsInput, ...func(*Options)) (*ListManagedEndpointsOutput, error)
}
var _ ListManagedEndpointsAPIClient = (*Client)(nil)
// ListManagedEndpointsPaginatorOptions is the paginator options for
// ListManagedEndpoints
type ListManagedEndpointsPaginatorOptions struct {
// The maximum number of managed endpoints that can be listed.
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
}
// ListManagedEndpointsPaginator is a paginator for ListManagedEndpoints
type ListManagedEndpointsPaginator struct {
options ListManagedEndpointsPaginatorOptions
client ListManagedEndpointsAPIClient
params *ListManagedEndpointsInput
nextToken *string
firstPage bool
}
// NewListManagedEndpointsPaginator returns a new ListManagedEndpointsPaginator
func NewListManagedEndpointsPaginator(client ListManagedEndpointsAPIClient, params *ListManagedEndpointsInput, optFns ...func(*ListManagedEndpointsPaginatorOptions)) *ListManagedEndpointsPaginator {
if params == nil {
params = &ListManagedEndpointsInput{}
}
options := ListManagedEndpointsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListManagedEndpointsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListManagedEndpointsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListManagedEndpoints page.
func (p *ListManagedEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListManagedEndpointsOutput, 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.ListManagedEndpoints(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_opListManagedEndpoints(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "ListManagedEndpoints",
}
}
| 241 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the tags assigned to the resources.
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 tagged resources.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The tags assigned to resources.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "ListTagsForResource",
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Lists information about the specified virtual cluster. Virtual cluster is a
// managed entity on Amazon EMR on EKS. You can create, describe, list and delete
// virtual clusters. They do not consume any additional resource in your system. A
// single virtual cluster maps to a single Kubernetes namespace. Given this
// relationship, you can model virtual clusters the same way you model Kubernetes
// namespaces to meet your requirements.
func (c *Client) ListVirtualClusters(ctx context.Context, params *ListVirtualClustersInput, optFns ...func(*Options)) (*ListVirtualClustersOutput, error) {
if params == nil {
params = &ListVirtualClustersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListVirtualClusters", params, optFns, c.addOperationListVirtualClustersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListVirtualClustersOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListVirtualClustersInput struct {
// The container provider ID of the virtual cluster.
ContainerProviderId *string
// The container provider type of the virtual cluster. Amazon EKS is the only
// supported type as of now.
ContainerProviderType types.ContainerProviderType
// The date and time after which the virtual clusters are created.
CreatedAfter *time.Time
// The date and time before which the virtual clusters are created.
CreatedBefore *time.Time
// The maximum number of virtual clusters that can be listed.
MaxResults *int32
// The token for the next set of virtual clusters to return.
NextToken *string
// The states of the requested virtual clusters.
States []types.VirtualClusterState
noSmithyDocumentSerde
}
type ListVirtualClustersOutput struct {
// This output displays the token for the next set of virtual clusters.
NextToken *string
// This output lists the specified virtual clusters.
VirtualClusters []types.VirtualCluster
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListVirtualClustersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListVirtualClusters{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVirtualClusters{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListVirtualClusters(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListVirtualClustersAPIClient is a client that implements the
// ListVirtualClusters operation.
type ListVirtualClustersAPIClient interface {
ListVirtualClusters(context.Context, *ListVirtualClustersInput, ...func(*Options)) (*ListVirtualClustersOutput, error)
}
var _ ListVirtualClustersAPIClient = (*Client)(nil)
// ListVirtualClustersPaginatorOptions is the paginator options for
// ListVirtualClusters
type ListVirtualClustersPaginatorOptions struct {
// The maximum number of virtual clusters that can be listed.
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
}
// ListVirtualClustersPaginator is a paginator for ListVirtualClusters
type ListVirtualClustersPaginator struct {
options ListVirtualClustersPaginatorOptions
client ListVirtualClustersAPIClient
params *ListVirtualClustersInput
nextToken *string
firstPage bool
}
// NewListVirtualClustersPaginator returns a new ListVirtualClustersPaginator
func NewListVirtualClustersPaginator(client ListVirtualClustersAPIClient, params *ListVirtualClustersInput, optFns ...func(*ListVirtualClustersPaginatorOptions)) *ListVirtualClustersPaginator {
if params == nil {
params = &ListVirtualClustersInput{}
}
options := ListVirtualClustersPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListVirtualClustersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListVirtualClustersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListVirtualClusters page.
func (p *ListVirtualClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualClustersOutput, 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.ListVirtualClusters(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_opListVirtualClusters(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "ListVirtualClusters",
}
}
| 240 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts a job run. A job run is a unit of work, such as a Spark jar, PySpark
// script, or SparkSQL query, that you submit to Amazon EMR on EKS.
func (c *Client) StartJobRun(ctx context.Context, params *StartJobRunInput, optFns ...func(*Options)) (*StartJobRunOutput, error) {
if params == nil {
params = &StartJobRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartJobRun", params, optFns, c.addOperationStartJobRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartJobRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartJobRunInput struct {
// The client idempotency token of the job run request.
//
// This member is required.
ClientToken *string
// The virtual cluster ID for which the job run request is submitted.
//
// This member is required.
VirtualClusterId *string
// The configuration overrides for the job run.
ConfigurationOverrides *types.ConfigurationOverrides
// The execution role ARN for the job run.
ExecutionRoleArn *string
// The job driver for the job run.
JobDriver *types.JobDriver
// The job template ID to be used to start the job run.
JobTemplateId *string
// The values of job template parameters to start a job run.
JobTemplateParameters map[string]string
// The name of the job run.
Name *string
// The Amazon EMR release version to use for the job run.
ReleaseLabel *string
// The retry policy configuration for the job run.
RetryPolicyConfiguration *types.RetryPolicyConfiguration
// The tags assigned to job runs.
Tags map[string]string
noSmithyDocumentSerde
}
type StartJobRunOutput struct {
// This output lists the ARN of job run.
Arn *string
// This output displays the started job run ID.
Id *string
// This output displays the name of the started job run.
Name *string
// This output displays the virtual cluster ID for which the job run was submitted.
VirtualClusterId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartJobRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartJobRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartJobRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opStartJobRunMiddleware(stack, options); err != nil {
return err
}
if err = addOpStartJobRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartJobRun(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpStartJobRun struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpStartJobRun) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpStartJobRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*StartJobRunInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *StartJobRunInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opStartJobRunMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpStartJobRun{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opStartJobRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "StartJobRun",
}
}
| 204 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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"
)
// Assigns tags to resources. A tag is a label that you assign to an Amazon Web
// Services resource. Each tag consists of a key and an optional value, both of
// which you define. Tags enable you to categorize your Amazon Web Services
// resources by attributes such as purpose, owner, or environment. When you have
// many resources of the same type, you can quickly identify a specific resource
// based on the tags you've assigned to it. For example, you can define a set of
// tags for your Amazon EMR on EKS clusters to help you track each cluster's owner
// and stack level. We recommend that you devise a consistent set of tag keys for
// each resource type. You can then search and filter the resources based on the
// tags that you add.
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 resources.
//
// This member is required.
ResourceArn *string
// The tags assigned to resources.
//
// This member is required.
Tags map[string]string
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-containers",
OperationName: "TagResource",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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 resources.
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 resources.
//
// This member is required.
ResourceArn *string
// The tag keys of the resources.
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = 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: "emr-containers",
OperationName: "UntagResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/emrcontainers/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsRestjson1_deserializeOpCancelJobRun struct {
}
func (*awsRestjson1_deserializeOpCancelJobRun) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCancelJobRun) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCancelJobRun(response, &metadata)
}
output := &CancelJobRunOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCancelJobRunOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCancelJobRun(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCancelJobRunOutput(v **CancelJobRunOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CancelJobRunOutput
if *v == nil {
sv = &CancelJobRunOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "virtualClusterId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.VirtualClusterId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateJobTemplate struct {
}
func (*awsRestjson1_deserializeOpCreateJobTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateJobTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateJobTemplate(response, &metadata)
}
output := &CreateJobTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateJobTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateJobTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateJobTemplateOutput(v **CreateJobTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateJobTemplateOutput
if *v == nil {
sv = &CreateJobTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobTemplateArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "createdAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Date to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(t)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceNameString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateManagedEndpoint struct {
}
func (*awsRestjson1_deserializeOpCreateManagedEndpoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateManagedEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateManagedEndpoint(response, &metadata)
}
output := &CreateManagedEndpointOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateManagedEndpointOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateManagedEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateManagedEndpointOutput(v **CreateManagedEndpointOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateManagedEndpointOutput
if *v == nil {
sv = &CreateManagedEndpointOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EndpointArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceNameString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "virtualClusterId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.VirtualClusterId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateVirtualCluster struct {
}
func (*awsRestjson1_deserializeOpCreateVirtualCluster) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateVirtualCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateVirtualCluster(response, &metadata)
}
output := &CreateVirtualClusterOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateVirtualClusterOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateVirtualCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateVirtualClusterOutput(v **CreateVirtualClusterOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateVirtualClusterOutput
if *v == nil {
sv = &CreateVirtualClusterOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VirtualClusterArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceNameString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteJobTemplate struct {
}
func (*awsRestjson1_deserializeOpDeleteJobTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteJobTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteJobTemplate(response, &metadata)
}
output := &DeleteJobTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDeleteJobTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteJobTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteJobTemplateOutput(v **DeleteJobTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteJobTemplateOutput
if *v == nil {
sv = &DeleteJobTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteManagedEndpoint struct {
}
func (*awsRestjson1_deserializeOpDeleteManagedEndpoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteManagedEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteManagedEndpoint(response, &metadata)
}
output := &DeleteManagedEndpointOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDeleteManagedEndpointOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteManagedEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteManagedEndpointOutput(v **DeleteManagedEndpointOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteManagedEndpointOutput
if *v == nil {
sv = &DeleteManagedEndpointOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "virtualClusterId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.VirtualClusterId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteVirtualCluster struct {
}
func (*awsRestjson1_deserializeOpDeleteVirtualCluster) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteVirtualCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteVirtualCluster(response, &metadata)
}
output := &DeleteVirtualClusterOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDeleteVirtualClusterOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteVirtualCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteVirtualClusterOutput(v **DeleteVirtualClusterOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteVirtualClusterOutput
if *v == nil {
sv = &DeleteVirtualClusterOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeJobRun struct {
}
func (*awsRestjson1_deserializeOpDescribeJobRun) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeJobRun) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDescribeJobRun(response, &metadata)
}
output := &DescribeJobRunOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDescribeJobRunOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDescribeJobRun(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeJobRunOutput(v **DescribeJobRunOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeJobRunOutput
if *v == nil {
sv = &DescribeJobRunOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "jobRun":
if err := awsRestjson1_deserializeDocumentJobRun(&sv.JobRun, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeJobTemplate struct {
}
func (*awsRestjson1_deserializeOpDescribeJobTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeJobTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDescribeJobTemplate(response, &metadata)
}
output := &DescribeJobTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDescribeJobTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDescribeJobTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeJobTemplateOutput(v **DescribeJobTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeJobTemplateOutput
if *v == nil {
sv = &DescribeJobTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "jobTemplate":
if err := awsRestjson1_deserializeDocumentJobTemplate(&sv.JobTemplate, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeManagedEndpoint struct {
}
func (*awsRestjson1_deserializeOpDescribeManagedEndpoint) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeManagedEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDescribeManagedEndpoint(response, &metadata)
}
output := &DescribeManagedEndpointOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDescribeManagedEndpointOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDescribeManagedEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeManagedEndpointOutput(v **DescribeManagedEndpointOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeManagedEndpointOutput
if *v == nil {
sv = &DescribeManagedEndpointOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "endpoint":
if err := awsRestjson1_deserializeDocumentEndpoint(&sv.Endpoint, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDescribeVirtualCluster struct {
}
func (*awsRestjson1_deserializeOpDescribeVirtualCluster) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeVirtualCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDescribeVirtualCluster(response, &metadata)
}
output := &DescribeVirtualClusterOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDescribeVirtualClusterOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDescribeVirtualCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDescribeVirtualClusterOutput(v **DescribeVirtualClusterOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeVirtualClusterOutput
if *v == nil {
sv = &DescribeVirtualClusterOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "virtualCluster":
if err := awsRestjson1_deserializeDocumentVirtualCluster(&sv.VirtualCluster, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetManagedEndpointSessionCredentials struct {
}
func (*awsRestjson1_deserializeOpGetManagedEndpointSessionCredentials) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetManagedEndpointSessionCredentials) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetManagedEndpointSessionCredentials(response, &metadata)
}
output := &GetManagedEndpointSessionCredentialsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetManagedEndpointSessionCredentialsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetManagedEndpointSessionCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("RequestThrottledException", errorCode):
return awsRestjson1_deserializeErrorRequestThrottledException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetManagedEndpointSessionCredentialsOutput(v **GetManagedEndpointSessionCredentialsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetManagedEndpointSessionCredentialsOutput
if *v == nil {
sv = &GetManagedEndpointSessionCredentialsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "credentials":
if err := awsRestjson1_deserializeDocumentCredentials(&sv.Credentials, value); err != nil {
return err
}
case "expiresAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Date to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.ExpiresAt = ptr.Time(t)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListJobRuns struct {
}
func (*awsRestjson1_deserializeOpListJobRuns) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListJobRuns) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListJobRuns(response, &metadata)
}
output := &ListJobRunsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListJobRunsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListJobRuns(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListJobRunsOutput(v **ListJobRunsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListJobRunsOutput
if *v == nil {
sv = &ListJobRunsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "jobRuns":
if err := awsRestjson1_deserializeDocumentJobRuns(&sv.JobRuns, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListJobTemplates struct {
}
func (*awsRestjson1_deserializeOpListJobTemplates) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListJobTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListJobTemplates(response, &metadata)
}
output := &ListJobTemplatesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListJobTemplatesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListJobTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListJobTemplatesOutput(v **ListJobTemplatesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListJobTemplatesOutput
if *v == nil {
sv = &ListJobTemplatesOutput{}
} 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 "templates":
if err := awsRestjson1_deserializeDocumentJobTemplates(&sv.Templates, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListManagedEndpoints struct {
}
func (*awsRestjson1_deserializeOpListManagedEndpoints) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListManagedEndpoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListManagedEndpoints(response, &metadata)
}
output := &ListManagedEndpointsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListManagedEndpointsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListManagedEndpoints(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListManagedEndpointsOutput(v **ListManagedEndpointsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListManagedEndpointsOutput
if *v == nil {
sv = &ListManagedEndpointsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "endpoints":
if err := awsRestjson1_deserializeDocumentEndpoints(&sv.Endpoints, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListTagsForResource struct {
}
func (*awsRestjson1_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListVirtualClusters struct {
}
func (*awsRestjson1_deserializeOpListVirtualClusters) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListVirtualClusters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListVirtualClusters(response, &metadata)
}
output := &ListVirtualClustersOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListVirtualClustersOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListVirtualClusters(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListVirtualClustersOutput(v **ListVirtualClustersOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListVirtualClustersOutput
if *v == nil {
sv = &ListVirtualClustersOutput{}
} 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 "virtualClusters":
if err := awsRestjson1_deserializeDocumentVirtualClusters(&sv.VirtualClusters, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpStartJobRun struct {
}
func (*awsRestjson1_deserializeOpStartJobRun) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartJobRun) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorStartJobRun(response, &metadata)
}
output := &StartJobRunOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentStartJobRunOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorStartJobRun(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentStartJobRunOutput(v **StartJobRunOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartJobRunOutput
if *v == nil {
sv = &StartJobRunOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceNameString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "virtualClusterId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.VirtualClusterId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpTagResource struct {
}
func (*awsRestjson1_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUntagResource struct {
}
func (*awsRestjson1_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ValidationException", errorCode):
return awsRestjson1_deserializeErrorValidationException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServerException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorRequestThrottledException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.RequestThrottledException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentRequestThrottledException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceNotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ValidationException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentValidationException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeDocumentCertificate(v **types.Certificate, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Certificate
if *v == nil {
sv = &types.Certificate{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "certificateArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ACMCertArn to be of type string, got %T instead", value)
}
sv.CertificateArn = ptr.String(jtv)
}
case "certificateData":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Base64Encoded to be of type string, got %T instead", value)
}
sv.CertificateData = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCloudWatchMonitoringConfiguration(v **types.CloudWatchMonitoringConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CloudWatchMonitoringConfiguration
if *v == nil {
sv = &types.CloudWatchMonitoringConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "logGroupName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value)
}
sv.LogGroupName = ptr.String(jtv)
}
case "logStreamNamePrefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String256 to be of type string, got %T instead", value)
}
sv.LogStreamNamePrefix = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConfiguration(v **types.Configuration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Configuration
if *v == nil {
sv = &types.Configuration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "classification":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String1024 to be of type string, got %T instead", value)
}
sv.Classification = ptr.String(jtv)
}
case "configurations":
if err := awsRestjson1_deserializeDocumentConfigurationList(&sv.Configurations, value); err != nil {
return err
}
case "properties":
if err := awsRestjson1_deserializeDocumentSensitivePropertiesMap(&sv.Properties, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConfigurationList(v *[]types.Configuration, 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.Configuration
if *v == nil {
cv = []types.Configuration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Configuration
destAddr := &col
if err := awsRestjson1_deserializeDocumentConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentConfigurationOverrides(v **types.ConfigurationOverrides, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConfigurationOverrides
if *v == nil {
sv = &types.ConfigurationOverrides{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationConfiguration":
if err := awsRestjson1_deserializeDocumentConfigurationList(&sv.ApplicationConfiguration, value); err != nil {
return err
}
case "monitoringConfiguration":
if err := awsRestjson1_deserializeDocumentMonitoringConfiguration(&sv.MonitoringConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentContainerInfo(v *types.ContainerInfo, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var uv types.ContainerInfo
loop:
for key, value := range shape {
if value == nil {
continue
}
switch key {
case "eksInfo":
var mv types.EksInfo
destAddr := &mv
if err := awsRestjson1_deserializeDocumentEksInfo(&destAddr, value); err != nil {
return err
}
mv = *destAddr
uv = &types.ContainerInfoMemberEksInfo{Value: mv}
break loop
default:
uv = &types.UnknownUnionMember{Tag: key}
break loop
}
}
*v = uv
return nil
}
func awsRestjson1_deserializeDocumentContainerLogRotationConfiguration(v **types.ContainerLogRotationConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ContainerLogRotationConfiguration
if *v == nil {
sv = &types.ContainerLogRotationConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "maxFilesToKeep":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxFilesToKeep to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxFilesToKeep = ptr.Int32(int32(i64))
}
case "rotationSize":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RotationSize to be of type string, got %T instead", value)
}
sv.RotationSize = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentContainerProvider(v **types.ContainerProvider, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ContainerProvider
if *v == nil {
sv = &types.ContainerProvider{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClusterId to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "info":
if err := awsRestjson1_deserializeDocumentContainerInfo(&sv.Info, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerProviderType to be of type string, got %T instead", value)
}
sv.Type = types.ContainerProviderType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCredentials(v *types.Credentials, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var uv types.Credentials
loop:
for key, value := range shape {
if value == nil {
continue
}
switch key {
case "token":
var mv string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Token to be of type string, got %T instead", value)
}
mv = jtv
}
uv = &types.CredentialsMemberToken{Value: mv}
break loop
default:
uv = &types.UnknownUnionMember{Tag: key}
break loop
}
}
*v = uv
return nil
}
func awsRestjson1_deserializeDocumentEksInfo(v **types.EksInfo, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.EksInfo
if *v == nil {
sv = &types.EksInfo{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "namespace":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KubernetesNamespace to be of type string, got %T instead", value)
}
sv.Namespace = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEndpoint(v **types.Endpoint, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Endpoint
if *v == nil {
sv = &types.Endpoint{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EndpointArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "certificateArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ACMCertArn to be of type string, got %T instead", value)
}
sv.CertificateArn = ptr.String(jtv)
}
case "certificateAuthority":
if err := awsRestjson1_deserializeDocumentCertificate(&sv.CertificateAuthority, value); err != nil {
return err
}
case "configurationOverrides":
if err := awsRestjson1_deserializeDocumentConfigurationOverrides(&sv.ConfigurationOverrides, value); err != nil {
return err
}
case "createdAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Date to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(t)
}
case "executionRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IAMRoleArn to be of type string, got %T instead", value)
}
sv.ExecutionRoleArn = ptr.String(jtv)
}
case "failureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = types.FailureReason(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceNameString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "releaseLabel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReleaseLabel to be of type string, got %T instead", value)
}
sv.ReleaseLabel = ptr.String(jtv)
}
case "securityGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String256 to be of type string, got %T instead", value)
}
sv.SecurityGroup = ptr.String(jtv)
}
case "serverUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UriString to be of type string, got %T instead", value)
}
sv.ServerUrl = ptr.String(jtv)
}
case "state":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EndpointState to be of type string, got %T instead", value)
}
sv.State = types.EndpointState(jtv)
}
case "stateDetails":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String256 to be of type string, got %T instead", value)
}
sv.StateDetails = ptr.String(jtv)
}
case "subnetIds":
if err := awsRestjson1_deserializeDocumentSubnetIds(&sv.SubnetIds, value); err != nil {
return err
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EndpointType to be of type string, got %T instead", value)
}
sv.Type = ptr.String(jtv)
}
case "virtualClusterId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.VirtualClusterId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEndpoints(v *[]types.Endpoint, 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.Endpoint
if *v == nil {
cv = []types.Endpoint{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Endpoint
destAddr := &col
if err := awsRestjson1_deserializeDocumentEndpoint(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentEntryPointArguments(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 EntryPointArgument to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerException
if *v == nil {
sv = &types.InternalServerException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String1024 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentJobDriver(v **types.JobDriver, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JobDriver
if *v == nil {
sv = &types.JobDriver{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "sparkSqlJobDriver":
if err := awsRestjson1_deserializeDocumentSparkSqlJobDriver(&sv.SparkSqlJobDriver, value); err != nil {
return err
}
case "sparkSubmitJobDriver":
if err := awsRestjson1_deserializeDocumentSparkSubmitJobDriver(&sv.SparkSubmitJobDriver, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentJobRun(v **types.JobRun, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JobRun
if *v == nil {
sv = &types.JobRun{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "clientToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value)
}
sv.ClientToken = ptr.String(jtv)
}
case "configurationOverrides":
if err := awsRestjson1_deserializeDocumentConfigurationOverrides(&sv.ConfigurationOverrides, value); err != nil {
return err
}
case "createdAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Date to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(t)
}
case "createdBy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RequestIdentityUserArn to be of type string, got %T instead", value)
}
sv.CreatedBy = ptr.String(jtv)
}
case "executionRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IAMRoleArn to be of type string, got %T instead", value)
}
sv.ExecutionRoleArn = ptr.String(jtv)
}
case "failureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureReason to be of type string, got %T instead", value)
}
sv.FailureReason = types.FailureReason(jtv)
}
case "finishedAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Date to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.FinishedAt = ptr.Time(t)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "jobDriver":
if err := awsRestjson1_deserializeDocumentJobDriver(&sv.JobDriver, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceNameString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "releaseLabel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReleaseLabel to be of type string, got %T instead", value)
}
sv.ReleaseLabel = ptr.String(jtv)
}
case "retryPolicyConfiguration":
if err := awsRestjson1_deserializeDocumentRetryPolicyConfiguration(&sv.RetryPolicyConfiguration, value); err != nil {
return err
}
case "retryPolicyExecution":
if err := awsRestjson1_deserializeDocumentRetryPolicyExecution(&sv.RetryPolicyExecution, value); err != nil {
return err
}
case "state":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobRunState to be of type string, got %T instead", value)
}
sv.State = types.JobRunState(jtv)
}
case "stateDetails":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String256 to be of type string, got %T instead", value)
}
sv.StateDetails = ptr.String(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
case "virtualClusterId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.VirtualClusterId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentJobRuns(v *[]types.JobRun, 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.JobRun
if *v == nil {
cv = []types.JobRun{}
} else {
cv = *v
}
for _, value := range shape {
var col types.JobRun
destAddr := &col
if err := awsRestjson1_deserializeDocumentJobRun(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentJobTemplate(v **types.JobTemplate, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JobTemplate
if *v == nil {
sv = &types.JobTemplate{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobTemplateArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "createdAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Date to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(t)
}
case "createdBy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RequestIdentityUserArn to be of type string, got %T instead", value)
}
sv.CreatedBy = ptr.String(jtv)
}
case "decryptionError":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String2048 to be of type string, got %T instead", value)
}
sv.DecryptionError = ptr.String(jtv)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "jobTemplateData":
if err := awsRestjson1_deserializeDocumentJobTemplateData(&sv.JobTemplateData, value); err != nil {
return err
}
case "kmsKeyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value)
}
sv.KmsKeyArn = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceNameString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentJobTemplateData(v **types.JobTemplateData, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.JobTemplateData
if *v == nil {
sv = &types.JobTemplateData{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "configurationOverrides":
if err := awsRestjson1_deserializeDocumentParametricConfigurationOverrides(&sv.ConfigurationOverrides, value); err != nil {
return err
}
case "executionRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ParametricIAMRoleArn to be of type string, got %T instead", value)
}
sv.ExecutionRoleArn = ptr.String(jtv)
}
case "jobDriver":
if err := awsRestjson1_deserializeDocumentJobDriver(&sv.JobDriver, value); err != nil {
return err
}
case "jobTags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.JobTags, value); err != nil {
return err
}
case "parameterConfiguration":
if err := awsRestjson1_deserializeDocumentTemplateParameterConfigurationMap(&sv.ParameterConfiguration, value); err != nil {
return err
}
case "releaseLabel":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ParametricReleaseLabel to be of type string, got %T instead", value)
}
sv.ReleaseLabel = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentJobTemplates(v *[]types.JobTemplate, 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.JobTemplate
if *v == nil {
cv = []types.JobTemplate{}
} else {
cv = *v
}
for _, value := range shape {
var col types.JobTemplate
destAddr := &col
if err := awsRestjson1_deserializeDocumentJobTemplate(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMonitoringConfiguration(v **types.MonitoringConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MonitoringConfiguration
if *v == nil {
sv = &types.MonitoringConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "cloudWatchMonitoringConfiguration":
if err := awsRestjson1_deserializeDocumentCloudWatchMonitoringConfiguration(&sv.CloudWatchMonitoringConfiguration, value); err != nil {
return err
}
case "containerLogRotationConfiguration":
if err := awsRestjson1_deserializeDocumentContainerLogRotationConfiguration(&sv.ContainerLogRotationConfiguration, value); err != nil {
return err
}
case "persistentAppUI":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PersistentAppUI to be of type string, got %T instead", value)
}
sv.PersistentAppUI = types.PersistentAppUI(jtv)
}
case "s3MonitoringConfiguration":
if err := awsRestjson1_deserializeDocumentS3MonitoringConfiguration(&sv.S3MonitoringConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentParametricCloudWatchMonitoringConfiguration(v **types.ParametricCloudWatchMonitoringConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ParametricCloudWatchMonitoringConfiguration
if *v == nil {
sv = &types.ParametricCloudWatchMonitoringConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "logGroupName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TemplateParameter to be of type string, got %T instead", value)
}
sv.LogGroupName = ptr.String(jtv)
}
case "logStreamNamePrefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String256 to be of type string, got %T instead", value)
}
sv.LogStreamNamePrefix = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentParametricConfigurationOverrides(v **types.ParametricConfigurationOverrides, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ParametricConfigurationOverrides
if *v == nil {
sv = &types.ParametricConfigurationOverrides{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationConfiguration":
if err := awsRestjson1_deserializeDocumentConfigurationList(&sv.ApplicationConfiguration, value); err != nil {
return err
}
case "monitoringConfiguration":
if err := awsRestjson1_deserializeDocumentParametricMonitoringConfiguration(&sv.MonitoringConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentParametricMonitoringConfiguration(v **types.ParametricMonitoringConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ParametricMonitoringConfiguration
if *v == nil {
sv = &types.ParametricMonitoringConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "cloudWatchMonitoringConfiguration":
if err := awsRestjson1_deserializeDocumentParametricCloudWatchMonitoringConfiguration(&sv.CloudWatchMonitoringConfiguration, value); err != nil {
return err
}
case "persistentAppUI":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TemplateParameter to be of type string, got %T instead", value)
}
sv.PersistentAppUI = ptr.String(jtv)
}
case "s3MonitoringConfiguration":
if err := awsRestjson1_deserializeDocumentParametricS3MonitoringConfiguration(&sv.S3MonitoringConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentParametricS3MonitoringConfiguration(v **types.ParametricS3MonitoringConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ParametricS3MonitoringConfiguration
if *v == nil {
sv = &types.ParametricS3MonitoringConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "logUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UriString to be of type string, got %T instead", value)
}
sv.LogUri = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRequestThrottledException(v **types.RequestThrottledException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RequestThrottledException
if *v == nil {
sv = &types.RequestThrottledException{}
} 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 String1024 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String1024 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRetryPolicyConfiguration(v **types.RetryPolicyConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RetryPolicyConfiguration
if *v == nil {
sv = &types.RetryPolicyConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "maxAttempts":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected JavaInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxAttempts = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRetryPolicyExecution(v **types.RetryPolicyExecution, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RetryPolicyExecution
if *v == nil {
sv = &types.RetryPolicyExecution{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "currentAttemptCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected JavaInteger to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.CurrentAttemptCount = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentS3MonitoringConfiguration(v **types.S3MonitoringConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.S3MonitoringConfiguration
if *v == nil {
sv = &types.S3MonitoringConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "logUri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UriString to be of type string, got %T instead", value)
}
sv.LogUri = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSensitivePropertiesMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String1024 to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentSparkSqlJobDriver(v **types.SparkSqlJobDriver, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SparkSqlJobDriver
if *v == nil {
sv = &types.SparkSqlJobDriver{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "entryPoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntryPointPath to be of type string, got %T instead", value)
}
sv.EntryPoint = ptr.String(jtv)
}
case "sparkSqlParameters":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SparkSqlParameters to be of type string, got %T instead", value)
}
sv.SparkSqlParameters = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSparkSubmitJobDriver(v **types.SparkSubmitJobDriver, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SparkSubmitJobDriver
if *v == nil {
sv = &types.SparkSubmitJobDriver{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "entryPoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EntryPointPath to be of type string, got %T instead", value)
}
sv.EntryPoint = ptr.String(jtv)
}
case "entryPointArguments":
if err := awsRestjson1_deserializeDocumentEntryPointArguments(&sv.EntryPointArguments, value); err != nil {
return err
}
case "sparkSubmitParameters":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SparkSubmitParameters to be of type string, got %T instead", value)
}
sv.SparkSubmitParameters = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSubnetIds(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 String256 to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]string
if *v == nil {
mv = map[string]string{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StringEmpty256 to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentTemplateParameterConfiguration(v **types.TemplateParameterConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TemplateParameterConfiguration
if *v == nil {
sv = &types.TemplateParameterConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "defaultValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String1024 to be of type string, got %T instead", value)
}
sv.DefaultValue = ptr.String(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TemplateParameterDataType to be of type string, got %T instead", value)
}
sv.Type = types.TemplateParameterDataType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTemplateParameterConfigurationMap(v *map[string]types.TemplateParameterConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var mv map[string]types.TemplateParameterConfiguration
if *v == nil {
mv = map[string]types.TemplateParameterConfiguration{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal types.TemplateParameterConfiguration
mapVar := parsedVal
destAddr := &mapVar
if err := awsRestjson1_deserializeDocumentTemplateParameterConfiguration(&destAddr, value); err != nil {
return err
}
parsedVal = *destAddr
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ValidationException
if *v == nil {
sv = &types.ValidationException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String1024 to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVirtualCluster(v **types.VirtualCluster, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.VirtualCluster
if *v == nil {
sv = &types.VirtualCluster{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "arn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VirtualClusterArn to be of type string, got %T instead", value)
}
sv.Arn = ptr.String(jtv)
}
case "containerProvider":
if err := awsRestjson1_deserializeDocumentContainerProvider(&sv.ContainerProvider, value); err != nil {
return err
}
case "createdAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Date to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(t)
}
case "id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceNameString to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "state":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VirtualClusterState to be of type string, got %T instead", value)
}
sv.State = types.VirtualClusterState(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVirtualClusters(v *[]types.VirtualCluster, 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.VirtualCluster
if *v == nil {
cv = []types.VirtualCluster{}
} else {
cv = *v
}
for _, value := range shape {
var col types.VirtualCluster
destAddr := &col
if err := awsRestjson1_deserializeDocumentVirtualCluster(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
| 5,399 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package emrcontainers provides the API client, operations, and parameter types
// for Amazon EMR Containers.
//
// Amazon EMR on EKS provides a deployment option for Amazon EMR that allows you
// to run open-source big data frameworks on Amazon Elastic Kubernetes Service
// (Amazon EKS). With this deployment option, you can focus on running analytics
// workloads while Amazon EMR on EKS builds, configures, and manages containers for
// open-source applications. For more information about Amazon EMR on EKS concepts
// and tasks, see What is shared id="EMR-EKS"/> (https://docs.aws.amazon.com/emr/latest/EMR-on-EKS-DevelopmentGuide/emr-eks.html)
// . Amazon EMR containers is the API name for Amazon EMR on EKS. The
// emr-containers prefix is used in the following scenarios:
// - It is the prefix in the CLI commands for Amazon EMR on EKS. For example,
// aws emr-containers start-job-run .
// - It is the prefix before IAM policy actions for Amazon EMR on EKS. For
// example, "Action": [ "emr-containers:StartJobRun"] . For more information, see
// Policy actions for Amazon EMR on EKS (https://docs.aws.amazon.com/emr/latest/EMR-on-EKS-DevelopmentGuide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-actions)
// .
// - It is the prefix used in Amazon EMR on EKS service endpoints. For example,
// emr-containers.us-east-2.amazonaws.com . For more information, see Amazon EMR
// on EKSService Endpoints (https://docs.aws.amazon.com/emr/latest/EMR-on-EKS-DevelopmentGuide/service-quotas.html#service-endpoints)
// .
package emrcontainers
| 25 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
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/emrcontainers/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 = "emr-containers"
}
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 emrcontainers
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.19.2"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/emrcontainers/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"
)
type awsRestjson1_serializeOpCancelJobRun struct {
}
func (*awsRestjson1_serializeOpCancelJobRun) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCancelJobRun) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CancelJobRunInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{virtualClusterId}/jobruns/{id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCancelJobRunInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCancelJobRunInput(v *CancelJobRunInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
if v.VirtualClusterId == nil || len(*v.VirtualClusterId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member virtualClusterId must not be empty")}
}
if v.VirtualClusterId != nil {
if err := encoder.SetURI("virtualClusterId").String(*v.VirtualClusterId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateJobTemplate struct {
}
func (*awsRestjson1_serializeOpCreateJobTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateJobTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateJobTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobtemplates")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateJobTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateJobTemplateInput(v *CreateJobTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateJobTemplateInput(v *CreateJobTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.JobTemplateData != nil {
ok := object.Key("jobTemplateData")
if err := awsRestjson1_serializeDocumentJobTemplateData(v.JobTemplateData, ok); err != nil {
return err
}
}
if v.KmsKeyArn != nil {
ok := object.Key("kmsKeyArn")
ok.String(*v.KmsKeyArn)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateManagedEndpoint struct {
}
func (*awsRestjson1_serializeOpCreateManagedEndpoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateManagedEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateManagedEndpointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{virtualClusterId}/endpoints")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateManagedEndpointInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateManagedEndpointInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateManagedEndpointInput(v *CreateManagedEndpointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.VirtualClusterId == nil || len(*v.VirtualClusterId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member virtualClusterId must not be empty")}
}
if v.VirtualClusterId != nil {
if err := encoder.SetURI("virtualClusterId").String(*v.VirtualClusterId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateManagedEndpointInput(v *CreateManagedEndpointInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CertificateArn != nil {
ok := object.Key("certificateArn")
ok.String(*v.CertificateArn)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ConfigurationOverrides != nil {
ok := object.Key("configurationOverrides")
if err := awsRestjson1_serializeDocumentConfigurationOverrides(v.ConfigurationOverrides, ok); err != nil {
return err
}
}
if v.ExecutionRoleArn != nil {
ok := object.Key("executionRoleArn")
ok.String(*v.ExecutionRoleArn)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.ReleaseLabel != nil {
ok := object.Key("releaseLabel")
ok.String(*v.ReleaseLabel)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.Type != nil {
ok := object.Key("type")
ok.String(*v.Type)
}
return nil
}
type awsRestjson1_serializeOpCreateVirtualCluster struct {
}
func (*awsRestjson1_serializeOpCreateVirtualCluster) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateVirtualCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateVirtualClusterInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateVirtualClusterInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateVirtualClusterInput(v *CreateVirtualClusterInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateVirtualClusterInput(v *CreateVirtualClusterInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ContainerProvider != nil {
ok := object.Key("containerProvider")
if err := awsRestjson1_serializeDocumentContainerProvider(v.ContainerProvider, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteJobTemplate struct {
}
func (*awsRestjson1_serializeOpDeleteJobTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteJobTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteJobTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobtemplates/{id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteJobTemplateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteJobTemplateInput(v *DeleteJobTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteManagedEndpoint struct {
}
func (*awsRestjson1_serializeOpDeleteManagedEndpoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteManagedEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteManagedEndpointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{virtualClusterId}/endpoints/{id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteManagedEndpointInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteManagedEndpointInput(v *DeleteManagedEndpointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
if v.VirtualClusterId == nil || len(*v.VirtualClusterId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member virtualClusterId must not be empty")}
}
if v.VirtualClusterId != nil {
if err := encoder.SetURI("virtualClusterId").String(*v.VirtualClusterId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteVirtualCluster struct {
}
func (*awsRestjson1_serializeOpDeleteVirtualCluster) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteVirtualCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteVirtualClusterInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteVirtualClusterInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteVirtualClusterInput(v *DeleteVirtualClusterInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeJobRun struct {
}
func (*awsRestjson1_serializeOpDescribeJobRun) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeJobRun) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeJobRunInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{virtualClusterId}/jobruns/{id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeJobRunInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeJobRunInput(v *DescribeJobRunInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
if v.VirtualClusterId == nil || len(*v.VirtualClusterId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member virtualClusterId must not be empty")}
}
if v.VirtualClusterId != nil {
if err := encoder.SetURI("virtualClusterId").String(*v.VirtualClusterId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeJobTemplate struct {
}
func (*awsRestjson1_serializeOpDescribeJobTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeJobTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeJobTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobtemplates/{id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeJobTemplateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeJobTemplateInput(v *DescribeJobTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeManagedEndpoint struct {
}
func (*awsRestjson1_serializeOpDescribeManagedEndpoint) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeManagedEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeManagedEndpointInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{virtualClusterId}/endpoints/{id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeManagedEndpointInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeManagedEndpointInput(v *DescribeManagedEndpointInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
if v.VirtualClusterId == nil || len(*v.VirtualClusterId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member virtualClusterId must not be empty")}
}
if v.VirtualClusterId != nil {
if err := encoder.SetURI("virtualClusterId").String(*v.VirtualClusterId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeVirtualCluster struct {
}
func (*awsRestjson1_serializeOpDescribeVirtualCluster) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeVirtualCluster) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeVirtualClusterInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeVirtualClusterInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeVirtualClusterInput(v *DescribeVirtualClusterInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetManagedEndpointSessionCredentials struct {
}
func (*awsRestjson1_serializeOpGetManagedEndpointSessionCredentials) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetManagedEndpointSessionCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetManagedEndpointSessionCredentialsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{virtualClusterIdentifier}/endpoints/{endpointIdentifier}/credentials")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetManagedEndpointSessionCredentialsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentGetManagedEndpointSessionCredentialsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetManagedEndpointSessionCredentialsInput(v *GetManagedEndpointSessionCredentialsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EndpointIdentifier == nil || len(*v.EndpointIdentifier) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member endpointIdentifier must not be empty")}
}
if v.EndpointIdentifier != nil {
if err := encoder.SetURI("endpointIdentifier").String(*v.EndpointIdentifier); err != nil {
return err
}
}
if v.VirtualClusterIdentifier == nil || len(*v.VirtualClusterIdentifier) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member virtualClusterIdentifier must not be empty")}
}
if v.VirtualClusterIdentifier != nil {
if err := encoder.SetURI("virtualClusterIdentifier").String(*v.VirtualClusterIdentifier); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentGetManagedEndpointSessionCredentialsInput(v *GetManagedEndpointSessionCredentialsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.CredentialType != nil {
ok := object.Key("credentialType")
ok.String(*v.CredentialType)
}
if v.DurationInSeconds != nil {
ok := object.Key("durationInSeconds")
ok.Integer(*v.DurationInSeconds)
}
if v.ExecutionRoleArn != nil {
ok := object.Key("executionRoleArn")
ok.String(*v.ExecutionRoleArn)
}
if v.LogContext != nil {
ok := object.Key("logContext")
ok.String(*v.LogContext)
}
return nil
}
type awsRestjson1_serializeOpListJobRuns struct {
}
func (*awsRestjson1_serializeOpListJobRuns) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListJobRuns) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListJobRunsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{virtualClusterId}/jobruns")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListJobRunsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListJobRunsInput(v *ListJobRunsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CreatedAfter != nil {
encoder.SetQuery("createdAfter").String(smithytime.FormatDateTime(*v.CreatedAfter))
}
if v.CreatedBefore != nil {
encoder.SetQuery("createdBefore").String(smithytime.FormatDateTime(*v.CreatedBefore))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.Name != nil {
encoder.SetQuery("name").String(*v.Name)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.States != nil {
for i := range v.States {
encoder.AddQuery("states").String(string(v.States[i]))
}
}
if v.VirtualClusterId == nil || len(*v.VirtualClusterId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member virtualClusterId must not be empty")}
}
if v.VirtualClusterId != nil {
if err := encoder.SetURI("virtualClusterId").String(*v.VirtualClusterId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListJobTemplates struct {
}
func (*awsRestjson1_serializeOpListJobTemplates) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListJobTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListJobTemplatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobtemplates")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListJobTemplatesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListJobTemplatesInput(v *ListJobTemplatesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CreatedAfter != nil {
encoder.SetQuery("createdAfter").String(smithytime.FormatDateTime(*v.CreatedAfter))
}
if v.CreatedBefore != nil {
encoder.SetQuery("createdBefore").String(smithytime.FormatDateTime(*v.CreatedBefore))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListManagedEndpoints struct {
}
func (*awsRestjson1_serializeOpListManagedEndpoints) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListManagedEndpoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListManagedEndpointsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{virtualClusterId}/endpoints")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListManagedEndpointsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListManagedEndpointsInput(v *ListManagedEndpointsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CreatedAfter != nil {
encoder.SetQuery("createdAfter").String(smithytime.FormatDateTime(*v.CreatedAfter))
}
if v.CreatedBefore != nil {
encoder.SetQuery("createdBefore").String(smithytime.FormatDateTime(*v.CreatedBefore))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.States != nil {
for i := range v.States {
encoder.AddQuery("states").String(string(v.States[i]))
}
}
if v.Types != nil {
for i := range v.Types {
encoder.AddQuery("types").String(v.Types[i])
}
}
if v.VirtualClusterId == nil || len(*v.VirtualClusterId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member virtualClusterId must not be empty")}
}
if v.VirtualClusterId != nil {
if err := encoder.SetURI("virtualClusterId").String(*v.VirtualClusterId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListTagsForResource struct {
}
func (*awsRestjson1_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListVirtualClusters struct {
}
func (*awsRestjson1_serializeOpListVirtualClusters) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListVirtualClusters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListVirtualClustersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListVirtualClustersInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListVirtualClustersInput(v *ListVirtualClustersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContainerProviderId != nil {
encoder.SetQuery("containerProviderId").String(*v.ContainerProviderId)
}
if len(v.ContainerProviderType) > 0 {
encoder.SetQuery("containerProviderType").String(string(v.ContainerProviderType))
}
if v.CreatedAfter != nil {
encoder.SetQuery("createdAfter").String(smithytime.FormatDateTime(*v.CreatedAfter))
}
if v.CreatedBefore != nil {
encoder.SetQuery("createdBefore").String(smithytime.FormatDateTime(*v.CreatedBefore))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.States != nil {
for i := range v.States {
encoder.AddQuery("states").String(string(v.States[i]))
}
}
return nil
}
type awsRestjson1_serializeOpStartJobRun struct {
}
func (*awsRestjson1_serializeOpStartJobRun) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartJobRun) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartJobRunInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/virtualclusters/{virtualClusterId}/jobruns")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsStartJobRunInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartJobRunInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsStartJobRunInput(v *StartJobRunInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.VirtualClusterId == nil || len(*v.VirtualClusterId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member virtualClusterId must not be empty")}
}
if v.VirtualClusterId != nil {
if err := encoder.SetURI("virtualClusterId").String(*v.VirtualClusterId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentStartJobRunInput(v *StartJobRunInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ConfigurationOverrides != nil {
ok := object.Key("configurationOverrides")
if err := awsRestjson1_serializeDocumentConfigurationOverrides(v.ConfigurationOverrides, ok); err != nil {
return err
}
}
if v.ExecutionRoleArn != nil {
ok := object.Key("executionRoleArn")
ok.String(*v.ExecutionRoleArn)
}
if v.JobDriver != nil {
ok := object.Key("jobDriver")
if err := awsRestjson1_serializeDocumentJobDriver(v.JobDriver, ok); err != nil {
return err
}
}
if v.JobTemplateId != nil {
ok := object.Key("jobTemplateId")
ok.String(*v.JobTemplateId)
}
if v.JobTemplateParameters != nil {
ok := object.Key("jobTemplateParameters")
if err := awsRestjson1_serializeDocumentTemplateParameterInputMap(v.JobTemplateParameters, ok); err != nil {
return err
}
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.ReleaseLabel != nil {
ok := object.Key("releaseLabel")
ok.String(*v.ReleaseLabel)
}
if v.RetryPolicyConfiguration != nil {
ok := object.Key("retryPolicyConfiguration")
if err := awsRestjson1_serializeDocumentRetryPolicyConfiguration(v.RetryPolicyConfiguration, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUntagResource struct {
}
func (*awsRestjson1_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("tagKeys").String(v.TagKeys[i])
}
}
return nil
}
func awsRestjson1_serializeDocumentCloudWatchMonitoringConfiguration(v *types.CloudWatchMonitoringConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogGroupName != nil {
ok := object.Key("logGroupName")
ok.String(*v.LogGroupName)
}
if v.LogStreamNamePrefix != nil {
ok := object.Key("logStreamNamePrefix")
ok.String(*v.LogStreamNamePrefix)
}
return nil
}
func awsRestjson1_serializeDocumentConfiguration(v *types.Configuration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Classification != nil {
ok := object.Key("classification")
ok.String(*v.Classification)
}
if v.Configurations != nil {
ok := object.Key("configurations")
if err := awsRestjson1_serializeDocumentConfigurationList(v.Configurations, ok); err != nil {
return err
}
}
if v.Properties != nil {
ok := object.Key("properties")
if err := awsRestjson1_serializeDocumentSensitivePropertiesMap(v.Properties, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentConfigurationList(v []types.Configuration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentConfigurationOverrides(v *types.ConfigurationOverrides, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationConfiguration != nil {
ok := object.Key("applicationConfiguration")
if err := awsRestjson1_serializeDocumentConfigurationList(v.ApplicationConfiguration, ok); err != nil {
return err
}
}
if v.MonitoringConfiguration != nil {
ok := object.Key("monitoringConfiguration")
if err := awsRestjson1_serializeDocumentMonitoringConfiguration(v.MonitoringConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentContainerInfo(v types.ContainerInfo, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.ContainerInfoMemberEksInfo:
av := object.Key("eksInfo")
if err := awsRestjson1_serializeDocumentEksInfo(&uv.Value, av); err != nil {
return err
}
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestjson1_serializeDocumentContainerLogRotationConfiguration(v *types.ContainerLogRotationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxFilesToKeep != nil {
ok := object.Key("maxFilesToKeep")
ok.Integer(*v.MaxFilesToKeep)
}
if v.RotationSize != nil {
ok := object.Key("rotationSize")
ok.String(*v.RotationSize)
}
return nil
}
func awsRestjson1_serializeDocumentContainerProvider(v *types.ContainerProvider, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Info != nil {
ok := object.Key("info")
if err := awsRestjson1_serializeDocumentContainerInfo(v.Info, ok); err != nil {
return err
}
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentEksInfo(v *types.EksInfo, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Namespace != nil {
ok := object.Key("namespace")
ok.String(*v.Namespace)
}
return nil
}
func awsRestjson1_serializeDocumentEntryPointArguments(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentJobDriver(v *types.JobDriver, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SparkSqlJobDriver != nil {
ok := object.Key("sparkSqlJobDriver")
if err := awsRestjson1_serializeDocumentSparkSqlJobDriver(v.SparkSqlJobDriver, ok); err != nil {
return err
}
}
if v.SparkSubmitJobDriver != nil {
ok := object.Key("sparkSubmitJobDriver")
if err := awsRestjson1_serializeDocumentSparkSubmitJobDriver(v.SparkSubmitJobDriver, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentJobTemplateData(v *types.JobTemplateData, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConfigurationOverrides != nil {
ok := object.Key("configurationOverrides")
if err := awsRestjson1_serializeDocumentParametricConfigurationOverrides(v.ConfigurationOverrides, ok); err != nil {
return err
}
}
if v.ExecutionRoleArn != nil {
ok := object.Key("executionRoleArn")
ok.String(*v.ExecutionRoleArn)
}
if v.JobDriver != nil {
ok := object.Key("jobDriver")
if err := awsRestjson1_serializeDocumentJobDriver(v.JobDriver, ok); err != nil {
return err
}
}
if v.JobTags != nil {
ok := object.Key("jobTags")
if err := awsRestjson1_serializeDocumentTagMap(v.JobTags, ok); err != nil {
return err
}
}
if v.ParameterConfiguration != nil {
ok := object.Key("parameterConfiguration")
if err := awsRestjson1_serializeDocumentTemplateParameterConfigurationMap(v.ParameterConfiguration, ok); err != nil {
return err
}
}
if v.ReleaseLabel != nil {
ok := object.Key("releaseLabel")
ok.String(*v.ReleaseLabel)
}
return nil
}
func awsRestjson1_serializeDocumentMonitoringConfiguration(v *types.MonitoringConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchMonitoringConfiguration != nil {
ok := object.Key("cloudWatchMonitoringConfiguration")
if err := awsRestjson1_serializeDocumentCloudWatchMonitoringConfiguration(v.CloudWatchMonitoringConfiguration, ok); err != nil {
return err
}
}
if v.ContainerLogRotationConfiguration != nil {
ok := object.Key("containerLogRotationConfiguration")
if err := awsRestjson1_serializeDocumentContainerLogRotationConfiguration(v.ContainerLogRotationConfiguration, ok); err != nil {
return err
}
}
if len(v.PersistentAppUI) > 0 {
ok := object.Key("persistentAppUI")
ok.String(string(v.PersistentAppUI))
}
if v.S3MonitoringConfiguration != nil {
ok := object.Key("s3MonitoringConfiguration")
if err := awsRestjson1_serializeDocumentS3MonitoringConfiguration(v.S3MonitoringConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentParametricCloudWatchMonitoringConfiguration(v *types.ParametricCloudWatchMonitoringConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogGroupName != nil {
ok := object.Key("logGroupName")
ok.String(*v.LogGroupName)
}
if v.LogStreamNamePrefix != nil {
ok := object.Key("logStreamNamePrefix")
ok.String(*v.LogStreamNamePrefix)
}
return nil
}
func awsRestjson1_serializeDocumentParametricConfigurationOverrides(v *types.ParametricConfigurationOverrides, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationConfiguration != nil {
ok := object.Key("applicationConfiguration")
if err := awsRestjson1_serializeDocumentConfigurationList(v.ApplicationConfiguration, ok); err != nil {
return err
}
}
if v.MonitoringConfiguration != nil {
ok := object.Key("monitoringConfiguration")
if err := awsRestjson1_serializeDocumentParametricMonitoringConfiguration(v.MonitoringConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentParametricMonitoringConfiguration(v *types.ParametricMonitoringConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchMonitoringConfiguration != nil {
ok := object.Key("cloudWatchMonitoringConfiguration")
if err := awsRestjson1_serializeDocumentParametricCloudWatchMonitoringConfiguration(v.CloudWatchMonitoringConfiguration, ok); err != nil {
return err
}
}
if v.PersistentAppUI != nil {
ok := object.Key("persistentAppUI")
ok.String(*v.PersistentAppUI)
}
if v.S3MonitoringConfiguration != nil {
ok := object.Key("s3MonitoringConfiguration")
if err := awsRestjson1_serializeDocumentParametricS3MonitoringConfiguration(v.S3MonitoringConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentParametricS3MonitoringConfiguration(v *types.ParametricS3MonitoringConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogUri != nil {
ok := object.Key("logUri")
ok.String(*v.LogUri)
}
return nil
}
func awsRestjson1_serializeDocumentRetryPolicyConfiguration(v *types.RetryPolicyConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxAttempts != nil {
ok := object.Key("maxAttempts")
ok.Integer(*v.MaxAttempts)
}
return nil
}
func awsRestjson1_serializeDocumentS3MonitoringConfiguration(v *types.S3MonitoringConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogUri != nil {
ok := object.Key("logUri")
ok.String(*v.LogUri)
}
return nil
}
func awsRestjson1_serializeDocumentSensitivePropertiesMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentSparkSqlJobDriver(v *types.SparkSqlJobDriver, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EntryPoint != nil {
ok := object.Key("entryPoint")
ok.String(*v.EntryPoint)
}
if v.SparkSqlParameters != nil {
ok := object.Key("sparkSqlParameters")
ok.String(*v.SparkSqlParameters)
}
return nil
}
func awsRestjson1_serializeDocumentSparkSubmitJobDriver(v *types.SparkSubmitJobDriver, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EntryPoint != nil {
ok := object.Key("entryPoint")
ok.String(*v.EntryPoint)
}
if v.EntryPointArguments != nil {
ok := object.Key("entryPointArguments")
if err := awsRestjson1_serializeDocumentEntryPointArguments(v.EntryPointArguments, ok); err != nil {
return err
}
}
if v.SparkSubmitParameters != nil {
ok := object.Key("sparkSubmitParameters")
ok.String(*v.SparkSubmitParameters)
}
return nil
}
func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentTemplateParameterConfiguration(v *types.TemplateParameterConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValue != nil {
ok := object.Key("defaultValue")
ok.String(*v.DefaultValue)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentTemplateParameterConfigurationMap(v map[string]types.TemplateParameterConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentTemplateParameterConfiguration(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTemplateParameterInputMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
| 2,044 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrcontainers
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/emrcontainers/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCancelJobRun struct {
}
func (*validateOpCancelJobRun) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCancelJobRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CancelJobRunInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCancelJobRunInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateJobTemplate struct {
}
func (*validateOpCreateJobTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateJobTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateJobTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateJobTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateManagedEndpoint struct {
}
func (*validateOpCreateManagedEndpoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateManagedEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateManagedEndpointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateManagedEndpointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateVirtualCluster struct {
}
func (*validateOpCreateVirtualCluster) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateVirtualCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateVirtualClusterInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateVirtualClusterInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteJobTemplate struct {
}
func (*validateOpDeleteJobTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteJobTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteJobTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteJobTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteManagedEndpoint struct {
}
func (*validateOpDeleteManagedEndpoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteManagedEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteManagedEndpointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteManagedEndpointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteVirtualCluster struct {
}
func (*validateOpDeleteVirtualCluster) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteVirtualCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteVirtualClusterInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteVirtualClusterInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeJobRun struct {
}
func (*validateOpDescribeJobRun) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeJobRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeJobRunInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeJobRunInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeJobTemplate struct {
}
func (*validateOpDescribeJobTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeJobTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeJobTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeJobTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeManagedEndpoint struct {
}
func (*validateOpDescribeManagedEndpoint) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeManagedEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeManagedEndpointInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeManagedEndpointInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeVirtualCluster struct {
}
func (*validateOpDescribeVirtualCluster) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeVirtualCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeVirtualClusterInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeVirtualClusterInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetManagedEndpointSessionCredentials struct {
}
func (*validateOpGetManagedEndpointSessionCredentials) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetManagedEndpointSessionCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetManagedEndpointSessionCredentialsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetManagedEndpointSessionCredentialsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListJobRuns struct {
}
func (*validateOpListJobRuns) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListJobRuns) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListJobRunsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListJobRunsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListManagedEndpoints struct {
}
func (*validateOpListManagedEndpoints) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListManagedEndpoints) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListManagedEndpointsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListManagedEndpointsInput(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 validateOpStartJobRun struct {
}
func (*validateOpStartJobRun) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartJobRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartJobRunInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartJobRunInput(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)
}
func addOpCancelJobRunValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCancelJobRun{}, middleware.After)
}
func addOpCreateJobTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateJobTemplate{}, middleware.After)
}
func addOpCreateManagedEndpointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateManagedEndpoint{}, middleware.After)
}
func addOpCreateVirtualClusterValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateVirtualCluster{}, middleware.After)
}
func addOpDeleteJobTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteJobTemplate{}, middleware.After)
}
func addOpDeleteManagedEndpointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteManagedEndpoint{}, middleware.After)
}
func addOpDeleteVirtualClusterValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteVirtualCluster{}, middleware.After)
}
func addOpDescribeJobRunValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeJobRun{}, middleware.After)
}
func addOpDescribeJobTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeJobTemplate{}, middleware.After)
}
func addOpDescribeManagedEndpointValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeManagedEndpoint{}, middleware.After)
}
func addOpDescribeVirtualClusterValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeVirtualCluster{}, middleware.After)
}
func addOpGetManagedEndpointSessionCredentialsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetManagedEndpointSessionCredentials{}, middleware.After)
}
func addOpListJobRunsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListJobRuns{}, middleware.After)
}
func addOpListManagedEndpointsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListManagedEndpoints{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpStartJobRunValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartJobRun{}, 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 validateCloudWatchMonitoringConfiguration(v *types.CloudWatchMonitoringConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchMonitoringConfiguration"}
if v.LogGroupName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConfiguration(v *types.Configuration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Configuration"}
if v.Classification == nil {
invalidParams.Add(smithy.NewErrParamRequired("Classification"))
}
if v.Configurations != nil {
if err := validateConfigurationList(v.Configurations); err != nil {
invalidParams.AddNested("Configurations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConfigurationList(v []types.Configuration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConfigurationList"}
for i := range v {
if err := validateConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConfigurationOverrides(v *types.ConfigurationOverrides) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConfigurationOverrides"}
if v.ApplicationConfiguration != nil {
if err := validateConfigurationList(v.ApplicationConfiguration); err != nil {
invalidParams.AddNested("ApplicationConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.MonitoringConfiguration != nil {
if err := validateMonitoringConfiguration(v.MonitoringConfiguration); err != nil {
invalidParams.AddNested("MonitoringConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateContainerLogRotationConfiguration(v *types.ContainerLogRotationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ContainerLogRotationConfiguration"}
if v.RotationSize == nil {
invalidParams.Add(smithy.NewErrParamRequired("RotationSize"))
}
if v.MaxFilesToKeep == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaxFilesToKeep"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateContainerProvider(v *types.ContainerProvider) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ContainerProvider"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobDriver(v *types.JobDriver) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobDriver"}
if v.SparkSubmitJobDriver != nil {
if err := validateSparkSubmitJobDriver(v.SparkSubmitJobDriver); err != nil {
invalidParams.AddNested("SparkSubmitJobDriver", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateJobTemplateData(v *types.JobTemplateData) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "JobTemplateData"}
if v.ExecutionRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionRoleArn"))
}
if v.ReleaseLabel == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReleaseLabel"))
}
if v.ConfigurationOverrides != nil {
if err := validateParametricConfigurationOverrides(v.ConfigurationOverrides); err != nil {
invalidParams.AddNested("ConfigurationOverrides", err.(smithy.InvalidParamsError))
}
}
if v.JobDriver == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobDriver"))
} else if v.JobDriver != nil {
if err := validateJobDriver(v.JobDriver); err != nil {
invalidParams.AddNested("JobDriver", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMonitoringConfiguration(v *types.MonitoringConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MonitoringConfiguration"}
if v.CloudWatchMonitoringConfiguration != nil {
if err := validateCloudWatchMonitoringConfiguration(v.CloudWatchMonitoringConfiguration); err != nil {
invalidParams.AddNested("CloudWatchMonitoringConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.S3MonitoringConfiguration != nil {
if err := validateS3MonitoringConfiguration(v.S3MonitoringConfiguration); err != nil {
invalidParams.AddNested("S3MonitoringConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.ContainerLogRotationConfiguration != nil {
if err := validateContainerLogRotationConfiguration(v.ContainerLogRotationConfiguration); err != nil {
invalidParams.AddNested("ContainerLogRotationConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateParametricConfigurationOverrides(v *types.ParametricConfigurationOverrides) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ParametricConfigurationOverrides"}
if v.ApplicationConfiguration != nil {
if err := validateConfigurationList(v.ApplicationConfiguration); err != nil {
invalidParams.AddNested("ApplicationConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRetryPolicyConfiguration(v *types.RetryPolicyConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RetryPolicyConfiguration"}
if v.MaxAttempts == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaxAttempts"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateS3MonitoringConfiguration(v *types.S3MonitoringConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "S3MonitoringConfiguration"}
if v.LogUri == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogUri"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSparkSubmitJobDriver(v *types.SparkSubmitJobDriver) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SparkSubmitJobDriver"}
if v.EntryPoint == nil {
invalidParams.Add(smithy.NewErrParamRequired("EntryPoint"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCancelJobRunInput(v *CancelJobRunInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CancelJobRunInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.VirtualClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VirtualClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateJobTemplateInput(v *CreateJobTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateJobTemplateInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.JobTemplateData == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobTemplateData"))
} else if v.JobTemplateData != nil {
if err := validateJobTemplateData(v.JobTemplateData); err != nil {
invalidParams.AddNested("JobTemplateData", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateManagedEndpointInput(v *CreateManagedEndpointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateManagedEndpointInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.VirtualClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VirtualClusterId"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.ReleaseLabel == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReleaseLabel"))
}
if v.ExecutionRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionRoleArn"))
}
if v.ConfigurationOverrides != nil {
if err := validateConfigurationOverrides(v.ConfigurationOverrides); err != nil {
invalidParams.AddNested("ConfigurationOverrides", err.(smithy.InvalidParamsError))
}
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateVirtualClusterInput(v *CreateVirtualClusterInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateVirtualClusterInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.ContainerProvider == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerProvider"))
} else if v.ContainerProvider != nil {
if err := validateContainerProvider(v.ContainerProvider); err != nil {
invalidParams.AddNested("ContainerProvider", err.(smithy.InvalidParamsError))
}
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteJobTemplateInput(v *DeleteJobTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteJobTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteManagedEndpointInput(v *DeleteManagedEndpointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteManagedEndpointInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.VirtualClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VirtualClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteVirtualClusterInput(v *DeleteVirtualClusterInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteVirtualClusterInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeJobRunInput(v *DescribeJobRunInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeJobRunInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.VirtualClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VirtualClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeJobTemplateInput(v *DescribeJobTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeJobTemplateInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeManagedEndpointInput(v *DescribeManagedEndpointInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeManagedEndpointInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.VirtualClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VirtualClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeVirtualClusterInput(v *DescribeVirtualClusterInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeVirtualClusterInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetManagedEndpointSessionCredentialsInput(v *GetManagedEndpointSessionCredentialsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetManagedEndpointSessionCredentialsInput"}
if v.EndpointIdentifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndpointIdentifier"))
}
if v.VirtualClusterIdentifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("VirtualClusterIdentifier"))
}
if v.ExecutionRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExecutionRoleArn"))
}
if v.CredentialType == nil {
invalidParams.Add(smithy.NewErrParamRequired("CredentialType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListJobRunsInput(v *ListJobRunsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListJobRunsInput"}
if v.VirtualClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VirtualClusterId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListManagedEndpointsInput(v *ListManagedEndpointsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListManagedEndpointsInput"}
if v.VirtualClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VirtualClusterId"))
}
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 validateOpStartJobRunInput(v *StartJobRunInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartJobRunInput"}
if v.VirtualClusterId == nil {
invalidParams.Add(smithy.NewErrParamRequired("VirtualClusterId"))
}
if v.ClientToken == nil {
invalidParams.Add(smithy.NewErrParamRequired("ClientToken"))
}
if v.JobDriver != nil {
if err := validateJobDriver(v.JobDriver); err != nil {
invalidParams.AddNested("JobDriver", err.(smithy.InvalidParamsError))
}
}
if v.ConfigurationOverrides != nil {
if err := validateConfigurationOverrides(v.ConfigurationOverrides); err != nil {
invalidParams.AddNested("ConfigurationOverrides", err.(smithy.InvalidParamsError))
}
}
if v.RetryPolicyConfiguration != nil {
if err := validateRetryPolicyConfiguration(v.RetryPolicyConfiguration); err != nil {
invalidParams.AddNested("RetryPolicyConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 1,045 |
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 EMR containers 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: "emr-containers.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "emr-containers-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "emr-containers-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "emr-containers.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
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-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "emr-containers-fips.ca-central-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "fips-ca-central-1",
}: endpoints.Endpoint{
Hostname: "emr-containers-fips.ca-central-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ca-central-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "emr-containers-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: "emr-containers-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: "emr-containers-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: "emr-containers-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
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: "emr-containers-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "emr-containers-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "emr-containers-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "emr-containers-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "emr-containers.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "emr-containers-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "emr-containers-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "emr-containers.{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: "emr-containers-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "emr-containers.{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: "emr-containers-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "emr-containers.{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: "emr-containers-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "emr-containers.{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: "emr-containers-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "emr-containers.{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: "emr-containers.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "emr-containers-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "emr-containers-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "emr-containers.{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{},
},
},
}
| 444 |
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 ContainerProviderType string
// Enum values for ContainerProviderType
const (
ContainerProviderTypeEks ContainerProviderType = "EKS"
)
// Values returns all known values for ContainerProviderType. 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 (ContainerProviderType) Values() []ContainerProviderType {
return []ContainerProviderType{
"EKS",
}
}
type EndpointState string
// Enum values for EndpointState
const (
EndpointStateCreating EndpointState = "CREATING"
EndpointStateActive EndpointState = "ACTIVE"
EndpointStateTerminating EndpointState = "TERMINATING"
EndpointStateTerminated EndpointState = "TERMINATED"
EndpointStateTerminatedWithErrors EndpointState = "TERMINATED_WITH_ERRORS"
)
// Values returns all known values for EndpointState. 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 (EndpointState) Values() []EndpointState {
return []EndpointState{
"CREATING",
"ACTIVE",
"TERMINATING",
"TERMINATED",
"TERMINATED_WITH_ERRORS",
}
}
type FailureReason string
// Enum values for FailureReason
const (
FailureReasonInternalError FailureReason = "INTERNAL_ERROR"
FailureReasonUserError FailureReason = "USER_ERROR"
FailureReasonValidationError FailureReason = "VALIDATION_ERROR"
FailureReasonClusterUnavailable FailureReason = "CLUSTER_UNAVAILABLE"
)
// Values returns all known values for FailureReason. 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 (FailureReason) Values() []FailureReason {
return []FailureReason{
"INTERNAL_ERROR",
"USER_ERROR",
"VALIDATION_ERROR",
"CLUSTER_UNAVAILABLE",
}
}
type JobRunState string
// Enum values for JobRunState
const (
JobRunStatePending JobRunState = "PENDING"
JobRunStateSubmitted JobRunState = "SUBMITTED"
JobRunStateRunning JobRunState = "RUNNING"
JobRunStateFailed JobRunState = "FAILED"
JobRunStateCancelled JobRunState = "CANCELLED"
JobRunStateCancelPending JobRunState = "CANCEL_PENDING"
JobRunStateCompleted JobRunState = "COMPLETED"
)
// Values returns all known values for JobRunState. 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 (JobRunState) Values() []JobRunState {
return []JobRunState{
"PENDING",
"SUBMITTED",
"RUNNING",
"FAILED",
"CANCELLED",
"CANCEL_PENDING",
"COMPLETED",
}
}
type PersistentAppUI string
// Enum values for PersistentAppUI
const (
PersistentAppUIEnabled PersistentAppUI = "ENABLED"
PersistentAppUIDisabled PersistentAppUI = "DISABLED"
)
// Values returns all known values for PersistentAppUI. 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 (PersistentAppUI) Values() []PersistentAppUI {
return []PersistentAppUI{
"ENABLED",
"DISABLED",
}
}
type TemplateParameterDataType string
// Enum values for TemplateParameterDataType
const (
TemplateParameterDataTypeNumber TemplateParameterDataType = "NUMBER"
TemplateParameterDataTypeString TemplateParameterDataType = "STRING"
)
// Values returns all known values for TemplateParameterDataType. 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 (TemplateParameterDataType) Values() []TemplateParameterDataType {
return []TemplateParameterDataType{
"NUMBER",
"STRING",
}
}
type VirtualClusterState string
// Enum values for VirtualClusterState
const (
VirtualClusterStateRunning VirtualClusterState = "RUNNING"
VirtualClusterStateTerminating VirtualClusterState = "TERMINATING"
VirtualClusterStateTerminated VirtualClusterState = "TERMINATED"
VirtualClusterStateArrested VirtualClusterState = "ARRESTED"
)
// Values returns all known values for VirtualClusterState. 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 (VirtualClusterState) Values() []VirtualClusterState {
return []VirtualClusterState{
"RUNNING",
"TERMINATING",
"TERMINATED",
"ARRESTED",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// This is an internal server exception.
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The request throttled.
type RequestThrottledException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *RequestThrottledException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *RequestThrottledException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *RequestThrottledException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "RequestThrottledException"
}
return *e.ErrorCodeOverride
}
func (e *RequestThrottledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified resource was not 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 }
// There are invalid parameters in the client request.
type ValidationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ValidationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ValidationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ValidationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ValidationException"
}
return *e.ErrorCodeOverride
}
func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 113 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// The entity representing certificate data generated for managed endpoint.
type Certificate struct {
// The ARN of the certificate generated for managed endpoint.
CertificateArn *string
// The base64 encoded PEM certificate data generated for managed endpoint.
CertificateData *string
noSmithyDocumentSerde
}
// A configuration for CloudWatch monitoring. You can configure your jobs to send
// log information to CloudWatch Logs.
type CloudWatchMonitoringConfiguration struct {
// The name of the log group for log publishing.
//
// This member is required.
LogGroupName *string
// The specified name prefix for log streams.
LogStreamNamePrefix *string
noSmithyDocumentSerde
}
// A configuration specification to be used when provisioning virtual clusters,
// which can include configurations for applications and software bundled with
// Amazon EMR on EKS. A configuration consists of a classification, properties, and
// optional nested configurations. A classification refers to an
// application-specific configuration file. Properties are the settings you want to
// change in that file.
type Configuration struct {
// The classification within a configuration.
//
// This member is required.
Classification *string
// A list of additional configurations to apply within a configuration object.
Configurations []Configuration
// A set of properties specified within a configuration classification.
Properties map[string]string
noSmithyDocumentSerde
}
// A configuration specification to be used to override existing configurations.
type ConfigurationOverrides struct {
// The configurations for the application running by the job run.
ApplicationConfiguration []Configuration
// The configurations for monitoring.
MonitoringConfiguration *MonitoringConfiguration
noSmithyDocumentSerde
}
// The information about the container used for a job run or a managed endpoint.
//
// The following types satisfy this interface:
//
// ContainerInfoMemberEksInfo
type ContainerInfo interface {
isContainerInfo()
}
// The information about the Amazon EKS cluster.
type ContainerInfoMemberEksInfo struct {
Value EksInfo
noSmithyDocumentSerde
}
func (*ContainerInfoMemberEksInfo) isContainerInfo() {}
// The settings for container log rotation.
type ContainerLogRotationConfiguration struct {
// The number of files to keep in container after rotation.
//
// This member is required.
MaxFilesToKeep *int32
// The file size at which to rotate logs. Minimum of 2KB, Maximum of 2GB.
//
// This member is required.
RotationSize *string
noSmithyDocumentSerde
}
// The information about the container provider.
type ContainerProvider struct {
// The ID of the container cluster.
//
// This member is required.
Id *string
// The type of the container provider. Amazon EKS is the only supported type as of
// now.
//
// This member is required.
Type ContainerProviderType
// The information about the container cluster.
Info ContainerInfo
noSmithyDocumentSerde
}
// The structure containing the session token being returned.
//
// The following types satisfy this interface:
//
// CredentialsMemberToken
type Credentials interface {
isCredentials()
}
// The actual session token being returned.
type CredentialsMemberToken struct {
Value string
noSmithyDocumentSerde
}
func (*CredentialsMemberToken) isCredentials() {}
// The information about the Amazon EKS cluster.
type EksInfo struct {
// The namespaces of the Amazon EKS cluster.
Namespace *string
noSmithyDocumentSerde
}
// This entity represents the endpoint that is managed by Amazon EMR on EKS.
type Endpoint struct {
// The ARN of the endpoint.
Arn *string
// The certificate ARN of the endpoint. This field is under deprecation and will
// be removed in future.
//
// Deprecated: Customer provided certificate-arn is deprecated and would be
// removed in future.
CertificateArn *string
// The certificate generated by emr control plane on customer behalf to secure the
// managed endpoint.
CertificateAuthority *Certificate
// The configuration settings that are used to override existing configurations
// for endpoints.
ConfigurationOverrides *ConfigurationOverrides
// The date and time when the endpoint was created.
CreatedAt *time.Time
// The execution role ARN of the endpoint.
ExecutionRoleArn *string
// The reasons why the endpoint has failed.
FailureReason FailureReason
// The ID of the endpoint.
Id *string
// The name of the endpoint.
Name *string
// The EMR release version to be used for the endpoint.
ReleaseLabel *string
// The security group configuration of the endpoint.
SecurityGroup *string
// The server URL of the endpoint.
ServerUrl *string
// The state of the endpoint.
State EndpointState
// Additional details of the endpoint state.
StateDetails *string
// The subnet IDs of the endpoint.
SubnetIds []string
// The tags of the endpoint.
Tags map[string]string
// The type of the endpoint.
Type *string
// The ID of the endpoint's virtual cluster.
VirtualClusterId *string
noSmithyDocumentSerde
}
// Specify the driver that the job runs on. Exactly one of the two available job
// drivers is required, either sparkSqlJobDriver or sparkSubmitJobDriver.
type JobDriver struct {
// The job driver for job type.
SparkSqlJobDriver *SparkSqlJobDriver
// The job driver parameters specified for spark submit.
SparkSubmitJobDriver *SparkSubmitJobDriver
noSmithyDocumentSerde
}
// This entity describes a job run. A job run is a unit of work, such as a Spark
// jar, PySpark script, or SparkSQL query, that you submit to Amazon EMR on EKS.
type JobRun struct {
// The ARN of job run.
Arn *string
// The client token used to start a job run.
ClientToken *string
// The configuration settings that are used to override default configuration.
ConfigurationOverrides *ConfigurationOverrides
// The date and time when the job run was created.
CreatedAt *time.Time
// The user who created the job run.
CreatedBy *string
// The execution role ARN of the job run.
ExecutionRoleArn *string
// The reasons why the job run has failed.
FailureReason FailureReason
// The date and time when the job run has finished.
FinishedAt *time.Time
// The ID of the job run.
Id *string
// Parameters of job driver for the job run.
JobDriver *JobDriver
// The name of the job run.
Name *string
// The release version of Amazon EMR.
ReleaseLabel *string
// The configuration of the retry policy that the job runs on.
RetryPolicyConfiguration *RetryPolicyConfiguration
// The current status of the retry policy executed on the job.
RetryPolicyExecution *RetryPolicyExecution
// The state of the job run.
State JobRunState
// Additional details of the job run state.
StateDetails *string
// The assigned tags of the job run.
Tags map[string]string
// The ID of the job run's virtual cluster.
VirtualClusterId *string
noSmithyDocumentSerde
}
// This entity describes a job template. Job template stores values of StartJobRun
// API request in a template and can be used to start a job run. Job template
// allows two use cases: avoid repeating recurring StartJobRun API request values,
// enforcing certain values in StartJobRun API request.
type JobTemplate struct {
// The job template data which holds values of StartJobRun API request.
//
// This member is required.
JobTemplateData *JobTemplateData
// The ARN of the job template.
Arn *string
// The date and time when the job template was created.
CreatedAt *time.Time
// The user who created the job template.
CreatedBy *string
// The error message in case the decryption of job template fails.
DecryptionError *string
// The ID of the job template.
Id *string
// The KMS key ARN used to encrypt the job template.
KmsKeyArn *string
// The name of the job template.
Name *string
// The tags assigned to the job template.
Tags map[string]string
noSmithyDocumentSerde
}
// The values of StartJobRun API requests used in job runs started using the job
// template.
type JobTemplateData struct {
// The execution role ARN of the job run.
//
// This member is required.
ExecutionRoleArn *string
// Specify the driver that the job runs on. Exactly one of the two available job
// drivers is required, either sparkSqlJobDriver or sparkSubmitJobDriver.
//
// This member is required.
JobDriver *JobDriver
// The release version of Amazon EMR.
//
// This member is required.
ReleaseLabel *string
// The configuration settings that are used to override defaults configuration.
ConfigurationOverrides *ParametricConfigurationOverrides
// The tags assigned to jobs started using the job template.
JobTags map[string]string
// The configuration of parameters existing in the job template.
ParameterConfiguration map[string]TemplateParameterConfiguration
noSmithyDocumentSerde
}
// Configuration setting for monitoring.
type MonitoringConfiguration struct {
// Monitoring configurations for CloudWatch.
CloudWatchMonitoringConfiguration *CloudWatchMonitoringConfiguration
// Enable or disable container log rotation.
ContainerLogRotationConfiguration *ContainerLogRotationConfiguration
// Monitoring configurations for the persistent application UI.
PersistentAppUI PersistentAppUI
// Amazon S3 configuration for monitoring log publishing.
S3MonitoringConfiguration *S3MonitoringConfiguration
noSmithyDocumentSerde
}
// A configuration for CloudWatch monitoring. You can configure your jobs to send
// log information to CloudWatch Logs. This data type allows job template
// parameters to be specified within.
type ParametricCloudWatchMonitoringConfiguration struct {
// The name of the log group for log publishing.
LogGroupName *string
// The specified name prefix for log streams.
LogStreamNamePrefix *string
noSmithyDocumentSerde
}
// A configuration specification to be used to override existing configurations.
// This data type allows job template parameters to be specified within.
type ParametricConfigurationOverrides struct {
// The configurations for the application running by the job run.
ApplicationConfiguration []Configuration
// The configurations for monitoring.
MonitoringConfiguration *ParametricMonitoringConfiguration
noSmithyDocumentSerde
}
// Configuration setting for monitoring. This data type allows job template
// parameters to be specified within.
type ParametricMonitoringConfiguration struct {
// Monitoring configurations for CloudWatch.
CloudWatchMonitoringConfiguration *ParametricCloudWatchMonitoringConfiguration
// Monitoring configurations for the persistent application UI.
PersistentAppUI *string
// Amazon S3 configuration for monitoring log publishing.
S3MonitoringConfiguration *ParametricS3MonitoringConfiguration
noSmithyDocumentSerde
}
// Amazon S3 configuration for monitoring log publishing. You can configure your
// jobs to send log information to Amazon S3. This data type allows job template
// parameters to be specified within.
type ParametricS3MonitoringConfiguration struct {
// Amazon S3 destination URI for log publishing.
LogUri *string
noSmithyDocumentSerde
}
// The configuration of the retry policy that the job runs on.
type RetryPolicyConfiguration struct {
// The maximum number of attempts on the job's driver.
//
// This member is required.
MaxAttempts *int32
noSmithyDocumentSerde
}
// The current status of the retry policy executed on the job.
type RetryPolicyExecution struct {
// The current number of attempts made on the driver of the job.
//
// This member is required.
CurrentAttemptCount *int32
noSmithyDocumentSerde
}
// Amazon S3 configuration for monitoring log publishing. You can configure your
// jobs to send log information to Amazon S3.
type S3MonitoringConfiguration struct {
// Amazon S3 destination URI for log publishing.
//
// This member is required.
LogUri *string
noSmithyDocumentSerde
}
// The job driver for job type.
type SparkSqlJobDriver struct {
// The SQL file to be executed.
EntryPoint *string
// The Spark parameters to be included in the Spark SQL command.
SparkSqlParameters *string
noSmithyDocumentSerde
}
// The information about job driver for Spark submit.
type SparkSubmitJobDriver struct {
// The entry point of job application.
//
// This member is required.
EntryPoint *string
// The arguments for job application.
EntryPointArguments []string
// The Spark submit parameters that are used for job runs.
SparkSubmitParameters *string
noSmithyDocumentSerde
}
// The configuration of a job template parameter.
type TemplateParameterConfiguration struct {
// The default value for the job template parameter.
DefaultValue *string
// The type of the job template parameter. Allowed values are: ‘STRING’, ‘NUMBER’.
Type TemplateParameterDataType
noSmithyDocumentSerde
}
// This entity describes a virtual cluster. A virtual cluster is a Kubernetes
// namespace that Amazon EMR is registered with. Amazon EMR uses virtual clusters
// to run jobs and host endpoints. Multiple virtual clusters can be backed by the
// same physical cluster. However, each virtual cluster maps to one namespace on an
// Amazon EKS cluster. Virtual clusters do not create any active resources that
// contribute to your bill or that require lifecycle management outside the
// service.
type VirtualCluster struct {
// The ARN of the virtual cluster.
Arn *string
// The container provider of the virtual cluster.
ContainerProvider *ContainerProvider
// The date and time when the virtual cluster is created.
CreatedAt *time.Time
// The ID of the virtual cluster.
Id *string
// The name of the virtual cluster.
Name *string
// The state of the virtual cluster.
State VirtualClusterState
// The assigned tags of the virtual cluster.
Tags map[string]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) isContainerInfo() {}
func (*UnknownUnionMember) isCredentials() {}
| 555 |
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/emrcontainers/types"
)
func ExampleContainerInfo_outputUsage() {
var union types.ContainerInfo
// type switches can be used to check the union value
switch v := union.(type) {
case *types.ContainerInfoMemberEksInfo:
_ = v.Value // Value is types.EksInfo
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.EksInfo
func ExampleCredentials_outputUsage() {
var union types.Credentials
// type switches can be used to check the union value
switch v := union.(type) {
case *types.CredentialsMemberToken:
_ = v.Value // Value is string
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *string
| 45 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
import (
"context"
cryptorand "crypto/rand"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyrand "github.com/aws/smithy-go/rand"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "EMR Serverless"
const ServiceAPIVersion = "2021-07-13"
// Client provides the API client to make operations call for EMR Serverless.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
resolveIdempotencyTokenProvider(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// Provides idempotency tokens values that will be automatically populated into
// idempotent API operations.
IdempotencyTokenProvider IdempotencyTokenProvider
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "emrserverless", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func resolveIdempotencyTokenProvider(o *Options) {
if o.IdempotencyTokenProvider != nil {
return
}
o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
// IdempotencyTokenProvider interface for providing idempotency token
type IdempotencyTokenProvider interface {
GetIdempotencyToken() (string, error)
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 454 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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 emrserverless
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"
)
// Cancels a job run.
func (c *Client) CancelJobRun(ctx context.Context, params *CancelJobRunInput, optFns ...func(*Options)) (*CancelJobRunOutput, error) {
if params == nil {
params = &CancelJobRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CancelJobRun", params, optFns, c.addOperationCancelJobRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CancelJobRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type CancelJobRunInput struct {
// The ID of the application on which the job run will be canceled.
//
// This member is required.
ApplicationId *string
// The ID of the job run to cancel.
//
// This member is required.
JobRunId *string
noSmithyDocumentSerde
}
type CancelJobRunOutput struct {
// The output contains the application ID on which the job run is cancelled.
//
// This member is required.
ApplicationId *string
// The output contains the ID of the cancelled job run.
//
// This member is required.
JobRunId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCancelJobRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelJobRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelJobRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCancelJobRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelJobRun(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCancelJobRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-serverless",
OperationName: "CancelJobRun",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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/emrserverless/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an application.
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 client idempotency token of the application to create. Its value must be
// unique for each request.
//
// This member is required.
ClientToken *string
// The Amazon EMR release associated with the application.
//
// This member is required.
ReleaseLabel *string
// The type of application you want to start, such as Spark or Hive.
//
// This member is required.
Type *string
// The CPU architecture of an application.
Architecture types.Architecture
// The configuration for an application to automatically start on job submission.
AutoStartConfiguration *types.AutoStartConfig
// The configuration for an application to automatically stop after a certain
// amount of time being idle.
AutoStopConfiguration *types.AutoStopConfig
// The image configuration for all worker types. You can either set this parameter
// or imageConfiguration for each worker type in workerTypeSpecifications .
ImageConfiguration *types.ImageConfigurationInput
// The capacity to initialize when the application is created.
InitialCapacity map[string]types.InitialCapacityConfig
// The maximum capacity to allocate when the application is created. This is
// cumulative across all workers at any given point in time, not just when an
// application is created. No new resources will be created once any one of the
// defined limits is hit.
MaximumCapacity *types.MaximumAllowedResources
// The name of the application.
Name *string
// The network configuration for customer VPC connectivity.
NetworkConfiguration *types.NetworkConfiguration
// The tags assigned to the application.
Tags map[string]string
// The key-value pairs that specify worker type to WorkerTypeSpecificationInput .
// This parameter must contain all valid worker types for a Spark or Hive
// application. Valid worker types include Driver and Executor for Spark
// applications and HiveDriver and TezTask for Hive applications. You can either
// set image details in this parameter for each worker type, or in
// imageConfiguration for all worker types.
WorkerTypeSpecifications map[string]types.WorkerTypeSpecificationInput
noSmithyDocumentSerde
}
type CreateApplicationOutput struct {
// The output contains the application ID.
//
// This member is required.
ApplicationId *string
// The output contains the ARN of the application.
//
// This member is required.
Arn *string
// The output contains the name of the application.
Name *string
// 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(&awsRestjson1_serializeOpCreateApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_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 = addIdempotencyToken_opCreateApplicationMiddleware(stack, options); 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
}
type idempotencyToken_initializeOpCreateApplication struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateApplication) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateApplicationInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateApplicationMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateApplication{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-serverless",
OperationName: "CreateApplication",
}
}
| 223 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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 application. An application has to be in a stopped or created state
// in order to be deleted.
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 ID of the application that will be deleted.
//
// This member is required.
ApplicationId *string
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(&awsRestjson1_serializeOpDeleteApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_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: "emr-serverless",
OperationName: "DeleteApplication",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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/emrserverless/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Displays detailed information about a specified application.
func (c *Client) GetApplication(ctx context.Context, params *GetApplicationInput, optFns ...func(*Options)) (*GetApplicationOutput, error) {
if params == nil {
params = &GetApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetApplication", params, optFns, c.addOperationGetApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetApplicationInput struct {
// The ID of the application that will be described.
//
// This member is required.
ApplicationId *string
noSmithyDocumentSerde
}
type GetApplicationOutput struct {
// The output displays information about the specified application.
//
// This member is required.
Application *types.Application
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-serverless",
OperationName: "GetApplication",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a URL to access the job run dashboard. The generated URL is valid for
// one hour, after which you must invoke the API again to generate a new URL.
func (c *Client) GetDashboardForJobRun(ctx context.Context, params *GetDashboardForJobRunInput, optFns ...func(*Options)) (*GetDashboardForJobRunOutput, error) {
if params == nil {
params = &GetDashboardForJobRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDashboardForJobRun", params, optFns, c.addOperationGetDashboardForJobRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDashboardForJobRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetDashboardForJobRunInput struct {
// The ID of the application.
//
// This member is required.
ApplicationId *string
// The ID of the job run.
//
// This member is required.
JobRunId *string
noSmithyDocumentSerde
}
type GetDashboardForJobRunOutput struct {
// The URL to view job run's dashboard.
Url *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDashboardForJobRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDashboardForJobRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDashboardForJobRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetDashboardForJobRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDashboardForJobRun(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetDashboardForJobRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-serverless",
OperationName: "GetDashboardForJobRun",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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/emrserverless/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Displays detailed information about a job run.
func (c *Client) GetJobRun(ctx context.Context, params *GetJobRunInput, optFns ...func(*Options)) (*GetJobRunOutput, error) {
if params == nil {
params = &GetJobRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetJobRun", params, optFns, c.addOperationGetJobRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetJobRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetJobRunInput struct {
// The ID of the application on which the job run is submitted.
//
// This member is required.
ApplicationId *string
// The ID of the job run.
//
// This member is required.
JobRunId *string
noSmithyDocumentSerde
}
type GetJobRunOutput struct {
// The output displays information about the job run.
//
// This member is required.
JobRun *types.JobRun
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetJobRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetJobRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetJobRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetJobRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetJobRun(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetJobRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-serverless",
OperationName: "GetJobRun",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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/emrserverless/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists applications based on a set of parameters.
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 {
// The maximum number of applications that can be listed.
MaxResults *int32
// The token for the next set of application results.
NextToken *string
// An optional filter for application states. Note that if this filter contains
// multiple states, the resulting list will be grouped by the state.
States []types.ApplicationState
noSmithyDocumentSerde
}
type ListApplicationsOutput struct {
// The output lists the specified applications.
//
// This member is required.
Applications []types.ApplicationSummary
// The output displays the token for the next set of application results. This is
// required for pagination and is available as a response of the previous request.
NextToken *string
// 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(&awsRestjson1_serializeOpListApplications{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_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
}
// ListApplicationsAPIClient is a client that implements the ListApplications
// operation.
type ListApplicationsAPIClient interface {
ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error)
}
var _ ListApplicationsAPIClient = (*Client)(nil)
// ListApplicationsPaginatorOptions is the paginator options for ListApplications
type ListApplicationsPaginatorOptions struct {
// The maximum number of applications that can be listed.
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
}
// ListApplicationsPaginator is a paginator for ListApplications
type ListApplicationsPaginator struct {
options ListApplicationsPaginatorOptions
client ListApplicationsAPIClient
params *ListApplicationsInput
nextToken *string
firstPage bool
}
// NewListApplicationsPaginator returns a new ListApplicationsPaginator
func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator {
if params == nil {
params = &ListApplicationsInput{}
}
options := ListApplicationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListApplicationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListApplicationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListApplications page.
func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, 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.ListApplications(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_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-serverless",
OperationName: "ListApplications",
}
}
| 224 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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/emrserverless/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Lists job runs based on a set of parameters.
func (c *Client) ListJobRuns(ctx context.Context, params *ListJobRunsInput, optFns ...func(*Options)) (*ListJobRunsOutput, error) {
if params == nil {
params = &ListJobRunsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListJobRuns", params, optFns, c.addOperationListJobRunsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListJobRunsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListJobRunsInput struct {
// The ID of the application for which to list the job run.
//
// This member is required.
ApplicationId *string
// The lower bound of the option to filter by creation date and time.
CreatedAtAfter *time.Time
// The upper bound of the option to filter by creation date and time.
CreatedAtBefore *time.Time
// The maximum number of job runs that can be listed.
MaxResults *int32
// The token for the next set of job run results.
NextToken *string
// An optional filter for job run states. Note that if this filter contains
// multiple states, the resulting list will be grouped by the state.
States []types.JobRunState
noSmithyDocumentSerde
}
type ListJobRunsOutput struct {
// The output lists information about the specified job runs.
//
// This member is required.
JobRuns []types.JobRunSummary
// The output displays the token for the next set of job run results. This is
// required for pagination and is available as a response of the previous request.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListJobRunsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListJobRuns{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListJobRuns{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListJobRunsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListJobRuns(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListJobRunsAPIClient is a client that implements the ListJobRuns operation.
type ListJobRunsAPIClient interface {
ListJobRuns(context.Context, *ListJobRunsInput, ...func(*Options)) (*ListJobRunsOutput, error)
}
var _ ListJobRunsAPIClient = (*Client)(nil)
// ListJobRunsPaginatorOptions is the paginator options for ListJobRuns
type ListJobRunsPaginatorOptions struct {
// The maximum number of job runs that can be listed.
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
}
// ListJobRunsPaginator is a paginator for ListJobRuns
type ListJobRunsPaginator struct {
options ListJobRunsPaginatorOptions
client ListJobRunsAPIClient
params *ListJobRunsInput
nextToken *string
firstPage bool
}
// NewListJobRunsPaginator returns a new ListJobRunsPaginator
func NewListJobRunsPaginator(client ListJobRunsAPIClient, params *ListJobRunsInput, optFns ...func(*ListJobRunsPaginatorOptions)) *ListJobRunsPaginator {
if params == nil {
params = &ListJobRunsInput{}
}
options := ListJobRunsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListJobRunsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListJobRunsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListJobRuns page.
func (p *ListJobRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobRunsOutput, 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.ListJobRuns(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_opListJobRuns(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-serverless",
OperationName: "ListJobRuns",
}
}
| 238 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the tags assigned to the resources.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) that identifies the resource to list the tags
// for. Currently, the supported resources are Amazon EMR Serverless applications
// and job runs.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The tags for the resource.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-serverless",
OperationName: "ListTagsForResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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"
)
// Starts a specified application and initializes initial capacity if configured.
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 {
// The ID of the application to start.
//
// This member is required.
ApplicationId *string
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(&awsRestjson1_serializeOpStartApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_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: "emr-serverless",
OperationName: "StartApplication",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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/emrserverless/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts a job run.
func (c *Client) StartJobRun(ctx context.Context, params *StartJobRunInput, optFns ...func(*Options)) (*StartJobRunOutput, error) {
if params == nil {
params = &StartJobRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartJobRun", params, optFns, c.addOperationStartJobRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartJobRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartJobRunInput struct {
// The ID of the application on which to run the job.
//
// This member is required.
ApplicationId *string
// The client idempotency token of the job run to start. Its value must be unique
// for each request.
//
// This member is required.
ClientToken *string
// The execution role ARN for the job run.
//
// This member is required.
ExecutionRoleArn *string
// The configuration overrides for the job run.
ConfigurationOverrides *types.ConfigurationOverrides
// The maximum duration for the job run to run. If the job run runs beyond this
// duration, it will be automatically cancelled.
ExecutionTimeoutMinutes *int64
// The job driver for the job run.
JobDriver types.JobDriver
// The optional job run name. This doesn't have to be unique.
Name *string
// The tags assigned to the job run.
Tags map[string]string
noSmithyDocumentSerde
}
type StartJobRunOutput struct {
// This output displays the application ID on which the job run was submitted.
//
// This member is required.
ApplicationId *string
// This output displays the ARN of the job run..
//
// This member is required.
Arn *string
// The output contains the ID of the started job run.
//
// This member is required.
JobRunId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartJobRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartJobRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartJobRun{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opStartJobRunMiddleware(stack, options); err != nil {
return err
}
if err = addOpStartJobRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartJobRun(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpStartJobRun struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpStartJobRun) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpStartJobRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*StartJobRunInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *StartJobRunInput ")
}
if input.ClientToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.ClientToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opStartJobRunMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpStartJobRun{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opStartJobRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "emr-serverless",
OperationName: "StartJobRun",
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package emrserverless
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"
)
// Stops a specified application and releases initial capacity if configured. All
// scheduled and running jobs must be completed or cancelled before stopping an
// application.
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 {
// The ID of the application to stop.
//
// This member is required.
ApplicationId *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(&awsRestjson1_serializeOpStopApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_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: "emr-serverless",
OperationName: "StopApplication",
}
}
| 122 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.