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 internal/repotools/cmd/updatemodulemeta DO NOT EDIT. package lookoutvision // goModuleVersion is the tagged release for this module const goModuleVersion = "1.15.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package lookoutvision
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package lookoutvision import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/lookoutvision/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_serializeOpCreateDataset struct { } func (*awsRestjson1_serializeOpCreateDataset) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateDatasetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/datasets") 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_serializeOpHttpBindingsCreateDatasetInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateDatasetInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateDatasetInput(v *CreateDatasetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateDatasetInput(v *CreateDatasetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DatasetSource != nil { ok := object.Key("DatasetSource") if err := awsRestjson1_serializeDocumentDatasetSource(v.DatasetSource, ok); err != nil { return err } } if v.DatasetType != nil { ok := object.Key("DatasetType") ok.String(*v.DatasetType) } return nil } type awsRestjson1_serializeOpCreateModel struct { } func (*awsRestjson1_serializeOpCreateModel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/models") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsCreateModelInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateModelInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateModelInput(v *CreateModelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateModelInput(v *CreateModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.KmsKeyId != nil { ok := object.Key("KmsKeyId") ok.String(*v.KmsKeyId) } if v.OutputConfig != nil { ok := object.Key("OutputConfig") if err := awsRestjson1_serializeDocumentOutputConfig(v.OutputConfig, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateProject struct { } func (*awsRestjson1_serializeOpCreateProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsCreateProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateProjectInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateProjectInput(v *CreateProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } return nil } func awsRestjson1_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ProjectName != nil { ok := object.Key("ProjectName") ok.String(*v.ProjectName) } return nil } type awsRestjson1_serializeOpDeleteDataset struct { } func (*awsRestjson1_serializeOpDeleteDataset) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteDatasetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteDatasetInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteDatasetInput(v *DeleteDatasetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } if v.DatasetType == nil || len(*v.DatasetType) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetType must not be empty")} } if v.DatasetType != nil { if err := encoder.SetURI("DatasetType").String(*v.DatasetType); err != nil { return err } } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteModel struct { } func (*awsRestjson1_serializeOpDeleteModel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/models/{ModelVersion}") 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_serializeOpHttpBindingsDeleteModelInput(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_serializeOpHttpBindingsDeleteModelInput(v *DeleteModelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } if v.ModelVersion == nil || len(*v.ModelVersion) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ModelVersion must not be empty")} } if v.ModelVersion != nil { if err := encoder.SetURI("ModelVersion").String(*v.ModelVersion); err != nil { return err } } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteProject struct { } func (*awsRestjson1_serializeOpDeleteProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(v *DeleteProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeDataset struct { } func (*awsRestjson1_serializeOpDescribeDataset) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeDatasetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}") 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_serializeOpHttpBindingsDescribeDatasetInput(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_serializeOpHttpBindingsDescribeDatasetInput(v *DescribeDatasetInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.DatasetType == nil || len(*v.DatasetType) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetType must not be empty")} } if v.DatasetType != nil { if err := encoder.SetURI("DatasetType").String(*v.DatasetType); err != nil { return err } } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeModel struct { } func (*awsRestjson1_serializeOpDescribeModel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/models/{ModelVersion}") 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_serializeOpHttpBindingsDescribeModelInput(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_serializeOpHttpBindingsDescribeModelInput(v *DescribeModelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ModelVersion == nil || len(*v.ModelVersion) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ModelVersion must not be empty")} } if v.ModelVersion != nil { if err := encoder.SetURI("ModelVersion").String(*v.ModelVersion); err != nil { return err } } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeModelPackagingJob struct { } func (*awsRestjson1_serializeOpDescribeModelPackagingJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeModelPackagingJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeModelPackagingJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/modelpackagingjobs/{JobName}") 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_serializeOpHttpBindingsDescribeModelPackagingJobInput(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_serializeOpHttpBindingsDescribeModelPackagingJobInput(v *DescribeModelPackagingJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.JobName == nil || len(*v.JobName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member JobName must not be empty")} } if v.JobName != nil { if err := encoder.SetURI("JobName").String(*v.JobName); err != nil { return err } } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeProject struct { } func (*awsRestjson1_serializeOpDescribeProject) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeProjectInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDescribeProjectInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDescribeProjectInput(v *DescribeProjectInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpDetectAnomalies struct { } func (*awsRestjson1_serializeOpDetectAnomalies) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDetectAnomalies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DetectAnomaliesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/models/{ModelVersion}/detect") 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_serializeOpHttpBindingsDetectAnomaliesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if !restEncoder.HasHeader("Content-Type") { ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) restEncoder.SetHeader("Content-Type").String("application/octet-stream") } if input.Body != nil { payload := input.Body if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsDetectAnomaliesInput(v *DetectAnomaliesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ContentType != nil && len(*v.ContentType) > 0 { locationName := "Content-Type" encoder.SetHeader(locationName).String(*v.ContentType) } if v.ModelVersion == nil || len(*v.ModelVersion) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ModelVersion must not be empty")} } if v.ModelVersion != nil { if err := encoder.SetURI("ModelVersion").String(*v.ModelVersion); err != nil { return err } } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpListDatasetEntries struct { } func (*awsRestjson1_serializeOpListDatasetEntries) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListDatasetEntries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListDatasetEntriesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}/entries") 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_serializeOpHttpBindingsListDatasetEntriesInput(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_serializeOpHttpBindingsListDatasetEntriesInput(v *ListDatasetEntriesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.AfterCreationDate != nil { encoder.SetQuery("createdAfter").String(smithytime.FormatDateTime(*v.AfterCreationDate)) } if v.AnomalyClass != nil { encoder.SetQuery("anomalyClass").String(*v.AnomalyClass) } if v.BeforeCreationDate != nil { encoder.SetQuery("createdBefore").String(smithytime.FormatDateTime(*v.BeforeCreationDate)) } if v.DatasetType == nil || len(*v.DatasetType) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetType must not be empty")} } if v.DatasetType != nil { if err := encoder.SetURI("DatasetType").String(*v.DatasetType); err != nil { return err } } if v.Labeled != nil { encoder.SetQuery("labeled").Boolean(*v.Labeled) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } if v.SourceRefContains != nil { encoder.SetQuery("sourceRefContains").String(*v.SourceRefContains) } return nil } type awsRestjson1_serializeOpListModelPackagingJobs struct { } func (*awsRestjson1_serializeOpListModelPackagingJobs) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListModelPackagingJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListModelPackagingJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/modelpackagingjobs") 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_serializeOpHttpBindingsListModelPackagingJobsInput(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_serializeOpHttpBindingsListModelPackagingJobsInput(v *ListModelPackagingJobsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpListModels struct { } func (*awsRestjson1_serializeOpListModels) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListModels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListModelsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/models") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListModelsInput(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_serializeOpHttpBindingsListModelsInput(v *ListModelsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } type awsRestjson1_serializeOpListProjects struct { } func (*awsRestjson1_serializeOpListProjects) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListProjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListProjectsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListProjectsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListProjectsInput(v *ListProjectsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } 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("/2020-11-20/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_serializeOpStartModel struct { } func (*awsRestjson1_serializeOpStartModel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/models/{ModelVersion}/start") 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_serializeOpHttpBindingsStartModelInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartModelInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsStartModelInput(v *StartModelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } if v.ModelVersion == nil || len(*v.ModelVersion) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ModelVersion must not be empty")} } if v.ModelVersion != nil { if err := encoder.SetURI("ModelVersion").String(*v.ModelVersion); err != nil { return err } } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentStartModelInput(v *StartModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxInferenceUnits != nil { ok := object.Key("MaxInferenceUnits") ok.Integer(*v.MaxInferenceUnits) } if v.MinInferenceUnits != nil { ok := object.Key("MinInferenceUnits") ok.Integer(*v.MinInferenceUnits) } return nil } type awsRestjson1_serializeOpStartModelPackagingJob struct { } func (*awsRestjson1_serializeOpStartModelPackagingJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartModelPackagingJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartModelPackagingJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/modelpackagingjobs") 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_serializeOpHttpBindingsStartModelPackagingJobInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartModelPackagingJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsStartModelPackagingJobInput(v *StartModelPackagingJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentStartModelPackagingJobInput(v *StartModelPackagingJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Configuration != nil { ok := object.Key("Configuration") if err := awsRestjson1_serializeDocumentModelPackagingConfiguration(v.Configuration, ok); err != nil { return err } } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.JobName != nil { ok := object.Key("JobName") ok.String(*v.JobName) } if v.ModelVersion != nil { ok := object.Key("ModelVersion") ok.String(*v.ModelVersion) } return nil } type awsRestjson1_serializeOpStopModel struct { } func (*awsRestjson1_serializeOpStopModel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/models/{ModelVersion}/stop") 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_serializeOpHttpBindingsStopModelInput(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_serializeOpHttpBindingsStopModelInput(v *StopModelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } if v.ModelVersion == nil || len(*v.ModelVersion) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ModelVersion must not be empty")} } if v.ModelVersion != nil { if err := encoder.SetURI("ModelVersion").String(*v.ModelVersion); err != nil { return err } } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); 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("/2020-11-20/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_serializeDocumentTagList(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("/2020-11-20/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateDatasetEntries struct { } func (*awsRestjson1_serializeOpUpdateDatasetEntries) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateDatasetEntries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateDatasetEntriesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/2020-11-20/projects/{ProjectName}/datasets/{DatasetType}/entries") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateDatasetEntriesInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateDatasetEntriesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateDatasetEntriesInput(v *UpdateDatasetEntriesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClientToken != nil && len(*v.ClientToken) > 0 { locationName := "X-Amzn-Client-Token" encoder.SetHeader(locationName).String(*v.ClientToken) } if v.DatasetType == nil || len(*v.DatasetType) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetType must not be empty")} } if v.DatasetType != nil { if err := encoder.SetURI("DatasetType").String(*v.DatasetType); err != nil { return err } } if v.ProjectName == nil || len(*v.ProjectName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ProjectName must not be empty")} } if v.ProjectName != nil { if err := encoder.SetURI("ProjectName").String(*v.ProjectName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateDatasetEntriesInput(v *UpdateDatasetEntriesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Changes != nil { ok := object.Key("Changes") ok.Base64EncodeBytes(v.Changes) } return nil } func awsRestjson1_serializeDocumentDatasetGroundTruthManifest(v *types.DatasetGroundTruthManifest, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Object != nil { ok := object.Key("S3Object") if err := awsRestjson1_serializeDocumentInputS3Object(v.S3Object, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDatasetSource(v *types.DatasetSource, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.GroundTruthManifest != nil { ok := object.Key("GroundTruthManifest") if err := awsRestjson1_serializeDocumentDatasetGroundTruthManifest(v.GroundTruthManifest, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentGreengrassConfiguration(v *types.GreengrassConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CompilerOptions != nil { ok := object.Key("CompilerOptions") ok.String(*v.CompilerOptions) } if v.ComponentDescription != nil { ok := object.Key("ComponentDescription") ok.String(*v.ComponentDescription) } if v.ComponentName != nil { ok := object.Key("ComponentName") ok.String(*v.ComponentName) } if v.ComponentVersion != nil { ok := object.Key("ComponentVersion") ok.String(*v.ComponentVersion) } if v.S3OutputLocation != nil { ok := object.Key("S3OutputLocation") if err := awsRestjson1_serializeDocumentS3Location(v.S3OutputLocation, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } if len(v.TargetDevice) > 0 { ok := object.Key("TargetDevice") ok.String(string(v.TargetDevice)) } if v.TargetPlatform != nil { ok := object.Key("TargetPlatform") if err := awsRestjson1_serializeDocumentTargetPlatform(v.TargetPlatform, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentInputS3Object(v *types.InputS3Object, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bucket != nil { ok := object.Key("Bucket") ok.String(*v.Bucket) } if v.Key != nil { ok := object.Key("Key") ok.String(*v.Key) } if v.VersionId != nil { ok := object.Key("VersionId") ok.String(*v.VersionId) } return nil } func awsRestjson1_serializeDocumentModelPackagingConfiguration(v *types.ModelPackagingConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Greengrass != nil { ok := object.Key("Greengrass") if err := awsRestjson1_serializeDocumentGreengrassConfiguration(v.Greengrass, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentOutputConfig(v *types.OutputConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Location != nil { ok := object.Key("S3Location") if err := awsRestjson1_serializeDocumentS3Location(v.S3Location, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentS3Location(v *types.S3Location, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bucket != nil { ok := object.Key("Bucket") ok.String(*v.Bucket) } if v.Prefix != nil { ok := object.Key("Prefix") ok.String(*v.Prefix) } return nil } func awsRestjson1_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 awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentTargetPlatform(v *types.TargetPlatform, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Accelerator) > 0 { ok := object.Key("Accelerator") ok.String(string(v.Accelerator)) } if len(v.Arch) > 0 { ok := object.Key("Arch") ok.String(string(v.Arch)) } if len(v.Os) > 0 { ok := object.Key("Os") ok.String(string(v.Os)) } return nil }
1,901
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package lookoutvision import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/lookoutvision/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateDataset struct { } func (*validateOpCreateDataset) ID() string { return "OperationInputValidation" } func (m *validateOpCreateDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateDatasetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateDatasetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateModel struct { } func (*validateOpCreateModel) ID() string { return "OperationInputValidation" } func (m *validateOpCreateModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateModelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateModelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateProject struct { } func (*validateOpCreateProject) ID() string { return "OperationInputValidation" } func (m *validateOpCreateProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateProjectInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateProjectInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteDataset struct { } func (*validateOpDeleteDataset) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteDatasetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteDatasetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteModel struct { } func (*validateOpDeleteModel) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteModelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteModelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteProject struct { } func (*validateOpDeleteProject) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteProjectInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteProjectInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeDataset struct { } func (*validateOpDescribeDataset) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeDataset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeDatasetInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeDatasetInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeModel struct { } func (*validateOpDescribeModel) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeModelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeModelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeModelPackagingJob struct { } func (*validateOpDescribeModelPackagingJob) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeModelPackagingJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeModelPackagingJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeModelPackagingJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeProject struct { } func (*validateOpDescribeProject) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeProjectInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeProjectInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDetectAnomalies struct { } func (*validateOpDetectAnomalies) ID() string { return "OperationInputValidation" } func (m *validateOpDetectAnomalies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DetectAnomaliesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDetectAnomaliesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDatasetEntries struct { } func (*validateOpListDatasetEntries) ID() string { return "OperationInputValidation" } func (m *validateOpListDatasetEntries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDatasetEntriesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDatasetEntriesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListModelPackagingJobs struct { } func (*validateOpListModelPackagingJobs) ID() string { return "OperationInputValidation" } func (m *validateOpListModelPackagingJobs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListModelPackagingJobsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListModelPackagingJobsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListModels struct { } func (*validateOpListModels) ID() string { return "OperationInputValidation" } func (m *validateOpListModels) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListModelsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListModelsInput(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 validateOpStartModel struct { } func (*validateOpStartModel) ID() string { return "OperationInputValidation" } func (m *validateOpStartModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartModelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartModelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartModelPackagingJob struct { } func (*validateOpStartModelPackagingJob) ID() string { return "OperationInputValidation" } func (m *validateOpStartModelPackagingJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartModelPackagingJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartModelPackagingJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopModel struct { } func (*validateOpStopModel) ID() string { return "OperationInputValidation" } func (m *validateOpStopModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopModelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopModelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateDatasetEntries struct { } func (*validateOpUpdateDatasetEntries) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateDatasetEntries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateDatasetEntriesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateDatasetEntriesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateDatasetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataset{}, middleware.After) } func addOpCreateModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateModel{}, middleware.After) } func addOpCreateProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateProject{}, middleware.After) } func addOpDeleteDatasetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDataset{}, middleware.After) } func addOpDeleteModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteModel{}, middleware.After) } func addOpDeleteProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteProject{}, middleware.After) } func addOpDescribeDatasetValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeDataset{}, middleware.After) } func addOpDescribeModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeModel{}, middleware.After) } func addOpDescribeModelPackagingJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeModelPackagingJob{}, middleware.After) } func addOpDescribeProjectValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeProject{}, middleware.After) } func addOpDetectAnomaliesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDetectAnomalies{}, middleware.After) } func addOpListDatasetEntriesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDatasetEntries{}, middleware.After) } func addOpListModelPackagingJobsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListModelPackagingJobs{}, middleware.After) } func addOpListModelsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListModels{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpStartModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartModel{}, middleware.After) } func addOpStartModelPackagingJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartModelPackagingJob{}, middleware.After) } func addOpStopModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopModel{}, 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 addOpUpdateDatasetEntriesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDatasetEntries{}, middleware.After) } func validateDatasetGroundTruthManifest(v *types.DatasetGroundTruthManifest) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DatasetGroundTruthManifest"} if v.S3Object != nil { if err := validateInputS3Object(v.S3Object); err != nil { invalidParams.AddNested("S3Object", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDatasetSource(v *types.DatasetSource) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DatasetSource"} if v.GroundTruthManifest != nil { if err := validateDatasetGroundTruthManifest(v.GroundTruthManifest); err != nil { invalidParams.AddNested("GroundTruthManifest", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateGreengrassConfiguration(v *types.GreengrassConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GreengrassConfiguration"} if v.TargetPlatform != nil { if err := validateTargetPlatform(v.TargetPlatform); err != nil { invalidParams.AddNested("TargetPlatform", err.(smithy.InvalidParamsError)) } } if v.S3OutputLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("S3OutputLocation")) } else if v.S3OutputLocation != nil { if err := validateS3Location(v.S3OutputLocation); err != nil { invalidParams.AddNested("S3OutputLocation", err.(smithy.InvalidParamsError)) } } if v.ComponentName == nil { invalidParams.Add(smithy.NewErrParamRequired("ComponentName")) } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateInputS3Object(v *types.InputS3Object) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "InputS3Object"} if v.Bucket == nil { invalidParams.Add(smithy.NewErrParamRequired("Bucket")) } if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateModelPackagingConfiguration(v *types.ModelPackagingConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ModelPackagingConfiguration"} if v.Greengrass == nil { invalidParams.Add(smithy.NewErrParamRequired("Greengrass")) } else if v.Greengrass != nil { if err := validateGreengrassConfiguration(v.Greengrass); err != nil { invalidParams.AddNested("Greengrass", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOutputConfig(v *types.OutputConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "OutputConfig"} if v.S3Location == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Location")) } else if v.S3Location != nil { if err := validateS3Location(v.S3Location); err != nil { invalidParams.AddNested("S3Location", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3Location(v *types.S3Location) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3Location"} if v.Bucket == nil { invalidParams.Add(smithy.NewErrParamRequired("Bucket")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTag(v *types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Tag"} if v.Key == nil { invalidParams.Add(smithy.NewErrParamRequired("Key")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTagList(v []types.Tag) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagList"} for i := range v { if err := validateTag(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateTargetPlatform(v *types.TargetPlatform) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TargetPlatform"} if len(v.Os) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Os")) } if len(v.Arch) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Arch")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateDatasetInput(v *CreateDatasetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateDatasetInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.DatasetType == nil { invalidParams.Add(smithy.NewErrParamRequired("DatasetType")) } if v.DatasetSource != nil { if err := validateDatasetSource(v.DatasetSource); err != nil { invalidParams.AddNested("DatasetSource", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateModelInput(v *CreateModelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateModelInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.OutputConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("OutputConfig")) } else if v.OutputConfig != nil { if err := validateOutputConfig(v.OutputConfig); err != nil { invalidParams.AddNested("OutputConfig", err.(smithy.InvalidParamsError)) } } if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateProjectInput(v *CreateProjectInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateProjectInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteDatasetInput(v *DeleteDatasetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteDatasetInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.DatasetType == nil { invalidParams.Add(smithy.NewErrParamRequired("DatasetType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteModelInput(v *DeleteModelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteModelInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.ModelVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ModelVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteProjectInput(v *DeleteProjectInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteProjectInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeDatasetInput(v *DescribeDatasetInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeDatasetInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.DatasetType == nil { invalidParams.Add(smithy.NewErrParamRequired("DatasetType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeModelInput(v *DescribeModelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeModelInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.ModelVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ModelVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeModelPackagingJobInput(v *DescribeModelPackagingJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeModelPackagingJobInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.JobName == nil { invalidParams.Add(smithy.NewErrParamRequired("JobName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeProjectInput(v *DescribeProjectInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeProjectInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDetectAnomaliesInput(v *DetectAnomaliesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DetectAnomaliesInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.ModelVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ModelVersion")) } if v.Body == nil { invalidParams.Add(smithy.NewErrParamRequired("Body")) } if v.ContentType == nil { invalidParams.Add(smithy.NewErrParamRequired("ContentType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDatasetEntriesInput(v *ListDatasetEntriesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDatasetEntriesInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.DatasetType == nil { invalidParams.Add(smithy.NewErrParamRequired("DatasetType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListModelPackagingJobsInput(v *ListModelPackagingJobsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListModelPackagingJobsInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListModelsInput(v *ListModelsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListModelsInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } 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 validateOpStartModelInput(v *StartModelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartModelInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.ModelVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ModelVersion")) } if v.MinInferenceUnits == nil { invalidParams.Add(smithy.NewErrParamRequired("MinInferenceUnits")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartModelPackagingJobInput(v *StartModelPackagingJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartModelPackagingJobInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.ModelVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ModelVersion")) } if v.Configuration == nil { invalidParams.Add(smithy.NewErrParamRequired("Configuration")) } else if v.Configuration != nil { if err := validateModelPackagingConfiguration(v.Configuration); err != nil { invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopModelInput(v *StopModelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopModelInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.ModelVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ModelVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } else if v.Tags != nil { if err := validateTagList(v.Tags); err != nil { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateDatasetEntriesInput(v *UpdateDatasetEntriesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateDatasetEntriesInput"} if v.ProjectName == nil { invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) } if v.DatasetType == nil { invalidParams.Add(smithy.NewErrParamRequired("DatasetType")) } if v.Changes == nil { invalidParams.Add(smithy.NewErrParamRequired("Changes")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,103
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 LookoutVision 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: "lookoutvision.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "lookoutvision-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "lookoutvision-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "lookoutvision.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "lookoutvision.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "lookoutvision-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "lookoutvision-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "lookoutvision.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "lookoutvision-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "lookoutvision.{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: "lookoutvision-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "lookoutvision.{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: "lookoutvision-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "lookoutvision.{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: "lookoutvision-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "lookoutvision.{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: "lookoutvision.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "lookoutvision-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "lookoutvision-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "lookoutvision.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
320
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 DatasetStatus string // Enum values for DatasetStatus const ( DatasetStatusCreateInProgress DatasetStatus = "CREATE_IN_PROGRESS" DatasetStatusCreateComplete DatasetStatus = "CREATE_COMPLETE" DatasetStatusCreateFailed DatasetStatus = "CREATE_FAILED" DatasetStatusUpdateInProgress DatasetStatus = "UPDATE_IN_PROGRESS" DatasetStatusUpdateComplete DatasetStatus = "UPDATE_COMPLETE" DatasetStatusUpdateFailedRollbackInProgress DatasetStatus = "UPDATE_FAILED_ROLLBACK_IN_PROGRESS" DatasetStatusUpdateFailedRollbackComplete DatasetStatus = "UPDATE_FAILED_ROLLBACK_COMPLETE" DatasetStatusDeleteInProgress DatasetStatus = "DELETE_IN_PROGRESS" DatasetStatusDeleteComplete DatasetStatus = "DELETE_COMPLETE" DatasetStatusDeleteFailed DatasetStatus = "DELETE_FAILED" ) // Values returns all known values for DatasetStatus. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. func (DatasetStatus) Values() []DatasetStatus { return []DatasetStatus{ "CREATE_IN_PROGRESS", "CREATE_COMPLETE", "CREATE_FAILED", "UPDATE_IN_PROGRESS", "UPDATE_COMPLETE", "UPDATE_FAILED_ROLLBACK_IN_PROGRESS", "UPDATE_FAILED_ROLLBACK_COMPLETE", "DELETE_IN_PROGRESS", "DELETE_COMPLETE", "DELETE_FAILED", } } type ModelHostingStatus string // Enum values for ModelHostingStatus const ( ModelHostingStatusStartingHosting ModelHostingStatus = "STARTING_HOSTING" ModelHostingStatusHosted ModelHostingStatus = "HOSTED" ModelHostingStatusHostingFailed ModelHostingStatus = "HOSTING_FAILED" ModelHostingStatusStoppingHosting ModelHostingStatus = "STOPPING_HOSTING" ModelHostingStatusSystemUpdating ModelHostingStatus = "SYSTEM_UPDATING" ) // Values returns all known values for ModelHostingStatus. 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 (ModelHostingStatus) Values() []ModelHostingStatus { return []ModelHostingStatus{ "STARTING_HOSTING", "HOSTED", "HOSTING_FAILED", "STOPPING_HOSTING", "SYSTEM_UPDATING", } } type ModelPackagingJobStatus string // Enum values for ModelPackagingJobStatus const ( ModelPackagingJobStatusCreated ModelPackagingJobStatus = "CREATED" ModelPackagingJobStatusRunning ModelPackagingJobStatus = "RUNNING" ModelPackagingJobStatusSucceeded ModelPackagingJobStatus = "SUCCEEDED" ModelPackagingJobStatusFailed ModelPackagingJobStatus = "FAILED" ) // Values returns all known values for ModelPackagingJobStatus. 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 (ModelPackagingJobStatus) Values() []ModelPackagingJobStatus { return []ModelPackagingJobStatus{ "CREATED", "RUNNING", "SUCCEEDED", "FAILED", } } type ModelStatus string // Enum values for ModelStatus const ( ModelStatusTraining ModelStatus = "TRAINING" ModelStatusTrained ModelStatus = "TRAINED" ModelStatusTrainingFailed ModelStatus = "TRAINING_FAILED" ModelStatusStartingHosting ModelStatus = "STARTING_HOSTING" ModelStatusHosted ModelStatus = "HOSTED" ModelStatusHostingFailed ModelStatus = "HOSTING_FAILED" ModelStatusStoppingHosting ModelStatus = "STOPPING_HOSTING" ModelStatusSystemUpdating ModelStatus = "SYSTEM_UPDATING" ModelStatusDeleting ModelStatus = "DELETING" ) // Values returns all known values for ModelStatus. 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 (ModelStatus) Values() []ModelStatus { return []ModelStatus{ "TRAINING", "TRAINED", "TRAINING_FAILED", "STARTING_HOSTING", "HOSTED", "HOSTING_FAILED", "STOPPING_HOSTING", "SYSTEM_UPDATING", "DELETING", } } type ResourceType string // Enum values for ResourceType const ( ResourceTypeProject ResourceType = "PROJECT" ResourceTypeDataset ResourceType = "DATASET" ResourceTypeModel ResourceType = "MODEL" ResourceTypeTrial ResourceType = "TRIAL" ResourceTypeModelPackageJob ResourceType = "MODEL_PACKAGE_JOB" ) // Values returns all known values for ResourceType. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. func (ResourceType) Values() []ResourceType { return []ResourceType{ "PROJECT", "DATASET", "MODEL", "TRIAL", "MODEL_PACKAGE_JOB", } } type TargetDevice string // Enum values for TargetDevice const ( TargetDeviceJetsonXavier TargetDevice = "jetson_xavier" ) // Values returns all known values for TargetDevice. 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 (TargetDevice) Values() []TargetDevice { return []TargetDevice{ "jetson_xavier", } } type TargetPlatformAccelerator string // Enum values for TargetPlatformAccelerator const ( TargetPlatformAcceleratorNvidia TargetPlatformAccelerator = "NVIDIA" ) // Values returns all known values for TargetPlatformAccelerator. 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 (TargetPlatformAccelerator) Values() []TargetPlatformAccelerator { return []TargetPlatformAccelerator{ "NVIDIA", } } type TargetPlatformArch string // Enum values for TargetPlatformArch const ( TargetPlatformArchArm64 TargetPlatformArch = "ARM64" TargetPlatformArchX8664 TargetPlatformArch = "X86_64" ) // Values returns all known values for TargetPlatformArch. 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 (TargetPlatformArch) Values() []TargetPlatformArch { return []TargetPlatformArch{ "ARM64", "X86_64", } } type TargetPlatformOs string // Enum values for TargetPlatformOs const ( TargetPlatformOsLinux TargetPlatformOs = "LINUX" ) // Values returns all known values for TargetPlatformOs. 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 (TargetPlatformOs) Values() []TargetPlatformOs { return []TargetPlatformOs{ "LINUX", } }
206
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // You are not authorized to perform the action. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The update or deletion of a resource caused an inconsistent state. type ConflictException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType ResourceType noSmithyDocumentSerde } func (e *ConflictException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConflictException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConflictException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConflictException" } return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Amazon Lookout for Vision experienced a service issue. Try your call again. type InternalServerException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds int32 noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // The resource could not be found. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType ResourceType 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 } // A service quota was exceeded the allowed limit. For more information, see // Limits in Amazon Lookout for Vision in the Amazon Lookout for Vision Developer // Guide. type ServiceQuotaExceededException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType ResourceType QuotaCode *string ServiceCode *string noSmithyDocumentSerde } func (e *ServiceQuotaExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceQuotaExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceQuotaExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceQuotaExceededException" } return *e.ErrorCodeOverride } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Amazon Lookout for Vision is temporarily unable to process the request. Try // your call again. type ThrottlingException struct { Message *string ErrorCodeOverride *string QuotaCode *string ServiceCode *string RetryAfterSeconds int32 noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An input validation error occured. For example, invalid characters in a project // name, or if a pagination token is invalid. 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 }
212
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" ) // Information about an anomaly type found on an image by an image segmentation // model. For more information, see DetectAnomalies . type Anomaly struct { // The name of an anomaly type found in an image. Name maps to an anomaly type in // the training dataset, apart from the anomaly type background . The service // automatically inserts the background anomaly type into the response from // DetectAnomalies . Name *string // Information about the pixel mask that covers an anomaly type. PixelAnomaly *PixelAnomaly noSmithyDocumentSerde } // The description for a dataset. For more information, see DescribeDataset . type DatasetDescription struct { // The Unix timestamp for the time and date that the dataset was created. CreationTimestamp *time.Time // The type of the dataset. The value train represents a training dataset or // single dataset project. The value test represents a test dataset. DatasetType *string // Statistics about the images in a dataset. ImageStats *DatasetImageStats // The Unix timestamp for the date and time that the dataset was last updated. LastUpdatedTimestamp *time.Time // The name of the project that contains the dataset. ProjectName *string // The status of the dataset. Status DatasetStatus // The status message for the dataset. StatusMessage *string noSmithyDocumentSerde } // Location information about a manifest file. You can use a manifest file to // create a dataset. type DatasetGroundTruthManifest struct { // The S3 bucket location for the manifest file. S3Object *InputS3Object noSmithyDocumentSerde } // Statistics about the images in a dataset. type DatasetImageStats struct { // the total number of images labeled as an anomaly. Anomaly *int32 // The total number of labeled images. Labeled *int32 // The total number of images labeled as normal. Normal *int32 // The total number of images in the dataset. Total *int32 noSmithyDocumentSerde } // Summary information for an Amazon Lookout for Vision dataset. For more // information, see DescribeDataset and ProjectDescription . type DatasetMetadata struct { // The Unix timestamp for the date and time that the dataset was created. CreationTimestamp *time.Time // The type of the dataset. DatasetType *string // The status for the dataset. Status DatasetStatus // The status message for the dataset. StatusMessage *string noSmithyDocumentSerde } // Information about the location of a manifest file that Amazon Lookout for // Vision uses to to create a dataset. type DatasetSource struct { // Location information for the manifest file. GroundTruthManifest *DatasetGroundTruthManifest noSmithyDocumentSerde } // The prediction results from a call to DetectAnomalies . DetectAnomalyResult // includes classification information for the prediction ( IsAnomalous and // Confidence ). If the model you use is an image segementation model, // DetectAnomalyResult also includes segmentation information ( Anomalies and // AnomalyMask ). Classification information is calculated separately from // segmentation information and you shouldn't assume a relationship between them. type DetectAnomalyResult struct { // If the model is an image segmentation model, Anomalies contains a list of // anomaly types found in the image. There is one entry for each type of anomaly // found (even if multiple instances of an anomaly type exist on the image). The // first element in the list is always an anomaly type representing the image // background ('background') and shouldn't be considered an anomaly. Amazon Lookout // for Vision automatically add the background anomaly type to the response, and // you don't need to declare a background anomaly type in your dataset. If the list // has one entry ('background'), no anomalies were found on the image. An image // classification model doesn't return an Anomalies list. Anomalies []Anomaly // If the model is an image segmentation model, AnomalyMask contains pixel masks // that covers all anomaly types found on the image. Each anomaly type has a // different mask color. To map a color to an anomaly type, see the color field of // the PixelAnomaly object. An image classification model doesn't return an // Anomalies list. AnomalyMask []byte // The confidence that Lookout for Vision has in the accuracy of the // classification in IsAnomalous . Confidence *float32 // True if Amazon Lookout for Vision classifies the image as containing an // anomaly, otherwise false. IsAnomalous bool // The source of the image that was analyzed. direct means that the images was // supplied from the local computer. No other values are supported. Source *ImageSource noSmithyDocumentSerde } // Configuration information for the AWS IoT Greengrass component created in a // model packaging job. For more information, see StartModelPackagingJob . You // can't specify a component with the same ComponentName and Componentversion as // an existing component with the same component name and component version. type GreengrassConfiguration struct { // A name for the AWS IoT Greengrass component. // // This member is required. ComponentName *string // An S3 location in which Lookout for Vision stores the component artifacts. // // This member is required. S3OutputLocation *S3Location // Additional compiler options for the Greengrass component. Currently, only // NVIDIA Graphics Processing Units (GPU) and CPU accelerators are supported. If // you specify TargetDevice , don't specify CompilerOptions . For more information, // see Compiler options in the Amazon Lookout for Vision Developer Guide. CompilerOptions *string // A description for the AWS IoT Greengrass component. ComponentDescription *string // A Version for the AWS IoT Greengrass component. If you don't provide a value, a // default value of Model Version.0.0 is used. ComponentVersion *string // A set of tags (key-value pairs) that you want to attach to the AWS IoT // Greengrass component. Tags []Tag // The target device for the model. Currently the only supported value is // jetson_xavier . If you specify TargetDevice , you can't specify TargetPlatform . TargetDevice TargetDevice // The target platform for the model. If you specify TargetPlatform , you can't // specify TargetDevice . TargetPlatform *TargetPlatform noSmithyDocumentSerde } // Information about the AWS IoT Greengrass component created by a model packaging // job. type GreengrassOutputDetails struct { // The name of the component. ComponentName *string // The version of the component. ComponentVersion *string // The Amazon Resource Name (ARN) of the component. ComponentVersionArn *string noSmithyDocumentSerde } // The source for an image. type ImageSource struct { // The type of the image. Type *string noSmithyDocumentSerde } // Amazon S3 Location information for an input manifest file. type InputS3Object struct { // The Amazon S3 bucket that contains the manifest. // // This member is required. Bucket *string // The name and location of the manifest file withiin the bucket. // // This member is required. Key *string // The version ID of the bucket. VersionId *string noSmithyDocumentSerde } // Describes an Amazon Lookout for Vision model. type ModelDescription struct { // The unix timestamp for the date and time that the model was created. CreationTimestamp *time.Time // The description for the model. Description *string // The unix timestamp for the date and time that the evaluation ended. EvaluationEndTimestamp *time.Time // The S3 location where Amazon Lookout for Vision saves the manifest file that // was used to test the trained model and generate the performance scores. EvaluationManifest *OutputS3Object // The S3 location where Amazon Lookout for Vision saves the performance metrics. EvaluationResult *OutputS3Object // The identifer for the AWS Key Management Service (AWS KMS) key that was used to // encrypt the model during training. KmsKeyId *string // The maximum number of inference units Amazon Lookout for Vision uses to // auto-scale the model. For more information, see StartModel . MaxInferenceUnits *int32 // The minimum number of inference units used by the model. For more information, // see StartModel MinInferenceUnits *int32 // The Amazon Resource Name (ARN) of the model. ModelArn *string // The version of the model ModelVersion *string // The S3 location where Amazon Lookout for Vision saves model training files. OutputConfig *OutputConfig // Performance metrics for the model. Created during training. Performance *ModelPerformance // The status of the model. Status ModelStatus // The status message for the model. StatusMessage *string noSmithyDocumentSerde } // Describes an Amazon Lookout for Vision model. type ModelMetadata struct { // The unix timestamp for the date and time that the model was created. CreationTimestamp *time.Time // The description for the model. Description *string // The Amazon Resource Name (ARN) of the model. ModelArn *string // The version of the model. ModelVersion *string // Performance metrics for the model. Not available until training has // successfully completed. Performance *ModelPerformance // The status of the model. Status ModelStatus // The status message for the model. StatusMessage *string noSmithyDocumentSerde } // Configuration information for a Amazon Lookout for Vision model packaging job. // For more information, see StartModelPackagingJob . type ModelPackagingConfiguration struct { // Configuration information for the AWS IoT Greengrass component in a model // packaging job. // // This member is required. Greengrass *GreengrassConfiguration noSmithyDocumentSerde } // Information about a model packaging job. For more information, see // DescribeModelPackagingJob . type ModelPackagingDescription struct { // The Unix timestamp for the time and date that the model packaging job was // created. CreationTimestamp *time.Time // The name of the model packaging job. JobName *string // The Unix timestamp for the time and date that the model packaging job was last // updated. LastUpdatedTimestamp *time.Time // The configuration information used in the model packaging job. ModelPackagingConfiguration *ModelPackagingConfiguration // The description for the model packaging job. ModelPackagingJobDescription *string // The AWS service used to package the job. Currently Lookout for Vision can // package jobs with AWS IoT Greengrass. ModelPackagingMethod *string // Information about the output of the model packaging job. For more information, // see DescribeModelPackagingJob . ModelPackagingOutputDetails *ModelPackagingOutputDetails // The version of the model used in the model packaging job. ModelVersion *string // The name of the project that's associated with a model that's in the model // package. ProjectName *string // The status of the model packaging job. Status ModelPackagingJobStatus // The status message for the model packaging job. StatusMessage *string noSmithyDocumentSerde } // Metadata for a model packaging job. For more information, see // ListModelPackagingJobs . type ModelPackagingJobMetadata struct { // The Unix timestamp for the time and date that the model packaging job was // created. CreationTimestamp *time.Time // The name of the model packaging job. JobName *string // The Unix timestamp for the time and date that the model packaging job was last // updated. LastUpdatedTimestamp *time.Time // The description for the model packaging job. ModelPackagingJobDescription *string // The AWS service used to package the job. Currently Lookout for Vision can // package jobs with AWS IoT Greengrass. ModelPackagingMethod *string // The version of the model that is in the model package. ModelVersion *string // The project that contains the model that is in the model package. ProjectName *string // The status of the model packaging job. Status ModelPackagingJobStatus // The status message for the model packaging job. StatusMessage *string noSmithyDocumentSerde } // Information about the output from a model packaging job. type ModelPackagingOutputDetails struct { // Information about the AWS IoT Greengrass component in a model packaging job. Greengrass *GreengrassOutputDetails noSmithyDocumentSerde } // Information about the evaluation performance of a trained model. type ModelPerformance struct { // The overall F1 score metric for the trained model. F1Score *float32 // The overall precision metric value for the trained model. Precision *float32 // The overall recall metric value for the trained model. Recall *float32 noSmithyDocumentSerde } // The S3 location where Amazon Lookout for Vision saves model training files. type OutputConfig struct { // The S3 location for the output. // // This member is required. S3Location *S3Location noSmithyDocumentSerde } // The S3 location where Amazon Lookout for Vision saves training output. type OutputS3Object struct { // The bucket that contains the training output. // // This member is required. Bucket *string // The location of the training output in the bucket. // // This member is required. Key *string noSmithyDocumentSerde } // Information about the pixels in an anomaly mask. For more information, see // Anomaly . PixelAnomaly is only returned by image segmentation models. type PixelAnomaly struct { // A hex color value for the mask that covers an anomaly type. Each anomaly type // has a different mask color. The color maps to the color of the anomaly type used // in the training dataset. Color *string // The percentage area of the image that the anomaly type covers. TotalPercentageArea *float32 noSmithyDocumentSerde } // Describe an Amazon Lookout for Vision project. For more information, see // DescribeProject . type ProjectDescription struct { // The unix timestamp for the date and time that the project was created. CreationTimestamp *time.Time // A list of datasets in the project. Datasets []DatasetMetadata // The Amazon Resource Name (ARN) of the project. ProjectArn *string // The name of the project. ProjectName *string noSmithyDocumentSerde } // Metadata about an Amazon Lookout for Vision project. type ProjectMetadata struct { // The unix timestamp for the date and time that the project was created. CreationTimestamp *time.Time // The Amazon Resource Name (ARN) of the project. ProjectArn *string // The name of the project. ProjectName *string noSmithyDocumentSerde } // Information about the location of training output or the output of a model // packaging job. type S3Location struct { // The S3 bucket that contains the training or model packaging job output. If you // are training a model, the bucket must in your AWS account. If you use an S3 // bucket for a model packaging job, the S3 bucket must be in the same AWS Region // and AWS account in which you use AWS IoT Greengrass. // // This member is required. Bucket *string // The path of the folder, within the S3 bucket, that contains the output. Prefix *string noSmithyDocumentSerde } // A key and value pair that is attached to the specified Amazon Lookout for // Vision model. type Tag struct { // The key of the tag that is attached to the specified model. // // This member is required. Key *string // The value of the tag that is attached to the specified model. // // This member is required. Value *string noSmithyDocumentSerde } // The platform on which a model runs on an AWS IoT Greengrass core device. type TargetPlatform struct { // The target architecture for the model. The currently supported architectures // are X86_64 (64-bit version of the x86 instruction set) and ARM_64 (ARMv8 64-bit // CPU). // // This member is required. Arch TargetPlatformArch // The target operating system for the model. Linux is the only operating system // that is currently supported. // // This member is required. Os TargetPlatformOs // The target accelerator for the model. Currently, Amazon Lookout for Vision only // supports NVIDIA (Nvidia graphics processing unit) and CPU accelerators. If you // specify NVIDIA as an accelerator, you must also specify the gpu-code , trt-ver , // and cuda-ver compiler options. If you don't specify an accelerator, Lookout for // Vision uses the CPU for compilation and we highly recommend that you use the // GreengrassConfiguration$CompilerOptions field. For example, you can use the // following compiler options for CPU: // - mcpu : CPU micro-architecture. For example, {'mcpu': 'skylake-avx512'} // - mattr : CPU flags. For example, {'mattr': ['+neon', '+vfpv4']} Accelerator TargetPlatformAccelerator noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
581
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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 = "m2" const ServiceAPIVersion = "2021-04-28" // Client provides the API client to make operations call for // AWSMainframeModernization. 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, "m2", 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 m2 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 m2 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 the running of a specific batch job execution. func (c *Client) CancelBatchJobExecution(ctx context.Context, params *CancelBatchJobExecutionInput, optFns ...func(*Options)) (*CancelBatchJobExecutionOutput, error) { if params == nil { params = &CancelBatchJobExecutionInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelBatchJobExecution", params, optFns, c.addOperationCancelBatchJobExecutionMiddlewares) if err != nil { return nil, err } out := result.(*CancelBatchJobExecutionOutput) out.ResultMetadata = metadata return out, nil } type CancelBatchJobExecutionInput struct { // The unique identifier of the application. // // This member is required. ApplicationId *string // The unique identifier of the batch job execution. // // This member is required. ExecutionId *string noSmithyDocumentSerde } type CancelBatchJobExecutionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelBatchJobExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelBatchJobExecution{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelBatchJobExecution{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCancelBatchJobExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelBatchJobExecution(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCancelBatchJobExecution(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "CancelBatchJobExecution", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new application with given parameters. Requires an existing runtime // environment and application definition file. 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 application definition for this application. You can specify either inline // JSON or an S3 bucket location. // // This member is required. Definition types.Definition // The type of the target platform for this application. // // This member is required. EngineType types.EngineType // The unique identifier of the application. // // This member is required. Name *string // Unique, case-sensitive identifier the service generates to ensure the // idempotency of the request to create an application. The service generates the // clientToken when the API call is triggered. The token expires after one hour, so // if you retry the API within this timeframe with the same clientToken, you will // get the same response. The service also handles deleting the clientToken after // it expires. ClientToken *string // The description of the application. Description *string // The identifier of a customer managed key. KmsKeyId *string // The Amazon Resource Name (ARN) of the role associated with the application. RoleArn *string // A list of tags to apply to the application. Tags map[string]string noSmithyDocumentSerde } type CreateApplicationOutput struct { // The Amazon Resource Name (ARN) of the application. // // This member is required. ApplicationArn *string // The unique application identifier. // // This member is required. ApplicationId *string // The version number of the application. // // This member is required. ApplicationVersion *int32 // 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: "m2", OperationName: "CreateApplication", } }
206
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts a data set import task for a specific application. func (c *Client) CreateDataSetImportTask(ctx context.Context, params *CreateDataSetImportTaskInput, optFns ...func(*Options)) (*CreateDataSetImportTaskOutput, error) { if params == nil { params = &CreateDataSetImportTaskInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDataSetImportTask", params, optFns, c.addOperationCreateDataSetImportTaskMiddlewares) if err != nil { return nil, err } out := result.(*CreateDataSetImportTaskOutput) out.ResultMetadata = metadata return out, nil } type CreateDataSetImportTaskInput struct { // The unique identifier of the application for which you want to import data sets. // // This member is required. ApplicationId *string // The data set import task configuration. // // This member is required. ImportConfig types.DataSetImportConfig // Unique, case-sensitive identifier you provide to ensure the idempotency of the // request to create a data set import. The service generates the clientToken when // the API call is triggered. The token expires after one hour, so if you retry the // API within this timeframe with the same clientToken, you will get the same // response. The service also handles deleting the clientToken after it expires. ClientToken *string noSmithyDocumentSerde } type CreateDataSetImportTaskOutput struct { // The task identifier. This operation is asynchronous. Use this identifier with // the GetDataSetImportTask operation to obtain the status of this task. // // This member is required. TaskId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDataSetImportTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDataSetImportTask{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDataSetImportTask{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateDataSetImportTaskMiddleware(stack, options); err != nil { return err } if err = addOpCreateDataSetImportTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataSetImportTask(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateDataSetImportTask struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateDataSetImportTask) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateDataSetImportTask) 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.(*CreateDataSetImportTaskInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDataSetImportTaskInput ") } 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_opCreateDataSetImportTaskMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDataSetImportTask{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateDataSetImportTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "CreateDataSetImportTask", } }
177
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates and starts a deployment to deploy an application into a runtime // environment. func (c *Client) CreateDeployment(ctx context.Context, params *CreateDeploymentInput, optFns ...func(*Options)) (*CreateDeploymentOutput, error) { if params == nil { params = &CreateDeploymentInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDeployment", params, optFns, c.addOperationCreateDeploymentMiddlewares) if err != nil { return nil, err } out := result.(*CreateDeploymentOutput) out.ResultMetadata = metadata return out, nil } type CreateDeploymentInput struct { // The application identifier. // // This member is required. ApplicationId *string // The version of the application to deploy. // // This member is required. ApplicationVersion *int32 // The identifier of the runtime environment where you want to deploy this // application. // // This member is required. EnvironmentId *string // Unique, case-sensitive identifier you provide to ensure the idempotency of the // request to create a deployment. The service generates the clientToken when the // API call is triggered. The token expires after one hour, so if you retry the API // within this timeframe with the same clientToken, you will get the same response. // The service also handles deleting the clientToken after it expires. ClientToken *string noSmithyDocumentSerde } type CreateDeploymentOutput struct { // The unique identifier of the deployment. // // This member is required. DeploymentId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDeployment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDeployment{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateDeploymentMiddleware(stack, options); err != nil { return err } if err = addOpCreateDeploymentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDeployment(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateDeployment struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateDeployment) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateDeployment) 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.(*CreateDeploymentInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDeploymentInput ") } 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_opCreateDeploymentMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDeployment{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateDeployment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "CreateDeployment", } }
182
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a runtime environment for a given runtime engine. func (c *Client) CreateEnvironment(ctx context.Context, params *CreateEnvironmentInput, optFns ...func(*Options)) (*CreateEnvironmentOutput, error) { if params == nil { params = &CreateEnvironmentInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateEnvironment", params, optFns, c.addOperationCreateEnvironmentMiddlewares) if err != nil { return nil, err } out := result.(*CreateEnvironmentOutput) out.ResultMetadata = metadata return out, nil } type CreateEnvironmentInput struct { // The engine type for the runtime environment. // // This member is required. EngineType types.EngineType // The type of instance for the runtime environment. // // This member is required. InstanceType *string // The name of the runtime environment. Must be unique within the account. // // This member is required. Name *string // Unique, case-sensitive identifier you provide to ensure the idempotency of the // request to create an environment. The service generates the clientToken when the // API call is triggered. The token expires after one hour, so if you retry the API // within this timeframe with the same clientToken, you will get the same response. // The service also handles deleting the clientToken after it expires. ClientToken *string // The description of the runtime environment. Description *string // The version of the engine type for the runtime environment. EngineVersion *string // The details of a high availability configuration for this runtime environment. HighAvailabilityConfig *types.HighAvailabilityConfig // The identifier of a customer managed key. KmsKeyId *string // Configures the maintenance window you want for the runtime environment. If you // do not provide a value, a random system-generated value will be assigned. PreferredMaintenanceWindow *string // Specifies whether the runtime environment is publicly accessible. PubliclyAccessible bool // The list of security groups for the VPC associated with this runtime // environment. SecurityGroupIds []string // Optional. The storage configurations for this runtime environment. StorageConfigurations []types.StorageConfiguration // The list of subnets associated with the VPC for this runtime environment. SubnetIds []string // The tags for the runtime environment. Tags map[string]string noSmithyDocumentSerde } type CreateEnvironmentOutput struct { // The unique identifier of the runtime environment. // // This member is required. EnvironmentId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateEnvironment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateEnvironment{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateEnvironmentMiddleware(stack, options); err != nil { return err } if err = addOpCreateEnvironmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEnvironment(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateEnvironment struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateEnvironment) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateEnvironment) 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.(*CreateEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateEnvironmentInput ") } 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_opCreateEnvironmentMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateEnvironment{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "CreateEnvironment", } }
213
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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 specific application. You cannot delete a running application. func (c *Client) DeleteApplication(ctx context.Context, params *DeleteApplicationInput, optFns ...func(*Options)) (*DeleteApplicationOutput, error) { if params == nil { params = &DeleteApplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteApplication", params, optFns, c.addOperationDeleteApplicationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteApplicationOutput) out.ResultMetadata = metadata return out, nil } type DeleteApplicationInput struct { // The unique identifier of the application you want to delete. // // 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: "m2", OperationName: "DeleteApplication", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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 specific application from the specific runtime environment where it // was previously deployed. You cannot delete a runtime environment using // DeleteEnvironment if any application has ever been deployed to it. This API // removes the association of the application with the runtime environment so you // can delete the environment smoothly. func (c *Client) DeleteApplicationFromEnvironment(ctx context.Context, params *DeleteApplicationFromEnvironmentInput, optFns ...func(*Options)) (*DeleteApplicationFromEnvironmentOutput, error) { if params == nil { params = &DeleteApplicationFromEnvironmentInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteApplicationFromEnvironment", params, optFns, c.addOperationDeleteApplicationFromEnvironmentMiddlewares) if err != nil { return nil, err } out := result.(*DeleteApplicationFromEnvironmentOutput) out.ResultMetadata = metadata return out, nil } type DeleteApplicationFromEnvironmentInput struct { // The unique identifier of the application you want to delete. // // This member is required. ApplicationId *string // The unique identifier of the runtime environment where the application was // previously deployed. // // This member is required. EnvironmentId *string noSmithyDocumentSerde } type DeleteApplicationFromEnvironmentOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteApplicationFromEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteApplicationFromEnvironment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteApplicationFromEnvironment{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteApplicationFromEnvironmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplicationFromEnvironment(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteApplicationFromEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "DeleteApplicationFromEnvironment", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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 specific runtime environment. The environment cannot contain deployed // applications. If it does, you must delete those applications before you delete // the environment. func (c *Client) DeleteEnvironment(ctx context.Context, params *DeleteEnvironmentInput, optFns ...func(*Options)) (*DeleteEnvironmentOutput, error) { if params == nil { params = &DeleteEnvironmentInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteEnvironment", params, optFns, c.addOperationDeleteEnvironmentMiddlewares) if err != nil { return nil, err } out := result.(*DeleteEnvironmentOutput) out.ResultMetadata = metadata return out, nil } type DeleteEnvironmentInput struct { // The unique identifier of the runtime environment you want to delete. // // This member is required. EnvironmentId *string noSmithyDocumentSerde } type DeleteEnvironmentOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteEnvironment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteEnvironment{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteEnvironmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEnvironment(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "DeleteEnvironment", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Describes the details of a specific 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 identifier of the application. // // This member is required. ApplicationId *string noSmithyDocumentSerde } type GetApplicationOutput struct { // The Amazon Resource Name (ARN) of the application. // // This member is required. ApplicationArn *string // The identifier of the application. // // This member is required. ApplicationId *string // The timestamp when this application was created. // // This member is required. CreationTime *time.Time // The type of the target platform for the application. // // This member is required. EngineType types.EngineType // The latest version of the application. // // This member is required. LatestVersion *types.ApplicationVersionSummary // The unique identifier of the application. // // This member is required. Name *string // The status of the application. // // This member is required. Status types.ApplicationLifecycle // The version of the application that is deployed. DeployedVersion *types.DeployedVersionSummary // The description of the application. Description *string // The identifier of the runtime environment where you want to deploy the // application. EnvironmentId *string // The identifier of a customer managed key. KmsKeyId *string // The timestamp when you last started the application. Null until the application // runs for the first time. LastStartTime *time.Time // The Amazon Resource Name (ARN) for the network load balancer listener created // in your Amazon Web Services account. Amazon Web Services Mainframe Modernization // creates this listener for you the first time you deploy an application. ListenerArns []string // The port associated with the network load balancer listener created in your // Amazon Web Services account. ListenerPorts []int32 // The public DNS name of the load balancer created in your Amazon Web Services // account. LoadBalancerDnsName *string // The list of log summaries. Each log summary includes the log type as well as // the log group identifier. These are CloudWatch logs. Amazon Web Services // Mainframe Modernization pushes the application log to CloudWatch under the // customer's account. LogGroups []types.LogGroupSummary // The Amazon Resource Name (ARN) of the role associated with the application. RoleArn *string // The reason for the reported status. StatusReason *string // A list of tags associated with the application. Tags map[string]string // Returns the Amazon Resource Names (ARNs) of the target groups that are attached // to the network load balancer. TargetGroupArns []string // 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: "m2", OperationName: "GetApplication", } }
207
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns details about a specific version of a specific application. func (c *Client) GetApplicationVersion(ctx context.Context, params *GetApplicationVersionInput, optFns ...func(*Options)) (*GetApplicationVersionOutput, error) { if params == nil { params = &GetApplicationVersionInput{} } result, metadata, err := c.invokeOperation(ctx, "GetApplicationVersion", params, optFns, c.addOperationGetApplicationVersionMiddlewares) if err != nil { return nil, err } out := result.(*GetApplicationVersionOutput) out.ResultMetadata = metadata return out, nil } type GetApplicationVersionInput struct { // The unique identifier of the application. // // This member is required. ApplicationId *string // The specific version of the application. // // This member is required. ApplicationVersion *int32 noSmithyDocumentSerde } type GetApplicationVersionOutput struct { // The specific version of the application. // // This member is required. ApplicationVersion *int32 // The timestamp when the application version was created. // // This member is required. CreationTime *time.Time // The content of the application definition. This is a JSON object that contains // the resource configuration and definitions that identify an application. // // This member is required. DefinitionContent *string // The name of the application version. // // This member is required. Name *string // The status of the application version. // // This member is required. Status types.ApplicationVersionLifecycle // The application description. Description *string // The reason for the reported status. StatusReason *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetApplicationVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetApplicationVersion{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetApplicationVersion{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetApplicationVersionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetApplicationVersion(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetApplicationVersion(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "GetApplicationVersion", } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets the details of a specific batch job execution for a specific application. func (c *Client) GetBatchJobExecution(ctx context.Context, params *GetBatchJobExecutionInput, optFns ...func(*Options)) (*GetBatchJobExecutionOutput, error) { if params == nil { params = &GetBatchJobExecutionInput{} } result, metadata, err := c.invokeOperation(ctx, "GetBatchJobExecution", params, optFns, c.addOperationGetBatchJobExecutionMiddlewares) if err != nil { return nil, err } out := result.(*GetBatchJobExecutionOutput) out.ResultMetadata = metadata return out, nil } type GetBatchJobExecutionInput struct { // The identifier of the application. // // This member is required. ApplicationId *string // The unique identifier of the batch job execution. // // This member is required. ExecutionId *string noSmithyDocumentSerde } type GetBatchJobExecutionOutput struct { // The identifier of the application. // // This member is required. ApplicationId *string // The unique identifier for this batch job execution. // // This member is required. ExecutionId *string // The timestamp when the batch job execution started. // // This member is required. StartTime *time.Time // The status of the batch job execution. // // This member is required. Status types.BatchJobExecutionStatus // The unique identifier of this batch job. BatchJobIdentifier types.BatchJobIdentifier // The timestamp when the batch job execution ended. EndTime *time.Time // The unique identifier for this batch job. JobId *string // The name of this batch job. JobName *string // The type of job. JobType types.BatchJobType // The user for the job. JobUser *string // The batch job return code from either the Blu Age or Micro Focus runtime // engines. For more information, see Batch return codes (https://www.ibm.com/docs/en/was/8.5.5?topic=model-batch-return-codes) // in the IBM WebSphere Application Server documentation. ReturnCode *string // The reason for the reported status. StatusReason *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetBatchJobExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBatchJobExecution{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBatchJobExecution{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetBatchJobExecutionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBatchJobExecution(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetBatchJobExecution(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "GetBatchJobExecution", } }
174
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets the details of a specific data set. func (c *Client) GetDataSetDetails(ctx context.Context, params *GetDataSetDetailsInput, optFns ...func(*Options)) (*GetDataSetDetailsOutput, error) { if params == nil { params = &GetDataSetDetailsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetDataSetDetails", params, optFns, c.addOperationGetDataSetDetailsMiddlewares) if err != nil { return nil, err } out := result.(*GetDataSetDetailsOutput) out.ResultMetadata = metadata return out, nil } type GetDataSetDetailsInput struct { // The unique identifier of the application that this data set is associated with. // // This member is required. ApplicationId *string // The name of the data set. // // This member is required. DataSetName *string noSmithyDocumentSerde } type GetDataSetDetailsOutput struct { // The name of the data set. // // This member is required. DataSetName *string // The size of the block on disk. Blocksize *int32 // The timestamp when the data set was created. CreationTime *time.Time // The type of data set. The only supported value is VSAM. DataSetOrg types.DatasetDetailOrgAttributes // The last time the data set was referenced. LastReferencedTime *time.Time // The last time the data set was updated. LastUpdatedTime *time.Time // The location where the data set is stored. Location *string // The length of records in the data set. RecordLength *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetDataSetDetailsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDataSetDetails{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDataSetDetails{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetDataSetDetailsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataSetDetails(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetDataSetDetails(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "GetDataSetDetails", } }
154
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the status of a data set import task initiated with the // CreateDataSetImportTask operation. func (c *Client) GetDataSetImportTask(ctx context.Context, params *GetDataSetImportTaskInput, optFns ...func(*Options)) (*GetDataSetImportTaskOutput, error) { if params == nil { params = &GetDataSetImportTaskInput{} } result, metadata, err := c.invokeOperation(ctx, "GetDataSetImportTask", params, optFns, c.addOperationGetDataSetImportTaskMiddlewares) if err != nil { return nil, err } out := result.(*GetDataSetImportTaskOutput) out.ResultMetadata = metadata return out, nil } type GetDataSetImportTaskInput struct { // The application identifier. // // This member is required. ApplicationId *string // The task identifier returned by the CreateDataSetImportTask operation. // // This member is required. TaskId *string noSmithyDocumentSerde } type GetDataSetImportTaskOutput struct { // The status of the task. // // This member is required. Status types.DataSetTaskLifecycle // The task identifier. // // This member is required. TaskId *string // A summary of the status of the task. Summary *types.DataSetImportSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetDataSetImportTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDataSetImportTask{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDataSetImportTask{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetDataSetImportTaskValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataSetImportTask(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetDataSetImportTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "GetDataSetImportTask", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets details of a specific deployment with a given deployment identifier. func (c *Client) GetDeployment(ctx context.Context, params *GetDeploymentInput, optFns ...func(*Options)) (*GetDeploymentOutput, error) { if params == nil { params = &GetDeploymentInput{} } result, metadata, err := c.invokeOperation(ctx, "GetDeployment", params, optFns, c.addOperationGetDeploymentMiddlewares) if err != nil { return nil, err } out := result.(*GetDeploymentOutput) out.ResultMetadata = metadata return out, nil } type GetDeploymentInput struct { // The unique identifier of the application. // // This member is required. ApplicationId *string // The unique identifier for the deployment. // // This member is required. DeploymentId *string noSmithyDocumentSerde } type GetDeploymentOutput struct { // The unique identifier of the application. // // This member is required. ApplicationId *string // The application version. // // This member is required. ApplicationVersion *int32 // The timestamp when the deployment was created. // // This member is required. CreationTime *time.Time // The unique identifier of the deployment. // // This member is required. DeploymentId *string // The unique identifier of the runtime environment. // // This member is required. EnvironmentId *string // The status of the deployment. // // This member is required. Status types.DeploymentLifecycle // The reason for the reported status. StatusReason *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDeployment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDeployment{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetDeploymentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeployment(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetDeployment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "GetDeployment", } }
161
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Describes a specific runtime environment. func (c *Client) GetEnvironment(ctx context.Context, params *GetEnvironmentInput, optFns ...func(*Options)) (*GetEnvironmentOutput, error) { if params == nil { params = &GetEnvironmentInput{} } result, metadata, err := c.invokeOperation(ctx, "GetEnvironment", params, optFns, c.addOperationGetEnvironmentMiddlewares) if err != nil { return nil, err } out := result.(*GetEnvironmentOutput) out.ResultMetadata = metadata return out, nil } type GetEnvironmentInput struct { // The unique identifier of the runtime environment. // // This member is required. EnvironmentId *string noSmithyDocumentSerde } type GetEnvironmentOutput struct { // The timestamp when the runtime environment was created. // // This member is required. CreationTime *time.Time // The target platform for the runtime environment. // // This member is required. EngineType types.EngineType // The version of the runtime engine. // // This member is required. EngineVersion *string // The Amazon Resource Name (ARN) of the runtime environment. // // This member is required. EnvironmentArn *string // The unique identifier of the runtime environment. // // This member is required. EnvironmentId *string // The type of instance underlying the runtime environment. // // This member is required. InstanceType *string // The name of the runtime environment. Must be unique within the account. // // This member is required. Name *string // The unique identifiers of the security groups assigned to this runtime // environment. // // This member is required. SecurityGroupIds []string // The status of the runtime environment. // // This member is required. Status types.EnvironmentLifecycle // The unique identifiers of the subnets assigned to this runtime environment. // // This member is required. SubnetIds []string // The unique identifier for the VPC used with this runtime environment. // // This member is required. VpcId *string // The number of instances included in the runtime environment. A standalone // runtime environment has a maxiumum of one instance. Currently, a high // availability runtime environment has a maximum of two instances. ActualCapacity *int32 // The description of the runtime environment. Description *string // The desired capacity of the high availability configuration for the runtime // environment. HighAvailabilityConfig *types.HighAvailabilityConfig // The identifier of a customer managed key. KmsKeyId *string // The Amazon Resource Name (ARN) for the load balancer used with the runtime // environment. LoadBalancerArn *string // Indicates the pending maintenance scheduled on this environment. PendingMaintenance *types.PendingMaintenance // Configures the maintenance window you want for the runtime environment. If you // do not provide a value, a random system-generated value will be assigned. PreferredMaintenanceWindow *string // Whether applications running in this runtime environment are publicly // accessible. PubliclyAccessible bool // The reason for the reported status. StatusReason *string // The storage configurations defined for the runtime environment. StorageConfigurations []types.StorageConfiguration // The tags defined for this runtime environment. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEnvironment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEnvironment{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetEnvironmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEnvironment(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "GetEnvironment", } }
218
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the applications associated with a specific Amazon Web Services account. // You can provide the unique identifier of a specific runtime environment in a // query parameter to see all applications associated with that environment. 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 unique identifier of the runtime environment where the applications are // deployed. EnvironmentId *string // The maximum number of applications to return. MaxResults *int32 // The names of the applications. Names []string // A pagination token to control the number of applications displayed in the list. NextToken *string noSmithyDocumentSerde } type ListApplicationsOutput struct { // Returns a list of summary details for all the applications in a runtime // environment. // // This member is required. Applications []types.ApplicationSummary // A pagination token that's returned when the response doesn't contain all // applications. 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 to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // 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, &params, 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: "m2", OperationName: "ListApplications", } }
230
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the application versions for a specific application. func (c *Client) ListApplicationVersions(ctx context.Context, params *ListApplicationVersionsInput, optFns ...func(*Options)) (*ListApplicationVersionsOutput, error) { if params == nil { params = &ListApplicationVersionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListApplicationVersions", params, optFns, c.addOperationListApplicationVersionsMiddlewares) if err != nil { return nil, err } out := result.(*ListApplicationVersionsOutput) out.ResultMetadata = metadata return out, nil } type ListApplicationVersionsInput struct { // The unique identifier of the application. // // This member is required. ApplicationId *string // The maximum number of application versions to return. MaxResults *int32 // A pagination token returned from a previous call to this operation. This // specifies the next item to return. To return to the beginning of the list, // exclude this parameter. NextToken *string noSmithyDocumentSerde } type ListApplicationVersionsOutput struct { // The list of application versions. // // This member is required. ApplicationVersions []types.ApplicationVersionSummary // If there are more items to return, this contains a token that is passed to a // subsequent call to this operation to retrieve the next set of items. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListApplicationVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListApplicationVersions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApplicationVersions{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListApplicationVersionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApplicationVersions(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListApplicationVersionsAPIClient is a client that implements the // ListApplicationVersions operation. type ListApplicationVersionsAPIClient interface { ListApplicationVersions(context.Context, *ListApplicationVersionsInput, ...func(*Options)) (*ListApplicationVersionsOutput, error) } var _ ListApplicationVersionsAPIClient = (*Client)(nil) // ListApplicationVersionsPaginatorOptions is the paginator options for // ListApplicationVersions type ListApplicationVersionsPaginatorOptions struct { // The maximum number of application versions to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListApplicationVersionsPaginator is a paginator for ListApplicationVersions type ListApplicationVersionsPaginator struct { options ListApplicationVersionsPaginatorOptions client ListApplicationVersionsAPIClient params *ListApplicationVersionsInput nextToken *string firstPage bool } // NewListApplicationVersionsPaginator returns a new // ListApplicationVersionsPaginator func NewListApplicationVersionsPaginator(client ListApplicationVersionsAPIClient, params *ListApplicationVersionsInput, optFns ...func(*ListApplicationVersionsPaginatorOptions)) *ListApplicationVersionsPaginator { if params == nil { params = &ListApplicationVersionsInput{} } options := ListApplicationVersionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListApplicationVersionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListApplicationVersionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListApplicationVersions page. func (p *ListApplicationVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationVersionsOutput, 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.ListApplicationVersions(ctx, &params, 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_opListApplicationVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "ListApplicationVersions", } }
232
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all the available batch job definitions based on the batch job resources // uploaded during the application creation. You can use the batch job definitions // in the list to start a batch job. func (c *Client) ListBatchJobDefinitions(ctx context.Context, params *ListBatchJobDefinitionsInput, optFns ...func(*Options)) (*ListBatchJobDefinitionsOutput, error) { if params == nil { params = &ListBatchJobDefinitionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListBatchJobDefinitions", params, optFns, c.addOperationListBatchJobDefinitionsMiddlewares) if err != nil { return nil, err } out := result.(*ListBatchJobDefinitionsOutput) out.ResultMetadata = metadata return out, nil } type ListBatchJobDefinitionsInput struct { // The identifier of the application. // // This member is required. ApplicationId *string // The maximum number of batch job definitions to return. MaxResults *int32 // A pagination token returned from a previous call to this operation. This // specifies the next item to return. To return to the beginning of the list, // exclude this parameter. NextToken *string // If the batch job definition is a FileBatchJobDefinition, the prefix allows you // to search on the file names of FileBatchJobDefinitions. Prefix *string noSmithyDocumentSerde } type ListBatchJobDefinitionsOutput struct { // The list of batch job definitions. // // This member is required. BatchJobDefinitions []types.BatchJobDefinition // If there are more items to return, this contains a token that is passed to a // subsequent call to this operation to retrieve the next set of items. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListBatchJobDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListBatchJobDefinitions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBatchJobDefinitions{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListBatchJobDefinitionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBatchJobDefinitions(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListBatchJobDefinitionsAPIClient is a client that implements the // ListBatchJobDefinitions operation. type ListBatchJobDefinitionsAPIClient interface { ListBatchJobDefinitions(context.Context, *ListBatchJobDefinitionsInput, ...func(*Options)) (*ListBatchJobDefinitionsOutput, error) } var _ ListBatchJobDefinitionsAPIClient = (*Client)(nil) // ListBatchJobDefinitionsPaginatorOptions is the paginator options for // ListBatchJobDefinitions type ListBatchJobDefinitionsPaginatorOptions struct { // The maximum number of batch job definitions to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListBatchJobDefinitionsPaginator is a paginator for ListBatchJobDefinitions type ListBatchJobDefinitionsPaginator struct { options ListBatchJobDefinitionsPaginatorOptions client ListBatchJobDefinitionsAPIClient params *ListBatchJobDefinitionsInput nextToken *string firstPage bool } // NewListBatchJobDefinitionsPaginator returns a new // ListBatchJobDefinitionsPaginator func NewListBatchJobDefinitionsPaginator(client ListBatchJobDefinitionsAPIClient, params *ListBatchJobDefinitionsInput, optFns ...func(*ListBatchJobDefinitionsPaginatorOptions)) *ListBatchJobDefinitionsPaginator { if params == nil { params = &ListBatchJobDefinitionsInput{} } options := ListBatchJobDefinitionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListBatchJobDefinitionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListBatchJobDefinitionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListBatchJobDefinitions page. func (p *ListBatchJobDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBatchJobDefinitionsOutput, 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.ListBatchJobDefinitions(ctx, &params, 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_opListBatchJobDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "ListBatchJobDefinitions", } }
238
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Lists historical, current, and scheduled batch job executions for a specific // application. func (c *Client) ListBatchJobExecutions(ctx context.Context, params *ListBatchJobExecutionsInput, optFns ...func(*Options)) (*ListBatchJobExecutionsOutput, error) { if params == nil { params = &ListBatchJobExecutionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListBatchJobExecutions", params, optFns, c.addOperationListBatchJobExecutionsMiddlewares) if err != nil { return nil, err } out := result.(*ListBatchJobExecutionsOutput) out.ResultMetadata = metadata return out, nil } type ListBatchJobExecutionsInput struct { // The unique identifier of the application. // // This member is required. ApplicationId *string // The unique identifier of each batch job execution. ExecutionIds []string // The name of each batch job execution. JobName *string // The maximum number of batch job executions to return. MaxResults *int32 // A pagination token to control the number of batch job executions displayed in // the list. NextToken *string // The time after which the batch job executions started. StartedAfter *time.Time // The time before the batch job executions started. StartedBefore *time.Time // The status of the batch job executions. Status types.BatchJobExecutionStatus noSmithyDocumentSerde } type ListBatchJobExecutionsOutput struct { // Returns a list of batch job executions for an application. // // This member is required. BatchJobExecutions []types.BatchJobExecutionSummary // A pagination token that's returned when the response doesn't contain all batch // job executions. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListBatchJobExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListBatchJobExecutions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBatchJobExecutions{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListBatchJobExecutionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBatchJobExecutions(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListBatchJobExecutionsAPIClient is a client that implements the // ListBatchJobExecutions operation. type ListBatchJobExecutionsAPIClient interface { ListBatchJobExecutions(context.Context, *ListBatchJobExecutionsInput, ...func(*Options)) (*ListBatchJobExecutionsOutput, error) } var _ ListBatchJobExecutionsAPIClient = (*Client)(nil) // ListBatchJobExecutionsPaginatorOptions is the paginator options for // ListBatchJobExecutions type ListBatchJobExecutionsPaginatorOptions struct { // The maximum number of batch job executions to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListBatchJobExecutionsPaginator is a paginator for ListBatchJobExecutions type ListBatchJobExecutionsPaginator struct { options ListBatchJobExecutionsPaginatorOptions client ListBatchJobExecutionsAPIClient params *ListBatchJobExecutionsInput nextToken *string firstPage bool } // NewListBatchJobExecutionsPaginator returns a new ListBatchJobExecutionsPaginator func NewListBatchJobExecutionsPaginator(client ListBatchJobExecutionsAPIClient, params *ListBatchJobExecutionsInput, optFns ...func(*ListBatchJobExecutionsPaginatorOptions)) *ListBatchJobExecutionsPaginator { if params == nil { params = &ListBatchJobExecutionsInput{} } options := ListBatchJobExecutionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListBatchJobExecutionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListBatchJobExecutionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListBatchJobExecutions page. func (p *ListBatchJobExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBatchJobExecutionsOutput, 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.ListBatchJobExecutions(ctx, &params, 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_opListBatchJobExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "ListBatchJobExecutions", } }
247
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the data set imports for the specified application. func (c *Client) ListDataSetImportHistory(ctx context.Context, params *ListDataSetImportHistoryInput, optFns ...func(*Options)) (*ListDataSetImportHistoryOutput, error) { if params == nil { params = &ListDataSetImportHistoryInput{} } result, metadata, err := c.invokeOperation(ctx, "ListDataSetImportHistory", params, optFns, c.addOperationListDataSetImportHistoryMiddlewares) if err != nil { return nil, err } out := result.(*ListDataSetImportHistoryOutput) out.ResultMetadata = metadata return out, nil } type ListDataSetImportHistoryInput struct { // The unique identifier of the application. // // This member is required. ApplicationId *string // The maximum number of objects to return. MaxResults *int32 // A pagination token returned from a previous call to this operation. This // specifies the next item to return. To return to the beginning of the list, // exclude this parameter. NextToken *string noSmithyDocumentSerde } type ListDataSetImportHistoryOutput struct { // The data set import tasks. // // This member is required. DataSetImportTasks []types.DataSetImportTask // If there are more items to return, this contains a token that is passed to a // subsequent call to this operation to retrieve the next set of items. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListDataSetImportHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListDataSetImportHistory{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDataSetImportHistory{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListDataSetImportHistoryValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDataSetImportHistory(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListDataSetImportHistoryAPIClient is a client that implements the // ListDataSetImportHistory operation. type ListDataSetImportHistoryAPIClient interface { ListDataSetImportHistory(context.Context, *ListDataSetImportHistoryInput, ...func(*Options)) (*ListDataSetImportHistoryOutput, error) } var _ ListDataSetImportHistoryAPIClient = (*Client)(nil) // ListDataSetImportHistoryPaginatorOptions is the paginator options for // ListDataSetImportHistory type ListDataSetImportHistoryPaginatorOptions struct { // The maximum number of objects to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListDataSetImportHistoryPaginator is a paginator for ListDataSetImportHistory type ListDataSetImportHistoryPaginator struct { options ListDataSetImportHistoryPaginatorOptions client ListDataSetImportHistoryAPIClient params *ListDataSetImportHistoryInput nextToken *string firstPage bool } // NewListDataSetImportHistoryPaginator returns a new // ListDataSetImportHistoryPaginator func NewListDataSetImportHistoryPaginator(client ListDataSetImportHistoryAPIClient, params *ListDataSetImportHistoryInput, optFns ...func(*ListDataSetImportHistoryPaginatorOptions)) *ListDataSetImportHistoryPaginator { if params == nil { params = &ListDataSetImportHistoryInput{} } options := ListDataSetImportHistoryPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListDataSetImportHistoryPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDataSetImportHistoryPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDataSetImportHistory page. func (p *ListDataSetImportHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSetImportHistoryOutput, 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.ListDataSetImportHistory(ctx, &params, 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_opListDataSetImportHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "ListDataSetImportHistory", } }
232
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the data sets imported for a specific application. In Amazon Web Services // Mainframe Modernization, data sets are associated with applications deployed on // runtime environments. This is known as importing data sets. Currently, Amazon // Web Services Mainframe Modernization can import data sets into catalogs using // CreateDataSetImportTask (https://docs.aws.amazon.com/m2/latest/APIReference/API_CreateDataSetImportTask.html) // . func (c *Client) ListDataSets(ctx context.Context, params *ListDataSetsInput, optFns ...func(*Options)) (*ListDataSetsOutput, error) { if params == nil { params = &ListDataSetsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListDataSets", params, optFns, c.addOperationListDataSetsMiddlewares) if err != nil { return nil, err } out := result.(*ListDataSetsOutput) out.ResultMetadata = metadata return out, nil } type ListDataSetsInput struct { // The unique identifier of the application for which you want to list the // associated data sets. // // This member is required. ApplicationId *string // The maximum number of objects to return. MaxResults *int32 // A pagination token returned from a previous call to this operation. This // specifies the next item to return. To return to the beginning of the list, // exclude this parameter. NextToken *string // The prefix of the data set name, which you can use to filter the list of data // sets. Prefix *string noSmithyDocumentSerde } type ListDataSetsOutput struct { // The list of data sets, containing information including the creation time, the // data set name, the data set organization, the data set format, and the last time // the data set was referenced or updated. // // This member is required. DataSets []types.DataSetSummary // If there are more items to return, this contains a token that is passed to a // subsequent call to this operation to retrieve the next set of items. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListDataSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListDataSets{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDataSets{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListDataSetsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDataSets(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListDataSetsAPIClient is a client that implements the ListDataSets operation. type ListDataSetsAPIClient interface { ListDataSets(context.Context, *ListDataSetsInput, ...func(*Options)) (*ListDataSetsOutput, error) } var _ ListDataSetsAPIClient = (*Client)(nil) // ListDataSetsPaginatorOptions is the paginator options for ListDataSets type ListDataSetsPaginatorOptions struct { // The maximum number of objects to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListDataSetsPaginator is a paginator for ListDataSets type ListDataSetsPaginator struct { options ListDataSetsPaginatorOptions client ListDataSetsAPIClient params *ListDataSetsInput nextToken *string firstPage bool } // NewListDataSetsPaginator returns a new ListDataSetsPaginator func NewListDataSetsPaginator(client ListDataSetsAPIClient, params *ListDataSetsInput, optFns ...func(*ListDataSetsPaginatorOptions)) *ListDataSetsPaginator { if params == nil { params = &ListDataSetsInput{} } options := ListDataSetsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListDataSetsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDataSetsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDataSets page. func (p *ListDataSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSetsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListDataSets(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListDataSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "ListDataSets", } }
241
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all deployments of a specific application. A deployment is a // combination of a specific application and a specific version of that // application. Each deployment is mapped to a particular application version. func (c *Client) ListDeployments(ctx context.Context, params *ListDeploymentsInput, optFns ...func(*Options)) (*ListDeploymentsOutput, error) { if params == nil { params = &ListDeploymentsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListDeployments", params, optFns, c.addOperationListDeploymentsMiddlewares) if err != nil { return nil, err } out := result.(*ListDeploymentsOutput) out.ResultMetadata = metadata return out, nil } type ListDeploymentsInput struct { // The application identifier. // // This member is required. ApplicationId *string // The maximum number of objects to return. MaxResults *int32 // A pagination token returned from a previous call to this operation. This // specifies the next item to return. To return to the beginning of the list, // exclude this parameter. NextToken *string noSmithyDocumentSerde } type ListDeploymentsOutput struct { // The list of deployments that is returned. // // This member is required. Deployments []types.DeploymentSummary // If there are more items to return, this contains a token that is passed to a // subsequent call to this operation to retrieve the next set of items. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListDeploymentsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListDeployments{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDeployments{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListDeploymentsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDeployments(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListDeploymentsAPIClient is a client that implements the ListDeployments // operation. type ListDeploymentsAPIClient interface { ListDeployments(context.Context, *ListDeploymentsInput, ...func(*Options)) (*ListDeploymentsOutput, error) } var _ ListDeploymentsAPIClient = (*Client)(nil) // ListDeploymentsPaginatorOptions is the paginator options for ListDeployments type ListDeploymentsPaginatorOptions struct { // The maximum number of objects to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListDeploymentsPaginator is a paginator for ListDeployments type ListDeploymentsPaginator struct { options ListDeploymentsPaginatorOptions client ListDeploymentsAPIClient params *ListDeploymentsInput nextToken *string firstPage bool } // NewListDeploymentsPaginator returns a new ListDeploymentsPaginator func NewListDeploymentsPaginator(client ListDeploymentsAPIClient, params *ListDeploymentsInput, optFns ...func(*ListDeploymentsPaginatorOptions)) *ListDeploymentsPaginator { if params == nil { params = &ListDeploymentsInput{} } options := ListDeploymentsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListDeploymentsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListDeploymentsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListDeployments page. func (p *ListDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentsOutput, 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.ListDeployments(ctx, &params, 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_opListDeployments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "ListDeployments", } }
232
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the available engine versions. func (c *Client) ListEngineVersions(ctx context.Context, params *ListEngineVersionsInput, optFns ...func(*Options)) (*ListEngineVersionsOutput, error) { if params == nil { params = &ListEngineVersionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListEngineVersions", params, optFns, c.addOperationListEngineVersionsMiddlewares) if err != nil { return nil, err } out := result.(*ListEngineVersionsOutput) out.ResultMetadata = metadata return out, nil } type ListEngineVersionsInput struct { // The type of target platform. EngineType types.EngineType // The maximum number of objects to return. MaxResults *int32 // A pagination token returned from a previous call to this operation. This // specifies the next item to return. To return to the beginning of the list, // exclude this parameter. NextToken *string noSmithyDocumentSerde } type ListEngineVersionsOutput struct { // Returns the engine versions. // // This member is required. EngineVersions []types.EngineVersionsSummary // If there are more items to return, this contains a token that is passed to a // subsequent call to this operation to retrieve the next set of items. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListEngineVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListEngineVersions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEngineVersions{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListEngineVersions(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListEngineVersionsAPIClient is a client that implements the ListEngineVersions // operation. type ListEngineVersionsAPIClient interface { ListEngineVersions(context.Context, *ListEngineVersionsInput, ...func(*Options)) (*ListEngineVersionsOutput, error) } var _ ListEngineVersionsAPIClient = (*Client)(nil) // ListEngineVersionsPaginatorOptions is the paginator options for // ListEngineVersions type ListEngineVersionsPaginatorOptions struct { // The maximum number of objects to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListEngineVersionsPaginator is a paginator for ListEngineVersions type ListEngineVersionsPaginator struct { options ListEngineVersionsPaginatorOptions client ListEngineVersionsAPIClient params *ListEngineVersionsInput nextToken *string firstPage bool } // NewListEngineVersionsPaginator returns a new ListEngineVersionsPaginator func NewListEngineVersionsPaginator(client ListEngineVersionsAPIClient, params *ListEngineVersionsInput, optFns ...func(*ListEngineVersionsPaginatorOptions)) *ListEngineVersionsPaginator { if params == nil { params = &ListEngineVersionsInput{} } options := ListEngineVersionsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListEngineVersionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListEngineVersionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListEngineVersions page. func (p *ListEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEngineVersionsOutput, 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.ListEngineVersions(ctx, &params, 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_opListEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "ListEngineVersions", } }
226
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the runtime environments. func (c *Client) ListEnvironments(ctx context.Context, params *ListEnvironmentsInput, optFns ...func(*Options)) (*ListEnvironmentsOutput, error) { if params == nil { params = &ListEnvironmentsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListEnvironments", params, optFns, c.addOperationListEnvironmentsMiddlewares) if err != nil { return nil, err } out := result.(*ListEnvironmentsOutput) out.ResultMetadata = metadata return out, nil } type ListEnvironmentsInput struct { // The engine type for the runtime environment. EngineType types.EngineType // The maximum number of runtime environments to return. MaxResults *int32 // The names of the runtime environments. Must be unique within the account. Names []string // A pagination token to control the number of runtime environments displayed in // the list. NextToken *string noSmithyDocumentSerde } type ListEnvironmentsOutput struct { // Returns a list of summary details for all the runtime environments in your // account. // // This member is required. Environments []types.EnvironmentSummary // A pagination token that's returned when the response doesn't contain all the // runtime environments. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListEnvironmentsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListEnvironments{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEnvironments{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListEnvironments(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListEnvironmentsAPIClient is a client that implements the ListEnvironments // operation. type ListEnvironmentsAPIClient interface { ListEnvironments(context.Context, *ListEnvironmentsInput, ...func(*Options)) (*ListEnvironmentsOutput, error) } var _ ListEnvironmentsAPIClient = (*Client)(nil) // ListEnvironmentsPaginatorOptions is the paginator options for ListEnvironments type ListEnvironmentsPaginatorOptions struct { // The maximum number of runtime environments to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListEnvironmentsPaginator is a paginator for ListEnvironments type ListEnvironmentsPaginator struct { options ListEnvironmentsPaginatorOptions client ListEnvironmentsAPIClient params *ListEnvironmentsInput nextToken *string firstPage bool } // NewListEnvironmentsPaginator returns a new ListEnvironmentsPaginator func NewListEnvironmentsPaginator(client ListEnvironmentsAPIClient, params *ListEnvironmentsInput, optFns ...func(*ListEnvironmentsPaginatorOptions)) *ListEnvironmentsPaginator { if params == nil { params = &ListEnvironmentsInput{} } options := ListEnvironmentsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListEnvironmentsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListEnvironmentsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListEnvironments page. func (p *ListEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnvironmentsOutput, 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.ListEnvironments(ctx, &params, 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_opListEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "ListEnvironments", } }
228
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the tags for the specified resource. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // The Amazon Resource Name (ARN) of the resource. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The tags for the resource. // // This member is required. 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: "m2", OperationName: "ListTagsForResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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 an application that is currently stopped. 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 unique identifier of the application you want 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: "m2", OperationName: "StartApplication", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts a batch job and returns the unique identifier of this execution of the // batch job. The associated application must be running in order to start the // batch job. func (c *Client) StartBatchJob(ctx context.Context, params *StartBatchJobInput, optFns ...func(*Options)) (*StartBatchJobOutput, error) { if params == nil { params = &StartBatchJobInput{} } result, metadata, err := c.invokeOperation(ctx, "StartBatchJob", params, optFns, c.addOperationStartBatchJobMiddlewares) if err != nil { return nil, err } out := result.(*StartBatchJobOutput) out.ResultMetadata = metadata return out, nil } type StartBatchJobInput struct { // The unique identifier of the application associated with this batch job. // // This member is required. ApplicationId *string // The unique identifier of the batch job. // // This member is required. BatchJobIdentifier types.BatchJobIdentifier // The collection of batch job parameters. For details about limits for keys and // values, see Coding variables in JCL (https://www.ibm.com/docs/en/workload-automation/9.3.0?topic=zos-coding-variables-in-jcl) // . JobParams map[string]string noSmithyDocumentSerde } type StartBatchJobOutput struct { // The unique identifier of this execution of the batch job. // // This member is required. ExecutionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartBatchJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartBatchJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartBatchJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartBatchJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartBatchJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartBatchJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "StartBatchJob", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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 running 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 unique identifier of the application you want to stop. // // This member is required. ApplicationId *string // Stopping an application process can take a long time. Setting this parameter to // true lets you force stop the application so you don't need to wait until the // process finishes to apply another action on the application. The default value // is false. ForceStop bool 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: "m2", OperationName: "StopApplication", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds one or more tags to the specified resource. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // The Amazon Resource Name (ARN) of the resource. // // This member is required. ResourceArn *string // The tags to add to the resource. // // This member is required. Tags map[string]string noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "TagResource", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes one or more tags from the specified resource. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // The Amazon Resource Name (ARN) of the resource. // // This member is required. ResourceArn *string // The keys of the tags to remove. // // 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: "m2", OperationName: "UntagResource", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an application and creates a new version. func (c *Client) UpdateApplication(ctx context.Context, params *UpdateApplicationInput, optFns ...func(*Options)) (*UpdateApplicationOutput, error) { if params == nil { params = &UpdateApplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateApplication", params, optFns, c.addOperationUpdateApplicationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateApplicationOutput) out.ResultMetadata = metadata return out, nil } type UpdateApplicationInput struct { // The unique identifier of the application you want to update. // // This member is required. ApplicationId *string // The current version of the application to update. // // This member is required. CurrentApplicationVersion *int32 // The application definition for this application. You can specify either inline // JSON or an S3 bucket location. Definition types.Definition // The description of the application to update. Description *string noSmithyDocumentSerde } type UpdateApplicationOutput struct { // The new version of the application. // // This member is required. ApplicationVersion *int32 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApplication{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateApplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApplication(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opUpdateApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "UpdateApplication", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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 the configuration details for a specific runtime environment. func (c *Client) UpdateEnvironment(ctx context.Context, params *UpdateEnvironmentInput, optFns ...func(*Options)) (*UpdateEnvironmentOutput, error) { if params == nil { params = &UpdateEnvironmentInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateEnvironment", params, optFns, c.addOperationUpdateEnvironmentMiddlewares) if err != nil { return nil, err } out := result.(*UpdateEnvironmentOutput) out.ResultMetadata = metadata return out, nil } type UpdateEnvironmentInput struct { // The unique identifier of the runtime environment that you want to update. // // This member is required. EnvironmentId *string // Indicates whether to update the runtime environment during the maintenance // window. The default is false. Currently, Amazon Web Services Mainframe // Modernization accepts the engineVersion parameter only if // applyDuringMaintenanceWindow is true. If any parameter other than engineVersion // is provided in UpdateEnvironmentRequest , it will fail if // applyDuringMaintenanceWindow is set to true. ApplyDuringMaintenanceWindow bool // The desired capacity for the runtime environment to update. DesiredCapacity *int32 // The version of the runtime engine for the runtime environment. EngineVersion *string // The instance type for the runtime environment to update. InstanceType *string // Configures the maintenance window you want for the runtime environment. If you // do not provide a value, a random system-generated value will be assigned. PreferredMaintenanceWindow *string noSmithyDocumentSerde } type UpdateEnvironmentOutput struct { // The unique identifier of the runtime environment that was updated. // // This member is required. EnvironmentId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEnvironment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEnvironment{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateEnvironmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEnvironment(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "m2", OperationName: "UpdateEnvironment", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/m2/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" "strconv" "strings" ) type awsRestjson1_deserializeOpCancelBatchJobExecution struct { } func (*awsRestjson1_deserializeOpCancelBatchJobExecution) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCancelBatchJobExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCancelBatchJobExecution(response, &metadata) } output := &CancelBatchJobExecutionOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorCancelBatchJobExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpCreateApplication struct { } func (*awsRestjson1_deserializeOpCreateApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateApplication(response, &metadata) } output := &CreateApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateApplicationOutput(&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_deserializeOpErrorCreateApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateApplicationOutput(v **CreateApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateApplicationOutput if *v == nil { sv = &CreateApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ApplicationArn = ptr.String(jtv) } case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "applicationVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Version to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationVersion = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateDataSetImportTask struct { } func (*awsRestjson1_deserializeOpCreateDataSetImportTask) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateDataSetImportTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateDataSetImportTask(response, &metadata) } output := &CreateDataSetImportTaskOutput{} 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_deserializeOpDocumentCreateDataSetImportTaskOutput(&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_deserializeOpErrorCreateDataSetImportTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateDataSetImportTaskOutput(v **CreateDataSetImportTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDataSetImportTaskOutput if *v == nil { sv = &CreateDataSetImportTaskOutput{} } else { sv = *v } for key, value := range shape { switch key { case "taskId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.TaskId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateDeployment struct { } func (*awsRestjson1_deserializeOpCreateDeployment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateDeployment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateDeployment(response, &metadata) } output := &CreateDeploymentOutput{} 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_deserializeOpDocumentCreateDeploymentOutput(&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_deserializeOpErrorCreateDeployment(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateDeploymentOutput(v **CreateDeploymentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDeploymentOutput if *v == nil { sv = &CreateDeploymentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "deploymentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.DeploymentId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateEnvironment struct { } func (*awsRestjson1_deserializeOpCreateEnvironment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateEnvironment(response, &metadata) } output := &CreateEnvironmentOutput{} 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_deserializeOpDocumentCreateEnvironmentOutput(&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_deserializeOpErrorCreateEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateEnvironmentOutput(v **CreateEnvironmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateEnvironmentOutput if *v == nil { sv = &CreateEnvironmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "environmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.EnvironmentId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteApplication struct { } func (*awsRestjson1_deserializeOpDeleteApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteApplication(response, &metadata) } output := &DeleteApplicationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteApplicationFromEnvironment struct { } func (*awsRestjson1_deserializeOpDeleteApplicationFromEnvironment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteApplicationFromEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteApplicationFromEnvironment(response, &metadata) } output := &DeleteApplicationFromEnvironmentOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteApplicationFromEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteEnvironment struct { } func (*awsRestjson1_deserializeOpDeleteEnvironment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteEnvironment(response, &metadata) } output := &DeleteEnvironmentOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpGetApplication struct { } func (*awsRestjson1_deserializeOpGetApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetApplication(response, &metadata) } output := &GetApplicationOutput{} 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_deserializeOpDocumentGetApplicationOutput(&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_deserializeOpErrorGetApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetApplicationOutput(v **GetApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetApplicationOutput if *v == nil { sv = &GetApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ApplicationArn = ptr.String(jtv) } case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(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 Timestamp to be a JSON Number, got %T instead", value) } } case "deployedVersion": if err := awsRestjson1_deserializeDocumentDeployedVersionSummary(&sv.DeployedVersion, value); err != nil { return err } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "environmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.EnvironmentId = ptr.String(jtv) } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "lastStartTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "latestVersion": if err := awsRestjson1_deserializeDocumentApplicationVersionSummary(&sv.LatestVersion, value); err != nil { return err } case "listenerArns": if err := awsRestjson1_deserializeDocumentArnList(&sv.ListenerArns, value); err != nil { return err } case "listenerPorts": if err := awsRestjson1_deserializeDocumentPortList(&sv.ListenerPorts, value); err != nil { return err } case "loadBalancerDnsName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String100 to be of type string, got %T instead", value) } sv.LoadBalancerDnsName = ptr.String(jtv) } case "logGroups": if err := awsRestjson1_deserializeDocumentLogGroupSummaries(&sv.LogGroups, value); err != nil { return err } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "roleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationLifecycle to be of type string, got %T instead", value) } sv.Status = types.ApplicationLifecycle(jtv) } case "statusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StatusReason = ptr.String(jtv) } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "targetGroupArns": if err := awsRestjson1_deserializeDocumentArnList(&sv.TargetGroupArns, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetApplicationVersion struct { } func (*awsRestjson1_deserializeOpGetApplicationVersion) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetApplicationVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetApplicationVersion(response, &metadata) } output := &GetApplicationVersionOutput{} 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_deserializeOpDocumentGetApplicationVersionOutput(&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_deserializeOpErrorGetApplicationVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetApplicationVersionOutput(v **GetApplicationVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetApplicationVersionOutput if *v == nil { sv = &GetApplicationVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Version to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationVersion = ptr.Int32(int32(i64)) } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "definitionContent": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StringFree65000 to be of type string, got %T instead", value) } sv.DefinitionContent = ptr.String(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityDescription 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 EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationVersionLifecycle to be of type string, got %T instead", value) } sv.Status = types.ApplicationVersionLifecycle(jtv) } case "statusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StatusReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetBatchJobExecution struct { } func (*awsRestjson1_deserializeOpGetBatchJobExecution) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetBatchJobExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetBatchJobExecution(response, &metadata) } output := &GetBatchJobExecutionOutput{} 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_deserializeOpDocumentGetBatchJobExecutionOutput(&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_deserializeOpErrorGetBatchJobExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetBatchJobExecutionOutput(v **GetBatchJobExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetBatchJobExecutionOutput if *v == nil { sv = &GetBatchJobExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "batchJobIdentifier": if err := awsRestjson1_deserializeDocumentBatchJobIdentifier(&sv.BatchJobIdentifier, value); err != nil { return err } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "executionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ExecutionId = ptr.String(jtv) } case "jobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String100 to be of type string, got %T instead", value) } sv.JobId = ptr.String(jtv) } case "jobName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String100 to be of type string, got %T instead", value) } sv.JobName = ptr.String(jtv) } case "jobType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BatchJobType to be of type string, got %T instead", value) } sv.JobType = types.BatchJobType(jtv) } case "jobUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String100 to be of type string, got %T instead", value) } sv.JobUser = ptr.String(jtv) } case "returnCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ReturnCode = 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 Timestamp to be a JSON Number, got %T instead", value) } } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BatchJobExecutionStatus to be of type string, got %T instead", value) } sv.Status = types.BatchJobExecutionStatus(jtv) } case "statusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StatusReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetDataSetDetails struct { } func (*awsRestjson1_deserializeOpGetDataSetDetails) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetDataSetDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetDataSetDetails(response, &metadata) } output := &GetDataSetDetailsOutput{} 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_deserializeOpDocumentGetDataSetDetailsOutput(&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_deserializeOpErrorGetDataSetDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetDataSetDetailsOutput(v **GetDataSetDetailsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDataSetDetailsOutput if *v == nil { sv = &GetDataSetDetailsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "blocksize": 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.Blocksize = ptr.Int32(int32(i64)) } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "dataSetName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String200 to be of type string, got %T instead", value) } sv.DataSetName = ptr.String(jtv) } case "dataSetOrg": if err := awsRestjson1_deserializeDocumentDatasetDetailOrgAttributes(&sv.DataSetOrg, value); err != nil { return err } case "lastReferencedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastReferencedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "lastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "location": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String2000 to be of type string, got %T instead", value) } sv.Location = ptr.String(jtv) } case "recordLength": 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.RecordLength = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetDataSetImportTask struct { } func (*awsRestjson1_deserializeOpGetDataSetImportTask) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetDataSetImportTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetDataSetImportTask(response, &metadata) } output := &GetDataSetImportTaskOutput{} 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_deserializeOpDocumentGetDataSetImportTaskOutput(&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_deserializeOpErrorGetDataSetImportTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetDataSetImportTaskOutput(v **GetDataSetImportTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDataSetImportTaskOutput if *v == nil { sv = &GetDataSetImportTaskOutput{} } else { sv = *v } for key, value := range shape { switch key { case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetTaskLifecycle to be of type string, got %T instead", value) } sv.Status = types.DataSetTaskLifecycle(jtv) } case "summary": if err := awsRestjson1_deserializeDocumentDataSetImportSummary(&sv.Summary, value); err != nil { return err } case "taskId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.TaskId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetDeployment struct { } func (*awsRestjson1_deserializeOpGetDeployment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetDeployment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetDeployment(response, &metadata) } output := &GetDeploymentOutput{} 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_deserializeOpDocumentGetDeploymentOutput(&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_deserializeOpErrorGetDeployment(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetDeploymentOutput(v **GetDeploymentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDeploymentOutput if *v == nil { sv = &GetDeploymentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "applicationVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Version to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationVersion = ptr.Int32(int32(i64)) } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "deploymentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.DeploymentId = ptr.String(jtv) } case "environmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.EnvironmentId = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentLifecycle to be of type string, got %T instead", value) } sv.Status = types.DeploymentLifecycle(jtv) } case "statusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StatusReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetEnvironment struct { } func (*awsRestjson1_deserializeOpGetEnvironment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetEnvironment(response, &metadata) } output := &GetEnvironmentOutput{} 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_deserializeOpDocumentGetEnvironmentOutput(&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_deserializeOpErrorGetEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetEnvironmentOutput(v **GetEnvironmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetEnvironmentOutput if *v == nil { sv = &GetEnvironmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "actualCapacity": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected CapacityValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ActualCapacity = ptr.Int32(int32(i64)) } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "engineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineVersion to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "environmentArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.EnvironmentArn = ptr.String(jtv) } case "environmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.EnvironmentId = ptr.String(jtv) } case "highAvailabilityConfig": if err := awsRestjson1_deserializeDocumentHighAvailabilityConfig(&sv.HighAvailabilityConfig, value); err != nil { return err } case "instanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String20 to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "loadBalancerArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.LoadBalancerArn = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "pendingMaintenance": if err := awsRestjson1_deserializeDocumentPendingMaintenance(&sv.PendingMaintenance, value); err != nil { return err } case "preferredMaintenanceWindow": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String50 to be of type string, got %T instead", value) } sv.PreferredMaintenanceWindow = ptr.String(jtv) } case "publiclyAccessible": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.PubliclyAccessible = jtv } case "securityGroupIds": if err := awsRestjson1_deserializeDocumentString50List(&sv.SecurityGroupIds, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnvironmentLifecycle to be of type string, got %T instead", value) } sv.Status = types.EnvironmentLifecycle(jtv) } case "statusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StatusReason = ptr.String(jtv) } case "storageConfigurations": if err := awsRestjson1_deserializeDocumentStorageConfigurationList(&sv.StorageConfigurations, value); err != nil { return err } case "subnetIds": if err := awsRestjson1_deserializeDocumentString50List(&sv.SubnetIds, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "vpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String50 to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListApplications struct { } func (*awsRestjson1_deserializeOpListApplications) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListApplications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListApplications(response, &metadata) } output := &ListApplicationsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListApplicationsOutput(&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_deserializeOpErrorListApplications(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListApplicationsOutput(v **ListApplicationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListApplicationsOutput if *v == nil { sv = &ListApplicationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applications": if err := awsRestjson1_deserializeDocumentApplicationSummaryList(&sv.Applications, 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_deserializeOpListApplicationVersions struct { } func (*awsRestjson1_deserializeOpListApplicationVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListApplicationVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListApplicationVersions(response, &metadata) } output := &ListApplicationVersionsOutput{} 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_deserializeOpDocumentListApplicationVersionsOutput(&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_deserializeOpErrorListApplicationVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListApplicationVersionsOutput(v **ListApplicationVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListApplicationVersionsOutput if *v == nil { sv = &ListApplicationVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationVersions": if err := awsRestjson1_deserializeDocumentApplicationVersionSummaryList(&sv.ApplicationVersions, 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_deserializeOpListBatchJobDefinitions struct { } func (*awsRestjson1_deserializeOpListBatchJobDefinitions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListBatchJobDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListBatchJobDefinitions(response, &metadata) } output := &ListBatchJobDefinitionsOutput{} 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_deserializeOpDocumentListBatchJobDefinitionsOutput(&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_deserializeOpErrorListBatchJobDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListBatchJobDefinitionsOutput(v **ListBatchJobDefinitionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListBatchJobDefinitionsOutput if *v == nil { sv = &ListBatchJobDefinitionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "batchJobDefinitions": if err := awsRestjson1_deserializeDocumentBatchJobDefinitions(&sv.BatchJobDefinitions, 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_deserializeOpListBatchJobExecutions struct { } func (*awsRestjson1_deserializeOpListBatchJobExecutions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListBatchJobExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListBatchJobExecutions(response, &metadata) } output := &ListBatchJobExecutionsOutput{} 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_deserializeOpDocumentListBatchJobExecutionsOutput(&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_deserializeOpErrorListBatchJobExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListBatchJobExecutionsOutput(v **ListBatchJobExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListBatchJobExecutionsOutput if *v == nil { sv = &ListBatchJobExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "batchJobExecutions": if err := awsRestjson1_deserializeDocumentBatchJobExecutionSummaryList(&sv.BatchJobExecutions, 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_deserializeOpListDataSetImportHistory struct { } func (*awsRestjson1_deserializeOpListDataSetImportHistory) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDataSetImportHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListDataSetImportHistory(response, &metadata) } output := &ListDataSetImportHistoryOutput{} 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_deserializeOpDocumentListDataSetImportHistoryOutput(&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_deserializeOpErrorListDataSetImportHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListDataSetImportHistoryOutput(v **ListDataSetImportHistoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDataSetImportHistoryOutput if *v == nil { sv = &ListDataSetImportHistoryOutput{} } else { sv = *v } for key, value := range shape { switch key { case "dataSetImportTasks": if err := awsRestjson1_deserializeDocumentDataSetImportTaskList(&sv.DataSetImportTasks, 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_deserializeOpListDataSets struct { } func (*awsRestjson1_deserializeOpListDataSets) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDataSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListDataSets(response, &metadata) } output := &ListDataSetsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListDataSetsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListDataSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListDataSetsOutput(v **ListDataSetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDataSetsOutput if *v == nil { sv = &ListDataSetsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "dataSets": if err := awsRestjson1_deserializeDocumentDataSetsSummaryList(&sv.DataSets, 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_deserializeOpListDeployments struct { } func (*awsRestjson1_deserializeOpListDeployments) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListDeployments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListDeployments(response, &metadata) } output := &ListDeploymentsOutput{} 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_deserializeOpDocumentListDeploymentsOutput(&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_deserializeOpErrorListDeployments(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListDeploymentsOutput(v **ListDeploymentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListDeploymentsOutput if *v == nil { sv = &ListDeploymentsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "deployments": if err := awsRestjson1_deserializeDocumentDeploymentList(&sv.Deployments, 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_deserializeOpListEngineVersions struct { } func (*awsRestjson1_deserializeOpListEngineVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListEngineVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListEngineVersions(response, &metadata) } output := &ListEngineVersionsOutput{} 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_deserializeOpDocumentListEngineVersionsOutput(&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_deserializeOpErrorListEngineVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListEngineVersionsOutput(v **ListEngineVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListEngineVersionsOutput if *v == nil { sv = &ListEngineVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "engineVersions": if err := awsRestjson1_deserializeDocumentEngineVersionsSummaryList(&sv.EngineVersions, 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_deserializeOpListEnvironments struct { } func (*awsRestjson1_deserializeOpListEnvironments) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListEnvironments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorListEnvironments(response, &metadata) } output := &ListEnvironmentsOutput{} 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_deserializeOpDocumentListEnvironmentsOutput(&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_deserializeOpErrorListEnvironments(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListEnvironmentsOutput(v **ListEnvironmentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListEnvironmentsOutput if *v == nil { sv = &ListEnvironmentsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "environments": if err := awsRestjson1_deserializeDocumentEnvironmentSummaryList(&sv.Environments, 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("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartApplication struct { } func (*awsRestjson1_deserializeOpStartApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorStartApplication(response, &metadata) } output := &StartApplicationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorStartApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpStartBatchJob struct { } func (*awsRestjson1_deserializeOpStartBatchJob) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartBatchJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorStartBatchJob(response, &metadata) } output := &StartBatchJobOutput{} 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_deserializeOpDocumentStartBatchJobOutput(&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_deserializeOpErrorStartBatchJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartBatchJobOutput(v **StartBatchJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartBatchJobOutput if *v == nil { sv = &StartBatchJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "executionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ExecutionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStopApplication struct { } func (*awsRestjson1_deserializeOpStopApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStopApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorStopApplication(response, &metadata) } output := &StopApplicationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorStopApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateApplication struct { } func (*awsRestjson1_deserializeOpUpdateApplication) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpdateApplication(response, &metadata) } output := &UpdateApplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateApplicationOutput(&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_deserializeOpErrorUpdateApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateApplicationOutput(v **UpdateApplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateApplicationOutput if *v == nil { sv = &UpdateApplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "applicationVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Version to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationVersion = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateEnvironment struct { } func (*awsRestjson1_deserializeOpUpdateEnvironment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateEnvironment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateEnvironment(response, &metadata) } output := &UpdateEnvironmentOutput{} 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_deserializeOpDocumentUpdateEnvironmentOutput(&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_deserializeOpErrorUpdateEnvironment(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateEnvironmentOutput(v **UpdateEnvironmentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateEnvironmentOutput if *v == nil { sv = &UpdateEnvironmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "environmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.EnvironmentId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) vv, err := strconv.ParseInt(headerValues[0], 0, 32) if err != nil { return err } v.RetryAfterSeconds = int32(vv) } return nil } func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) vv, err := strconv.ParseInt(headerValues[0], 0, 32) if err != nil { return err } v.RetryAfterSeconds = int32(vv) } return nil } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentConflictException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } return output } func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceQuotaExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottlingException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} } return output } func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentValidationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAlternateKey(v **types.AlternateKey, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AlternateKey if *v == nil { sv = &types.AlternateKey{} } else { sv = *v } for key, value := range shape { switch key { case "allowDuplicates": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AllowDuplicates = jtv } case "length": 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.Length = int32(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "offset": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Offset = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAlternateKeyList(v *[]types.AlternateKey, 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.AlternateKey if *v == nil { cv = []types.AlternateKey{} } else { cv = *v } for _, value := range shape { var col types.AlternateKey destAddr := &col if err := awsRestjson1_deserializeDocumentAlternateKey(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentApplicationSummary(v **types.ApplicationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ApplicationSummary if *v == nil { sv = &types.ApplicationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ApplicationArn = ptr.String(jtv) } case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "applicationVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Version to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationVersion = ptr.Int32(int32(i64)) } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "deploymentStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationDeploymentLifecycle to be of type string, got %T instead", value) } sv.DeploymentStatus = types.ApplicationDeploymentLifecycle(jtv) } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "environmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.EnvironmentId = ptr.String(jtv) } case "lastStartTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "roleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationLifecycle to be of type string, got %T instead", value) } sv.Status = types.ApplicationLifecycle(jtv) } case "versionStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationVersionLifecycle to be of type string, got %T instead", value) } sv.VersionStatus = types.ApplicationVersionLifecycle(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplicationSummaryList(v *[]types.ApplicationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ApplicationSummary if *v == nil { cv = []types.ApplicationSummary{} } else { cv = *v } for _, value := range shape { var col types.ApplicationSummary destAddr := &col if err := awsRestjson1_deserializeDocumentApplicationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentApplicationVersionSummary(v **types.ApplicationVersionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ApplicationVersionSummary if *v == nil { sv = &types.ApplicationVersionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Version to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationVersion = ptr.Int32(int32(i64)) } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ApplicationVersionLifecycle to be of type string, got %T instead", value) } sv.Status = types.ApplicationVersionLifecycle(jtv) } case "statusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StatusReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentApplicationVersionSummaryList(v *[]types.ApplicationVersionSummary, 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.ApplicationVersionSummary if *v == nil { cv = []types.ApplicationVersionSummary{} } else { cv = *v } for _, value := range shape { var col types.ApplicationVersionSummary destAddr := &col if err := awsRestjson1_deserializeDocumentApplicationVersionSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentArnList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBatchJobDefinition(v *types.BatchJobDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %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.BatchJobDefinition loop: for key, value := range shape { if value == nil { continue } switch key { case "fileBatchJobDefinition": var mv types.FileBatchJobDefinition destAddr := &mv if err := awsRestjson1_deserializeDocumentFileBatchJobDefinition(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.BatchJobDefinitionMemberFileBatchJobDefinition{Value: mv} break loop case "scriptBatchJobDefinition": var mv types.ScriptBatchJobDefinition destAddr := &mv if err := awsRestjson1_deserializeDocumentScriptBatchJobDefinition(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.BatchJobDefinitionMemberScriptBatchJobDefinition{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentBatchJobDefinitions(v *[]types.BatchJobDefinition, 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.BatchJobDefinition if *v == nil { cv = []types.BatchJobDefinition{} } else { cv = *v } for _, value := range shape { var col types.BatchJobDefinition if err := awsRestjson1_deserializeDocumentBatchJobDefinition(&col, value); err != nil { return err } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBatchJobExecutionSummary(v **types.BatchJobExecutionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BatchJobExecutionSummary if *v == nil { sv = &types.BatchJobExecutionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "batchJobIdentifier": if err := awsRestjson1_deserializeDocumentBatchJobIdentifier(&sv.BatchJobIdentifier, value); err != nil { return err } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "executionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ExecutionId = ptr.String(jtv) } case "jobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String100 to be of type string, got %T instead", value) } sv.JobId = ptr.String(jtv) } case "jobName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String100 to be of type string, got %T instead", value) } sv.JobName = ptr.String(jtv) } case "jobType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BatchJobType to be of type string, got %T instead", value) } sv.JobType = types.BatchJobType(jtv) } case "returnCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ReturnCode = 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 Timestamp to be a JSON Number, got %T instead", value) } } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BatchJobExecutionStatus to be of type string, got %T instead", value) } sv.Status = types.BatchJobExecutionStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBatchJobExecutionSummaryList(v *[]types.BatchJobExecutionSummary, 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.BatchJobExecutionSummary if *v == nil { cv = []types.BatchJobExecutionSummary{} } else { cv = *v } for _, value := range shape { var col types.BatchJobExecutionSummary destAddr := &col if err := awsRestjson1_deserializeDocumentBatchJobExecutionSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentBatchJobIdentifier(v *types.BatchJobIdentifier, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %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.BatchJobIdentifier loop: for key, value := range shape { if value == nil { continue } switch key { case "fileBatchJobIdentifier": var mv types.FileBatchJobIdentifier destAddr := &mv if err := awsRestjson1_deserializeDocumentFileBatchJobIdentifier(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.BatchJobIdentifierMemberFileBatchJobIdentifier{Value: mv} break loop case "scriptBatchJobIdentifier": var mv types.ScriptBatchJobIdentifier destAddr := &mv if err := awsRestjson1_deserializeDocumentScriptBatchJobIdentifier(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.BatchJobIdentifierMemberScriptBatchJobIdentifier{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDatasetDetailOrgAttributes(v *types.DatasetDetailOrgAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %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.DatasetDetailOrgAttributes loop: for key, value := range shape { if value == nil { continue } switch key { case "gdg": var mv types.GdgDetailAttributes destAddr := &mv if err := awsRestjson1_deserializeDocumentGdgDetailAttributes(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DatasetDetailOrgAttributesMemberGdg{Value: mv} break loop case "po": var mv types.PoDetailAttributes destAddr := &mv if err := awsRestjson1_deserializeDocumentPoDetailAttributes(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DatasetDetailOrgAttributesMemberPo{Value: mv} break loop case "ps": var mv types.PsDetailAttributes destAddr := &mv if err := awsRestjson1_deserializeDocumentPsDetailAttributes(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DatasetDetailOrgAttributesMemberPs{Value: mv} break loop case "vsam": var mv types.VsamDetailAttributes destAddr := &mv if err := awsRestjson1_deserializeDocumentVsamDetailAttributes(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.DatasetDetailOrgAttributesMemberVsam{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentDataSetImportSummary(v **types.DataSetImportSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataSetImportSummary if *v == nil { sv = &types.DataSetImportSummary{} } else { sv = *v } for key, value := range shape { switch key { case "failed": 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.Failed = int32(i64) } case "inProgress": 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.InProgress = int32(i64) } case "pending": 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.Pending = int32(i64) } case "succeeded": 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.Succeeded = int32(i64) } case "total": 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.Total = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSetImportTask(v **types.DataSetImportTask, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataSetImportTask if *v == nil { sv = &types.DataSetImportTask{} } else { sv = *v } for key, value := range shape { switch key { case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSetTaskLifecycle to be of type string, got %T instead", value) } sv.Status = types.DataSetTaskLifecycle(jtv) } case "summary": if err := awsRestjson1_deserializeDocumentDataSetImportSummary(&sv.Summary, value); err != nil { return err } case "taskId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.TaskId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataSetImportTaskList(v *[]types.DataSetImportTask, 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.DataSetImportTask if *v == nil { cv = []types.DataSetImportTask{} } else { cv = *v } for _, value := range shape { var col types.DataSetImportTask destAddr := &col if err := awsRestjson1_deserializeDocumentDataSetImportTask(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSetsSummaryList(v *[]types.DataSetSummary, 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.DataSetSummary if *v == nil { cv = []types.DataSetSummary{} } else { cv = *v } for _, value := range shape { var col types.DataSetSummary destAddr := &col if err := awsRestjson1_deserializeDocumentDataSetSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDataSetSummary(v **types.DataSetSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataSetSummary if *v == nil { sv = &types.DataSetSummary{} } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "dataSetName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String200 to be of type string, got %T instead", value) } sv.DataSetName = ptr.String(jtv) } case "dataSetOrg": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String20 to be of type string, got %T instead", value) } sv.DataSetOrg = ptr.String(jtv) } case "format": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String20 to be of type string, got %T instead", value) } sv.Format = ptr.String(jtv) } case "lastReferencedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastReferencedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "lastUpdatedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDeployedVersionSummary(v **types.DeployedVersionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DeployedVersionSummary if *v == nil { sv = &types.DeployedVersionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Version to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationVersion = ptr.Int32(int32(i64)) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentLifecycle to be of type string, got %T instead", value) } sv.Status = types.DeploymentLifecycle(jtv) } case "statusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StatusReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDeploymentList(v *[]types.DeploymentSummary, 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.DeploymentSummary if *v == nil { cv = []types.DeploymentSummary{} } else { cv = *v } for _, value := range shape { var col types.DeploymentSummary destAddr := &col if err := awsRestjson1_deserializeDocumentDeploymentSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentDeploymentSummary(v **types.DeploymentSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DeploymentSummary if *v == nil { sv = &types.DeploymentSummary{} } else { sv = *v } for key, value := range shape { switch key { case "applicationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.ApplicationId = ptr.String(jtv) } case "applicationVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Version to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ApplicationVersion = ptr.Int32(int32(i64)) } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "deploymentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.DeploymentId = ptr.String(jtv) } case "environmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.EnvironmentId = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeploymentLifecycle to be of type string, got %T instead", value) } sv.Status = types.DeploymentLifecycle(jtv) } case "statusReason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StatusReason = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEfsStorageConfiguration(v **types.EfsStorageConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EfsStorageConfiguration if *v == nil { sv = &types.EfsStorageConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "file-system-id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String200 to be of type string, got %T instead", value) } sv.FileSystemId = ptr.String(jtv) } case "mount-point": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String200 to be of type string, got %T instead", value) } sv.MountPoint = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEngineVersionsSummary(v **types.EngineVersionsSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EngineVersionsSummary if *v == nil { sv = &types.EngineVersionsSummary{} } else { sv = *v } for key, value := range shape { switch key { case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.EngineType = ptr.String(jtv) } case "engineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEngineVersionsSummaryList(v *[]types.EngineVersionsSummary, 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.EngineVersionsSummary if *v == nil { cv = []types.EngineVersionsSummary{} } else { cv = *v } for _, value := range shape { var col types.EngineVersionsSummary destAddr := &col if err := awsRestjson1_deserializeDocumentEngineVersionsSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentEnvironmentSummary(v **types.EnvironmentSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.EnvironmentSummary if *v == nil { sv = &types.EnvironmentSummary{} } 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 Timestamp to be a JSON Number, got %T instead", value) } } case "engineType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineType to be of type string, got %T instead", value) } sv.EngineType = types.EngineType(jtv) } case "engineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EngineVersion to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "environmentArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.EnvironmentArn = ptr.String(jtv) } case "environmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Identifier to be of type string, got %T instead", value) } sv.EnvironmentId = ptr.String(jtv) } case "instanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String20 to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnvironmentLifecycle to be of type string, got %T instead", value) } sv.Status = types.EnvironmentLifecycle(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEnvironmentSummaryList(v *[]types.EnvironmentSummary, 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.EnvironmentSummary if *v == nil { cv = []types.EnvironmentSummary{} } else { cv = *v } for _, value := range shape { var col types.EnvironmentSummary destAddr := &col if err := awsRestjson1_deserializeDocumentEnvironmentSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentFileBatchJobDefinition(v **types.FileBatchJobDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FileBatchJobDefinition if *v == nil { sv = &types.FileBatchJobDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "fileName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.FileName = ptr.String(jtv) } case "folderPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.FolderPath = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFileBatchJobIdentifier(v **types.FileBatchJobIdentifier, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FileBatchJobIdentifier if *v == nil { sv = &types.FileBatchJobIdentifier{} } else { sv = *v } for key, value := range shape { switch key { case "fileName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.FileName = ptr.String(jtv) } case "folderPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.FolderPath = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFsxStorageConfiguration(v **types.FsxStorageConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FsxStorageConfiguration if *v == nil { sv = &types.FsxStorageConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "file-system-id": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String200 to be of type string, got %T instead", value) } sv.FileSystemId = ptr.String(jtv) } case "mount-point": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String200 to be of type string, got %T instead", value) } sv.MountPoint = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGdgDetailAttributes(v **types.GdgDetailAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.GdgDetailAttributes if *v == nil { sv = &types.GdgDetailAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "limit": 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.Limit = int32(i64) } case "rollDisposition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String50 to be of type string, got %T instead", value) } sv.RollDisposition = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHighAvailabilityConfig(v **types.HighAvailabilityConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HighAvailabilityConfig if *v == nil { sv = &types.HighAvailabilityConfig{} } else { sv = *v } for key, value := range shape { switch key { case "desiredCapacity": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected CapacityValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DesiredCapacity = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServerException if *v == nil { sv = &types.InternalServerException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "retryAfterSeconds": 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.RetryAfterSeconds = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogGroupSummaries(v *[]types.LogGroupSummary, 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.LogGroupSummary if *v == nil { cv = []types.LogGroupSummary{} } else { cv = *v } for _, value := range shape { var col types.LogGroupSummary destAddr := &col if err := awsRestjson1_deserializeDocumentLogGroupSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLogGroupSummary(v **types.LogGroupSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LogGroupSummary if *v == nil { sv = &types.LogGroupSummary{} } 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 LogGroupIdentifier to be of type string, got %T instead", value) } sv.LogGroupName = ptr.String(jtv) } case "logType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String20 to be of type string, got %T instead", value) } sv.LogType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMaintenanceSchedule(v **types.MaintenanceSchedule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MaintenanceSchedule if *v == nil { sv = &types.MaintenanceSchedule{} } else { sv = *v } for key, value := range shape { switch key { 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 Timestamp to be a JSON Number, got %T instead", value) } } 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 Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPendingMaintenance(v **types.PendingMaintenance, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PendingMaintenance if *v == nil { sv = &types.PendingMaintenance{} } else { sv = *v } for key, value := range shape { switch key { case "engineVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.EngineVersion = ptr.String(jtv) } case "schedule": if err := awsRestjson1_deserializeDocumentMaintenanceSchedule(&sv.Schedule, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPoDetailAttributes(v **types.PoDetailAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PoDetailAttributes if *v == nil { sv = &types.PoDetailAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "encoding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Encoding = ptr.String(jtv) } case "format": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Format = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPortList(v *[]int32, 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 []int32 if *v == nil { cv = []int32{} } else { cv = *v } for _, value := range shape { var col int32 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 } col = int32(i64) } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentPrimaryKey(v **types.PrimaryKey, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PrimaryKey if *v == nil { sv = &types.PrimaryKey{} } else { sv = *v } for key, value := range shape { switch key { case "length": 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.Length = int32(i64) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "offset": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Offset = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPsDetailAttributes(v **types.PsDetailAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PsDetailAttributes if *v == nil { sv = &types.PsDetailAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "encoding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Encoding = ptr.String(jtv) } case "format": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Format = 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 String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScriptBatchJobDefinition(v **types.ScriptBatchJobDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ScriptBatchJobDefinition if *v == nil { sv = &types.ScriptBatchJobDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "scriptName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ScriptName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScriptBatchJobIdentifier(v **types.ScriptBatchJobIdentifier, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ScriptBatchJobIdentifier if *v == nil { sv = &types.ScriptBatchJobIdentifier{} } else { sv = *v } for key, value := range shape { switch key { case "scriptName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ScriptName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceQuotaExceededException if *v == nil { sv = &types.ServiceQuotaExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "quotaCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "resourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "resourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } case "serviceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStorageConfiguration(v *types.StorageConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %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.StorageConfiguration loop: for key, value := range shape { if value == nil { continue } switch key { case "efs": var mv types.EfsStorageConfiguration destAddr := &mv if err := awsRestjson1_deserializeDocumentEfsStorageConfiguration(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.StorageConfigurationMemberEfs{Value: mv} break loop case "fsx": var mv types.FsxStorageConfiguration destAddr := &mv if err := awsRestjson1_deserializeDocumentFsxStorageConfiguration(&destAddr, value); err != nil { return err } mv = *destAddr uv = &types.StorageConfigurationMemberFsx{Value: mv} break loop default: uv = &types.UnknownUnionMember{Tag: key} break loop } } *v = uv return nil } func awsRestjson1_deserializeDocumentStorageConfigurationList(v *[]types.StorageConfiguration, 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.StorageConfiguration if *v == nil { cv = []types.StorageConfiguration{} } else { cv = *v } for _, value := range shape { var col types.StorageConfiguration if err := awsRestjson1_deserializeDocumentStorageConfiguration(&col, value); err != nil { return err } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentString50List(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 String50 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 TagValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ThrottlingException if *v == nil { sv = &types.ThrottlingException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "quotaCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } case "retryAfterSeconds": 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.RetryAfterSeconds = int32(i64) } case "serviceCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "fieldList": if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { return err } case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) } sv.Reason = types.ValidationExceptionReason(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ValidationExceptionField if *v == nil { sv = &types.ValidationExceptionField{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ValidationExceptionField if *v == nil { cv = []types.ValidationExceptionField{} } else { cv = *v } for _, value := range shape { var col types.ValidationExceptionField destAddr := &col if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentVsamDetailAttributes(v **types.VsamDetailAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VsamDetailAttributes if *v == nil { sv = &types.VsamDetailAttributes{} } else { sv = *v } for key, value := range shape { switch key { case "alternateKeys": if err := awsRestjson1_deserializeDocumentAlternateKeyList(&sv.AlternateKeys, value); err != nil { return err } case "cacheAtStartup": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.CacheAtStartup = ptr.Bool(jtv) } case "compressed": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Compressed = ptr.Bool(jtv) } case "encoding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String20 to be of type string, got %T instead", value) } sv.Encoding = ptr.String(jtv) } case "primaryKey": if err := awsRestjson1_deserializeDocumentPrimaryKey(&sv.PrimaryKey, value); err != nil { return err } case "recordFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String20 to be of type string, got %T instead", value) } sv.RecordFormat = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
8,831
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package m2 provides the API client, operations, and parameter types for // AWSMainframeModernization. // // Amazon Web Services Mainframe Modernization provides tools and resources to // help you plan and implement migration and modernization from mainframes to // Amazon Web Services managed runtime environments. It provides tools for // analyzing existing mainframe applications, developing or updating mainframe // applications using COBOL or PL/I, and implementing an automated pipeline for // continuous integration and continuous delivery (CI/CD) of the applications. package m2
13
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 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/m2/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 = "m2" } 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 m2 // goModuleVersion is the tagged release for this module const goModuleVersion = "1.5.2"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/m2/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_serializeOpCancelBatchJobExecution struct { } func (*awsRestjson1_serializeOpCancelBatchJobExecution) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCancelBatchJobExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CancelBatchJobExecutionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/batch-job-executions/{executionId}/cancel") 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_serializeOpHttpBindingsCancelBatchJobExecutionInput(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_serializeOpHttpBindingsCancelBatchJobExecutionInput(v *CancelBatchJobExecutionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.ExecutionId == nil || len(*v.ExecutionId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member executionId must not be empty")} } if v.ExecutionId != nil { if err := encoder.SetURI("executionId").String(*v.ExecutionId); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateApplication struct { } func (*awsRestjson1_serializeOpCreateApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications") 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_serializeOpDocumentCreateApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateApplicationInput(v *CreateApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateApplicationInput(v *CreateApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Definition != nil { ok := object.Key("definition") if err := awsRestjson1_serializeDocumentDefinition(v.Definition, ok); err != nil { return err } } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if len(v.EngineType) > 0 { ok := object.Key("engineType") ok.String(string(v.EngineType)) } if v.KmsKeyId != nil { ok := object.Key("kmsKeyId") ok.String(*v.KmsKeyId) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.RoleArn != nil { ok := object.Key("roleArn") ok.String(*v.RoleArn) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateDataSetImportTask struct { } func (*awsRestjson1_serializeOpCreateDataSetImportTask) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateDataSetImportTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateDataSetImportTaskInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/dataset-import-task") 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_serializeOpHttpBindingsCreateDataSetImportTaskInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateDataSetImportTaskInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDataSetImportTaskInput(v *CreateDataSetImportTaskInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateDataSetImportTaskInput(v *CreateDataSetImportTaskInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.ImportConfig != nil { ok := object.Key("importConfig") if err := awsRestjson1_serializeDocumentDataSetImportConfig(v.ImportConfig, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateDeployment struct { } func (*awsRestjson1_serializeOpCreateDeployment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateDeployment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateDeploymentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/deployments") 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_serializeOpHttpBindingsCreateDeploymentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateDeploymentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDeploymentInput(v *CreateDeploymentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateDeploymentInput(v *CreateDeploymentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplicationVersion != nil { ok := object.Key("applicationVersion") ok.Integer(*v.ApplicationVersion) } if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.EnvironmentId != nil { ok := object.Key("environmentId") ok.String(*v.EnvironmentId) } return nil } type awsRestjson1_serializeOpCreateEnvironment struct { } func (*awsRestjson1_serializeOpCreateEnvironment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateEnvironment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateEnvironmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments") 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_serializeOpDocumentCreateEnvironmentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateEnvironmentInput(v *CreateEnvironmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateEnvironmentInput(v *CreateEnvironmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if len(v.EngineType) > 0 { ok := object.Key("engineType") ok.String(string(v.EngineType)) } if v.EngineVersion != nil { ok := object.Key("engineVersion") ok.String(*v.EngineVersion) } if v.HighAvailabilityConfig != nil { ok := object.Key("highAvailabilityConfig") if err := awsRestjson1_serializeDocumentHighAvailabilityConfig(v.HighAvailabilityConfig, ok); err != nil { return err } } if v.InstanceType != nil { ok := object.Key("instanceType") ok.String(*v.InstanceType) } if v.KmsKeyId != nil { ok := object.Key("kmsKeyId") ok.String(*v.KmsKeyId) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.PreferredMaintenanceWindow != nil { ok := object.Key("preferredMaintenanceWindow") ok.String(*v.PreferredMaintenanceWindow) } if v.PubliclyAccessible { ok := object.Key("publiclyAccessible") ok.Boolean(v.PubliclyAccessible) } if v.SecurityGroupIds != nil { ok := object.Key("securityGroupIds") if err := awsRestjson1_serializeDocumentString50List(v.SecurityGroupIds, ok); err != nil { return err } } if v.StorageConfigurations != nil { ok := object.Key("storageConfigurations") if err := awsRestjson1_serializeDocumentStorageConfigurationList(v.StorageConfigurations, ok); err != nil { return err } } if v.SubnetIds != nil { ok := object.Key("subnetIds") if err := awsRestjson1_serializeDocumentString50List(v.SubnetIds, 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_serializeOpDeleteApplication struct { } func (*awsRestjson1_serializeOpDeleteApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}") 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_serializeOpHttpBindingsDeleteApplicationInput(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_serializeOpHttpBindingsDeleteApplicationInput(v *DeleteApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteApplicationFromEnvironment struct { } func (*awsRestjson1_serializeOpDeleteApplicationFromEnvironment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteApplicationFromEnvironment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteApplicationFromEnvironmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/environment/{environmentId}") 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_serializeOpHttpBindingsDeleteApplicationFromEnvironmentInput(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_serializeOpHttpBindingsDeleteApplicationFromEnvironmentInput(v *DeleteApplicationFromEnvironmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.EnvironmentId == nil || len(*v.EnvironmentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member environmentId must not be empty")} } if v.EnvironmentId != nil { if err := encoder.SetURI("environmentId").String(*v.EnvironmentId); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteEnvironment struct { } func (*awsRestjson1_serializeOpDeleteEnvironment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteEnvironment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteEnvironmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments/{environmentId}") 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_serializeOpHttpBindingsDeleteEnvironmentInput(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_serializeOpHttpBindingsDeleteEnvironmentInput(v *DeleteEnvironmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.EnvironmentId == nil || len(*v.EnvironmentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member environmentId must not be empty")} } if v.EnvironmentId != nil { if err := encoder.SetURI("environmentId").String(*v.EnvironmentId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetApplication struct { } func (*awsRestjson1_serializeOpGetApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}") 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_serializeOpHttpBindingsGetApplicationInput(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_serializeOpHttpBindingsGetApplicationInput(v *GetApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetApplicationVersion struct { } func (*awsRestjson1_serializeOpGetApplicationVersion) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetApplicationVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetApplicationVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/versions/{applicationVersion}") 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_serializeOpHttpBindingsGetApplicationVersionInput(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_serializeOpHttpBindingsGetApplicationVersionInput(v *GetApplicationVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.ApplicationVersion == nil { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationVersion must not be empty")} } if v.ApplicationVersion != nil { if err := encoder.SetURI("applicationVersion").Integer(*v.ApplicationVersion); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetBatchJobExecution struct { } func (*awsRestjson1_serializeOpGetBatchJobExecution) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetBatchJobExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetBatchJobExecutionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/batch-job-executions/{executionId}") 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_serializeOpHttpBindingsGetBatchJobExecutionInput(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_serializeOpHttpBindingsGetBatchJobExecutionInput(v *GetBatchJobExecutionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.ExecutionId == nil || len(*v.ExecutionId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member executionId must not be empty")} } if v.ExecutionId != nil { if err := encoder.SetURI("executionId").String(*v.ExecutionId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetDataSetDetails struct { } func (*awsRestjson1_serializeOpGetDataSetDetails) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetDataSetDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetDataSetDetailsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/datasets/{dataSetName}") 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_serializeOpHttpBindingsGetDataSetDetailsInput(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_serializeOpHttpBindingsGetDataSetDetailsInput(v *GetDataSetDetailsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.DataSetName == nil || len(*v.DataSetName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member dataSetName must not be empty")} } if v.DataSetName != nil { if err := encoder.SetURI("dataSetName").String(*v.DataSetName); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetDataSetImportTask struct { } func (*awsRestjson1_serializeOpGetDataSetImportTask) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetDataSetImportTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetDataSetImportTaskInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/dataset-import-tasks/{taskId}") 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_serializeOpHttpBindingsGetDataSetImportTaskInput(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_serializeOpHttpBindingsGetDataSetImportTaskInput(v *GetDataSetImportTaskInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.TaskId == nil || len(*v.TaskId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member taskId must not be empty")} } if v.TaskId != nil { if err := encoder.SetURI("taskId").String(*v.TaskId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetDeployment struct { } func (*awsRestjson1_serializeOpGetDeployment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetDeployment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetDeploymentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/deployments/{deploymentId}") 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_serializeOpHttpBindingsGetDeploymentInput(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_serializeOpHttpBindingsGetDeploymentInput(v *GetDeploymentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.DeploymentId == nil || len(*v.DeploymentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member deploymentId must not be empty")} } if v.DeploymentId != nil { if err := encoder.SetURI("deploymentId").String(*v.DeploymentId); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetEnvironment struct { } func (*awsRestjson1_serializeOpGetEnvironment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetEnvironment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetEnvironmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments/{environmentId}") 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_serializeOpHttpBindingsGetEnvironmentInput(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_serializeOpHttpBindingsGetEnvironmentInput(v *GetEnvironmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.EnvironmentId == nil || len(*v.EnvironmentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member environmentId must not be empty")} } if v.EnvironmentId != nil { if err := encoder.SetURI("environmentId").String(*v.EnvironmentId); err != nil { return err } } return nil } type awsRestjson1_serializeOpListApplications struct { } func (*awsRestjson1_serializeOpListApplications) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListApplications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListApplicationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications") 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_serializeOpHttpBindingsListApplicationsInput(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_serializeOpHttpBindingsListApplicationsInput(v *ListApplicationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.EnvironmentId != nil { encoder.SetQuery("environmentId").String(*v.EnvironmentId) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.Names != nil { for i := range v.Names { encoder.AddQuery("names").String(v.Names[i]) } } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListApplicationVersions struct { } func (*awsRestjson1_serializeOpListApplicationVersions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListApplicationVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListApplicationVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/versions") 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_serializeOpHttpBindingsListApplicationVersionsInput(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_serializeOpHttpBindingsListApplicationVersionsInput(v *ListApplicationVersionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListBatchJobDefinitions struct { } func (*awsRestjson1_serializeOpListBatchJobDefinitions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListBatchJobDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListBatchJobDefinitionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/batch-job-definitions") 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_serializeOpHttpBindingsListBatchJobDefinitionsInput(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_serializeOpHttpBindingsListBatchJobDefinitionsInput(v *ListBatchJobDefinitionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.Prefix != nil { encoder.SetQuery("prefix").String(*v.Prefix) } return nil } type awsRestjson1_serializeOpListBatchJobExecutions struct { } func (*awsRestjson1_serializeOpListBatchJobExecutions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListBatchJobExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListBatchJobExecutionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/batch-job-executions") 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_serializeOpHttpBindingsListBatchJobExecutionsInput(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_serializeOpHttpBindingsListBatchJobExecutionsInput(v *ListBatchJobExecutionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.ExecutionIds != nil { for i := range v.ExecutionIds { encoder.AddQuery("executionIds").String(v.ExecutionIds[i]) } } if v.JobName != nil { encoder.SetQuery("jobName").String(*v.JobName) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.StartedAfter != nil { encoder.SetQuery("startedAfter").String(smithytime.FormatDateTime(*v.StartedAfter)) } if v.StartedBefore != nil { encoder.SetQuery("startedBefore").String(smithytime.FormatDateTime(*v.StartedBefore)) } if len(v.Status) > 0 { encoder.SetQuery("status").String(string(v.Status)) } return nil } type awsRestjson1_serializeOpListDataSetImportHistory struct { } func (*awsRestjson1_serializeOpListDataSetImportHistory) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListDataSetImportHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListDataSetImportHistoryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/dataset-import-tasks") 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_serializeOpHttpBindingsListDataSetImportHistoryInput(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_serializeOpHttpBindingsListDataSetImportHistoryInput(v *ListDataSetImportHistoryInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListDataSets struct { } func (*awsRestjson1_serializeOpListDataSets) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListDataSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListDataSetsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/datasets") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListDataSetsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListDataSetsInput(v *ListDataSetsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.Prefix != nil { encoder.SetQuery("prefix").String(*v.Prefix) } return nil } type awsRestjson1_serializeOpListDeployments struct { } func (*awsRestjson1_serializeOpListDeployments) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListDeployments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListDeploymentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/deployments") 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_serializeOpHttpBindingsListDeploymentsInput(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_serializeOpHttpBindingsListDeploymentsInput(v *ListDeploymentsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListEngineVersions struct { } func (*awsRestjson1_serializeOpListEngineVersions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListEngineVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListEngineVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/engine-versions") 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_serializeOpHttpBindingsListEngineVersionsInput(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_serializeOpHttpBindingsListEngineVersionsInput(v *ListEngineVersionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if len(v.EngineType) > 0 { encoder.SetQuery("engineType").String(string(v.EngineType)) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListEnvironments struct { } func (*awsRestjson1_serializeOpListEnvironments) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListEnvironments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListEnvironmentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments") 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_serializeOpHttpBindingsListEnvironmentsInput(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_serializeOpHttpBindingsListEnvironmentsInput(v *ListEnvironmentsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if len(v.EngineType) > 0 { encoder.SetQuery("engineType").String(string(v.EngineType)) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.Names != nil { for i := range v.Names { encoder.AddQuery("names").String(v.Names[i]) } } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpStartApplication struct { } func (*awsRestjson1_serializeOpStartApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/start") 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_serializeOpHttpBindingsStartApplicationInput(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_serializeOpHttpBindingsStartApplicationInput(v *StartApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } return nil } type awsRestjson1_serializeOpStartBatchJob struct { } func (*awsRestjson1_serializeOpStartBatchJob) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartBatchJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartBatchJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/batch-job") 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_serializeOpHttpBindingsStartBatchJobInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStartBatchJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsStartBatchJobInput(v *StartBatchJobInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentStartBatchJobInput(v *StartBatchJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BatchJobIdentifier != nil { ok := object.Key("batchJobIdentifier") if err := awsRestjson1_serializeDocumentBatchJobIdentifier(v.BatchJobIdentifier, ok); err != nil { return err } } if v.JobParams != nil { ok := object.Key("jobParams") if err := awsRestjson1_serializeDocumentBatchJobParametersMap(v.JobParams, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpStopApplication struct { } func (*awsRestjson1_serializeOpStopApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}/stop") 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_serializeOpHttpBindingsStopApplicationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentStopApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsStopApplicationInput(v *StopApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentStopApplicationInput(v *StopApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ForceStop { ok := object.Key("forceStop") ok.Boolean(v.ForceStop) } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateApplication struct { } func (*awsRestjson1_serializeOpUpdateApplication) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateApplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateApplicationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateApplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateApplicationInput(v *UpdateApplicationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} } if v.ApplicationId != nil { if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateApplicationInput(v *UpdateApplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CurrentApplicationVersion != nil { ok := object.Key("currentApplicationVersion") ok.Integer(*v.CurrentApplicationVersion) } if v.Definition != nil { ok := object.Key("definition") if err := awsRestjson1_serializeDocumentDefinition(v.Definition, ok); err != nil { return err } } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } return nil } type awsRestjson1_serializeOpUpdateEnvironment struct { } func (*awsRestjson1_serializeOpUpdateEnvironment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateEnvironment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateEnvironmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments/{environmentId}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PATCH" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateEnvironmentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateEnvironmentInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateEnvironmentInput(v *UpdateEnvironmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.EnvironmentId == nil || len(*v.EnvironmentId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member environmentId must not be empty")} } if v.EnvironmentId != nil { if err := encoder.SetURI("environmentId").String(*v.EnvironmentId); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateEnvironmentInput(v *UpdateEnvironmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApplyDuringMaintenanceWindow { ok := object.Key("applyDuringMaintenanceWindow") ok.Boolean(v.ApplyDuringMaintenanceWindow) } if v.DesiredCapacity != nil { ok := object.Key("desiredCapacity") ok.Integer(*v.DesiredCapacity) } if v.EngineVersion != nil { ok := object.Key("engineVersion") ok.String(*v.EngineVersion) } if v.InstanceType != nil { ok := object.Key("instanceType") ok.String(*v.InstanceType) } if v.PreferredMaintenanceWindow != nil { ok := object.Key("preferredMaintenanceWindow") ok.String(*v.PreferredMaintenanceWindow) } return nil } func awsRestjson1_serializeDocumentAlternateKey(v *types.AlternateKey, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AllowDuplicates { ok := object.Key("allowDuplicates") ok.Boolean(v.AllowDuplicates) } { ok := object.Key("length") ok.Integer(v.Length) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } { ok := object.Key("offset") ok.Integer(v.Offset) } return nil } func awsRestjson1_serializeDocumentAlternateKeyList(v []types.AlternateKey, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentAlternateKey(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentBatchJobIdentifier(v types.BatchJobIdentifier, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.BatchJobIdentifierMemberFileBatchJobIdentifier: av := object.Key("fileBatchJobIdentifier") if err := awsRestjson1_serializeDocumentFileBatchJobIdentifier(&uv.Value, av); err != nil { return err } case *types.BatchJobIdentifierMemberScriptBatchJobIdentifier: av := object.Key("scriptBatchJobIdentifier") if err := awsRestjson1_serializeDocumentScriptBatchJobIdentifier(&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_serializeDocumentBatchJobParametersMap(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_serializeDocumentDataSet(v *types.DataSet, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DatasetName != nil { ok := object.Key("datasetName") ok.String(*v.DatasetName) } if v.DatasetOrg != nil { ok := object.Key("datasetOrg") if err := awsRestjson1_serializeDocumentDatasetOrgAttributes(v.DatasetOrg, ok); err != nil { return err } } if v.RecordLength != nil { ok := object.Key("recordLength") if err := awsRestjson1_serializeDocumentRecordLength(v.RecordLength, ok); err != nil { return err } } if v.RelativePath != nil { ok := object.Key("relativePath") ok.String(*v.RelativePath) } if v.StorageType != nil { ok := object.Key("storageType") ok.String(*v.StorageType) } return nil } func awsRestjson1_serializeDocumentDataSetImportConfig(v types.DataSetImportConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.DataSetImportConfigMemberDataSets: av := object.Key("dataSets") if err := awsRestjson1_serializeDocumentDataSetImportList(uv.Value, av); err != nil { return err } case *types.DataSetImportConfigMemberS3Location: av := object.Key("s3Location") av.String(uv.Value) default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) } return nil } func awsRestjson1_serializeDocumentDataSetImportItem(v *types.DataSetImportItem, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DataSet != nil { ok := object.Key("dataSet") if err := awsRestjson1_serializeDocumentDataSet(v.DataSet, ok); err != nil { return err } } if v.ExternalLocation != nil { ok := object.Key("externalLocation") if err := awsRestjson1_serializeDocumentExternalLocation(v.ExternalLocation, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDataSetImportList(v []types.DataSetImportItem, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentDataSetImportItem(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentDatasetOrgAttributes(v types.DatasetOrgAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.DatasetOrgAttributesMemberGdg: av := object.Key("gdg") if err := awsRestjson1_serializeDocumentGdgAttributes(&uv.Value, av); err != nil { return err } case *types.DatasetOrgAttributesMemberPo: av := object.Key("po") if err := awsRestjson1_serializeDocumentPoAttributes(&uv.Value, av); err != nil { return err } case *types.DatasetOrgAttributesMemberPs: av := object.Key("ps") if err := awsRestjson1_serializeDocumentPsAttributes(&uv.Value, av); err != nil { return err } case *types.DatasetOrgAttributesMemberVsam: av := object.Key("vsam") if err := awsRestjson1_serializeDocumentVsamAttributes(&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_serializeDocumentDefinition(v types.Definition, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.DefinitionMemberContent: av := object.Key("content") av.String(uv.Value) case *types.DefinitionMemberS3Location: av := object.Key("s3Location") av.String(uv.Value) default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) } return nil } func awsRestjson1_serializeDocumentEfsStorageConfiguration(v *types.EfsStorageConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FileSystemId != nil { ok := object.Key("file-system-id") ok.String(*v.FileSystemId) } if v.MountPoint != nil { ok := object.Key("mount-point") ok.String(*v.MountPoint) } return nil } func awsRestjson1_serializeDocumentExternalLocation(v types.ExternalLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.ExternalLocationMemberS3Location: av := object.Key("s3Location") av.String(uv.Value) default: return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) } return nil } func awsRestjson1_serializeDocumentFileBatchJobIdentifier(v *types.FileBatchJobIdentifier, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FileName != nil { ok := object.Key("fileName") ok.String(*v.FileName) } if v.FolderPath != nil { ok := object.Key("folderPath") ok.String(*v.FolderPath) } return nil } func awsRestjson1_serializeDocumentFsxStorageConfiguration(v *types.FsxStorageConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.FileSystemId != nil { ok := object.Key("file-system-id") ok.String(*v.FileSystemId) } if v.MountPoint != nil { ok := object.Key("mount-point") ok.String(*v.MountPoint) } return nil } func awsRestjson1_serializeDocumentGdgAttributes(v *types.GdgAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Limit != 0 { ok := object.Key("limit") ok.Integer(v.Limit) } if v.RollDisposition != nil { ok := object.Key("rollDisposition") ok.String(*v.RollDisposition) } return nil } func awsRestjson1_serializeDocumentHighAvailabilityConfig(v *types.HighAvailabilityConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DesiredCapacity != nil { ok := object.Key("desiredCapacity") ok.Integer(*v.DesiredCapacity) } return nil } func awsRestjson1_serializeDocumentPoAttributes(v *types.PoAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Encoding != nil { ok := object.Key("encoding") ok.String(*v.Encoding) } if v.Format != nil { ok := object.Key("format") ok.String(*v.Format) } if v.MemberFileExtensions != nil { ok := object.Key("memberFileExtensions") if err := awsRestjson1_serializeDocumentString20List(v.MemberFileExtensions, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentPrimaryKey(v *types.PrimaryKey, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("length") ok.Integer(v.Length) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } { ok := object.Key("offset") ok.Integer(v.Offset) } return nil } func awsRestjson1_serializeDocumentPsAttributes(v *types.PsAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Encoding != nil { ok := object.Key("encoding") ok.String(*v.Encoding) } if v.Format != nil { ok := object.Key("format") ok.String(*v.Format) } return nil } func awsRestjson1_serializeDocumentRecordLength(v *types.RecordLength, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("max") ok.Integer(v.Max) } { ok := object.Key("min") ok.Integer(v.Min) } return nil } func awsRestjson1_serializeDocumentScriptBatchJobIdentifier(v *types.ScriptBatchJobIdentifier, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ScriptName != nil { ok := object.Key("scriptName") ok.String(*v.ScriptName) } return nil } func awsRestjson1_serializeDocumentStorageConfiguration(v types.StorageConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() switch uv := v.(type) { case *types.StorageConfigurationMemberEfs: av := object.Key("efs") if err := awsRestjson1_serializeDocumentEfsStorageConfiguration(&uv.Value, av); err != nil { return err } case *types.StorageConfigurationMemberFsx: av := object.Key("fsx") if err := awsRestjson1_serializeDocumentFsxStorageConfiguration(&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_serializeDocumentStorageConfigurationList(v []types.StorageConfiguration, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if vv := v[i]; vv == nil { continue } if err := awsRestjson1_serializeDocumentStorageConfiguration(v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentString20List(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_serializeDocumentString50List(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentVsamAttributes(v *types.VsamAttributes, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AlternateKeys != nil { ok := object.Key("alternateKeys") if err := awsRestjson1_serializeDocumentAlternateKeyList(v.AlternateKeys, ok); err != nil { return err } } if v.Compressed { ok := object.Key("compressed") ok.Boolean(v.Compressed) } if v.Encoding != nil { ok := object.Key("encoding") ok.String(*v.Encoding) } if v.Format != nil { ok := object.Key("format") ok.String(*v.Format) } if v.PrimaryKey != nil { ok := object.Key("primaryKey") if err := awsRestjson1_serializeDocumentPrimaryKey(v.PrimaryKey, ok); err != nil { return err } } return nil }
2,916
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package m2 import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/m2/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCancelBatchJobExecution struct { } func (*validateOpCancelBatchJobExecution) ID() string { return "OperationInputValidation" } func (m *validateOpCancelBatchJobExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CancelBatchJobExecutionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCancelBatchJobExecutionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateApplication struct { } func (*validateOpCreateApplication) ID() string { return "OperationInputValidation" } func (m *validateOpCreateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateDataSetImportTask struct { } func (*validateOpCreateDataSetImportTask) ID() string { return "OperationInputValidation" } func (m *validateOpCreateDataSetImportTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateDataSetImportTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateDataSetImportTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateDeployment struct { } func (*validateOpCreateDeployment) ID() string { return "OperationInputValidation" } func (m *validateOpCreateDeployment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateDeploymentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateDeploymentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateEnvironment struct { } func (*validateOpCreateEnvironment) ID() string { return "OperationInputValidation" } func (m *validateOpCreateEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateEnvironmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteApplicationFromEnvironment struct { } func (*validateOpDeleteApplicationFromEnvironment) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteApplicationFromEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteApplicationFromEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteApplicationFromEnvironmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteApplication struct { } func (*validateOpDeleteApplication) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteEnvironment struct { } func (*validateOpDeleteEnvironment) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteEnvironmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetApplication struct { } func (*validateOpGetApplication) ID() string { return "OperationInputValidation" } func (m *validateOpGetApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetApplicationVersion struct { } func (*validateOpGetApplicationVersion) ID() string { return "OperationInputValidation" } func (m *validateOpGetApplicationVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetApplicationVersionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetApplicationVersionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetBatchJobExecution struct { } func (*validateOpGetBatchJobExecution) ID() string { return "OperationInputValidation" } func (m *validateOpGetBatchJobExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetBatchJobExecutionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetBatchJobExecutionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetDataSetDetails struct { } func (*validateOpGetDataSetDetails) ID() string { return "OperationInputValidation" } func (m *validateOpGetDataSetDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetDataSetDetailsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetDataSetDetailsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetDataSetImportTask struct { } func (*validateOpGetDataSetImportTask) ID() string { return "OperationInputValidation" } func (m *validateOpGetDataSetImportTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetDataSetImportTaskInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetDataSetImportTaskInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetDeployment struct { } func (*validateOpGetDeployment) ID() string { return "OperationInputValidation" } func (m *validateOpGetDeployment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetDeploymentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetDeploymentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetEnvironment struct { } func (*validateOpGetEnvironment) ID() string { return "OperationInputValidation" } func (m *validateOpGetEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetEnvironmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListApplicationVersions struct { } func (*validateOpListApplicationVersions) ID() string { return "OperationInputValidation" } func (m *validateOpListApplicationVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListApplicationVersionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListApplicationVersionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListBatchJobDefinitions struct { } func (*validateOpListBatchJobDefinitions) ID() string { return "OperationInputValidation" } func (m *validateOpListBatchJobDefinitions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListBatchJobDefinitionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListBatchJobDefinitionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListBatchJobExecutions struct { } func (*validateOpListBatchJobExecutions) ID() string { return "OperationInputValidation" } func (m *validateOpListBatchJobExecutions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListBatchJobExecutionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListBatchJobExecutionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDataSetImportHistory struct { } func (*validateOpListDataSetImportHistory) ID() string { return "OperationInputValidation" } func (m *validateOpListDataSetImportHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDataSetImportHistoryInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDataSetImportHistoryInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDataSets struct { } func (*validateOpListDataSets) ID() string { return "OperationInputValidation" } func (m *validateOpListDataSets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDataSetsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDataSetsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListDeployments struct { } func (*validateOpListDeployments) ID() string { return "OperationInputValidation" } func (m *validateOpListDeployments) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListDeploymentsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListDeploymentsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTagsForResource struct { } func (*validateOpListTagsForResource) ID() string { return "OperationInputValidation" } func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsForResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsForResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartApplication struct { } func (*validateOpStartApplication) ID() string { return "OperationInputValidation" } func (m *validateOpStartApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartBatchJob struct { } func (*validateOpStartBatchJob) ID() string { return "OperationInputValidation" } func (m *validateOpStartBatchJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartBatchJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartBatchJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopApplication struct { } func (*validateOpStopApplication) ID() string { return "OperationInputValidation" } func (m *validateOpStopApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateApplication struct { } func (*validateOpUpdateApplication) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateApplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateApplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateEnvironment struct { } func (*validateOpUpdateEnvironment) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateEnvironmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCancelBatchJobExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelBatchJobExecution{}, middleware.After) } func addOpCreateApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateApplication{}, middleware.After) } func addOpCreateDataSetImportTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataSetImportTask{}, middleware.After) } func addOpCreateDeploymentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDeployment{}, middleware.After) } func addOpCreateEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateEnvironment{}, middleware.After) } func addOpDeleteApplicationFromEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteApplicationFromEnvironment{}, middleware.After) } func addOpDeleteApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteApplication{}, middleware.After) } func addOpDeleteEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteEnvironment{}, middleware.After) } func addOpGetApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetApplication{}, middleware.After) } func addOpGetApplicationVersionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetApplicationVersion{}, middleware.After) } func addOpGetBatchJobExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetBatchJobExecution{}, middleware.After) } func addOpGetDataSetDetailsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDataSetDetails{}, middleware.After) } func addOpGetDataSetImportTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDataSetImportTask{}, middleware.After) } func addOpGetDeploymentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDeployment{}, middleware.After) } func addOpGetEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEnvironment{}, middleware.After) } func addOpListApplicationVersionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListApplicationVersions{}, middleware.After) } func addOpListBatchJobDefinitionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListBatchJobDefinitions{}, middleware.After) } func addOpListBatchJobExecutionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListBatchJobExecutions{}, middleware.After) } func addOpListDataSetImportHistoryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDataSetImportHistory{}, middleware.After) } func addOpListDataSetsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDataSets{}, middleware.After) } func addOpListDeploymentsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDeployments{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpStartApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartApplication{}, middleware.After) } func addOpStartBatchJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartBatchJob{}, middleware.After) } func addOpStopApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopApplication{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateApplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateApplication{}, middleware.After) } func addOpUpdateEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateEnvironment{}, middleware.After) } func validateAlternateKey(v *types.AlternateKey) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AlternateKey"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateAlternateKeyList(v []types.AlternateKey) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AlternateKeyList"} for i := range v { if err := validateAlternateKey(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateBatchJobIdentifier(v types.BatchJobIdentifier) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BatchJobIdentifier"} switch uv := v.(type) { case *types.BatchJobIdentifierMemberFileBatchJobIdentifier: if err := validateFileBatchJobIdentifier(&uv.Value); err != nil { invalidParams.AddNested("[fileBatchJobIdentifier]", err.(smithy.InvalidParamsError)) } case *types.BatchJobIdentifierMemberScriptBatchJobIdentifier: if err := validateScriptBatchJobIdentifier(&uv.Value); err != nil { invalidParams.AddNested("[scriptBatchJobIdentifier]", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDataSet(v *types.DataSet) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DataSet"} if v.DatasetName == nil { invalidParams.Add(smithy.NewErrParamRequired("DatasetName")) } if v.DatasetOrg == nil { invalidParams.Add(smithy.NewErrParamRequired("DatasetOrg")) } else if v.DatasetOrg != nil { if err := validateDatasetOrgAttributes(v.DatasetOrg); err != nil { invalidParams.AddNested("DatasetOrg", err.(smithy.InvalidParamsError)) } } if v.RecordLength == nil { invalidParams.Add(smithy.NewErrParamRequired("RecordLength")) } else if v.RecordLength != nil { if err := validateRecordLength(v.RecordLength); err != nil { invalidParams.AddNested("RecordLength", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDataSetImportConfig(v types.DataSetImportConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DataSetImportConfig"} switch uv := v.(type) { case *types.DataSetImportConfigMemberDataSets: if err := validateDataSetImportList(uv.Value); err != nil { invalidParams.AddNested("[dataSets]", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDataSetImportItem(v *types.DataSetImportItem) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DataSetImportItem"} if v.DataSet == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSet")) } else if v.DataSet != nil { if err := validateDataSet(v.DataSet); err != nil { invalidParams.AddNested("DataSet", err.(smithy.InvalidParamsError)) } } if v.ExternalLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("ExternalLocation")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDataSetImportList(v []types.DataSetImportItem) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DataSetImportList"} for i := range v { if err := validateDataSetImportItem(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDatasetOrgAttributes(v types.DatasetOrgAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DatasetOrgAttributes"} switch uv := v.(type) { case *types.DatasetOrgAttributesMemberPo: if err := validatePoAttributes(&uv.Value); err != nil { invalidParams.AddNested("[po]", err.(smithy.InvalidParamsError)) } case *types.DatasetOrgAttributesMemberPs: if err := validatePsAttributes(&uv.Value); err != nil { invalidParams.AddNested("[ps]", err.(smithy.InvalidParamsError)) } case *types.DatasetOrgAttributesMemberVsam: if err := validateVsamAttributes(&uv.Value); err != nil { invalidParams.AddNested("[vsam]", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateEfsStorageConfiguration(v *types.EfsStorageConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EfsStorageConfiguration"} if v.FileSystemId == nil { invalidParams.Add(smithy.NewErrParamRequired("FileSystemId")) } if v.MountPoint == nil { invalidParams.Add(smithy.NewErrParamRequired("MountPoint")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateFileBatchJobIdentifier(v *types.FileBatchJobIdentifier) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "FileBatchJobIdentifier"} if v.FileName == nil { invalidParams.Add(smithy.NewErrParamRequired("FileName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateFsxStorageConfiguration(v *types.FsxStorageConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "FsxStorageConfiguration"} if v.FileSystemId == nil { invalidParams.Add(smithy.NewErrParamRequired("FileSystemId")) } if v.MountPoint == nil { invalidParams.Add(smithy.NewErrParamRequired("MountPoint")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateHighAvailabilityConfig(v *types.HighAvailabilityConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "HighAvailabilityConfig"} if v.DesiredCapacity == nil { invalidParams.Add(smithy.NewErrParamRequired("DesiredCapacity")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePoAttributes(v *types.PoAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PoAttributes"} if v.Format == nil { invalidParams.Add(smithy.NewErrParamRequired("Format")) } if v.MemberFileExtensions == nil { invalidParams.Add(smithy.NewErrParamRequired("MemberFileExtensions")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePrimaryKey(v *types.PrimaryKey) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PrimaryKey"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePsAttributes(v *types.PsAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PsAttributes"} if v.Format == nil { invalidParams.Add(smithy.NewErrParamRequired("Format")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRecordLength(v *types.RecordLength) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RecordLength"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateScriptBatchJobIdentifier(v *types.ScriptBatchJobIdentifier) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ScriptBatchJobIdentifier"} if v.ScriptName == nil { invalidParams.Add(smithy.NewErrParamRequired("ScriptName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateStorageConfiguration(v types.StorageConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StorageConfiguration"} switch uv := v.(type) { case *types.StorageConfigurationMemberEfs: if err := validateEfsStorageConfiguration(&uv.Value); err != nil { invalidParams.AddNested("[efs]", err.(smithy.InvalidParamsError)) } case *types.StorageConfigurationMemberFsx: if err := validateFsxStorageConfiguration(&uv.Value); err != nil { invalidParams.AddNested("[fsx]", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateStorageConfigurationList(v []types.StorageConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StorageConfigurationList"} for i := range v { if err := validateStorageConfiguration(v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateVsamAttributes(v *types.VsamAttributes) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "VsamAttributes"} if v.Format == nil { invalidParams.Add(smithy.NewErrParamRequired("Format")) } if v.PrimaryKey != nil { if err := validatePrimaryKey(v.PrimaryKey); err != nil { invalidParams.AddNested("PrimaryKey", err.(smithy.InvalidParamsError)) } } if v.AlternateKeys != nil { if err := validateAlternateKeyList(v.AlternateKeys); err != nil { invalidParams.AddNested("AlternateKeys", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCancelBatchJobExecutionInput(v *CancelBatchJobExecutionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CancelBatchJobExecutionInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.ExecutionId == nil { invalidParams.Add(smithy.NewErrParamRequired("ExecutionId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateApplicationInput(v *CreateApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateApplicationInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if len(v.EngineType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("EngineType")) } if v.Definition == nil { invalidParams.Add(smithy.NewErrParamRequired("Definition")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateDataSetImportTaskInput(v *CreateDataSetImportTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateDataSetImportTaskInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.ImportConfig == nil { invalidParams.Add(smithy.NewErrParamRequired("ImportConfig")) } else if v.ImportConfig != nil { if err := validateDataSetImportConfig(v.ImportConfig); err != nil { invalidParams.AddNested("ImportConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateDeploymentInput(v *CreateDeploymentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateDeploymentInput"} if v.EnvironmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("EnvironmentId")) } if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.ApplicationVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateEnvironmentInput(v *CreateEnvironmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateEnvironmentInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.InstanceType == nil { invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) } if len(v.EngineType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("EngineType")) } if v.StorageConfigurations != nil { if err := validateStorageConfigurationList(v.StorageConfigurations); err != nil { invalidParams.AddNested("StorageConfigurations", err.(smithy.InvalidParamsError)) } } if v.HighAvailabilityConfig != nil { if err := validateHighAvailabilityConfig(v.HighAvailabilityConfig); err != nil { invalidParams.AddNested("HighAvailabilityConfig", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteApplicationFromEnvironmentInput(v *DeleteApplicationFromEnvironmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationFromEnvironmentInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.EnvironmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("EnvironmentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteApplicationInput(v *DeleteApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteEnvironmentInput(v *DeleteEnvironmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteEnvironmentInput"} if v.EnvironmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("EnvironmentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetApplicationInput(v *GetApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetApplicationInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetApplicationVersionInput(v *GetApplicationVersionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetApplicationVersionInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.ApplicationVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetBatchJobExecutionInput(v *GetBatchJobExecutionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetBatchJobExecutionInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.ExecutionId == nil { invalidParams.Add(smithy.NewErrParamRequired("ExecutionId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetDataSetDetailsInput(v *GetDataSetDetailsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetDataSetDetailsInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.DataSetName == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSetName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetDataSetImportTaskInput(v *GetDataSetImportTaskInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetDataSetImportTaskInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.TaskId == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetDeploymentInput(v *GetDeploymentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetDeploymentInput"} if v.DeploymentId == nil { invalidParams.Add(smithy.NewErrParamRequired("DeploymentId")) } if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetEnvironmentInput(v *GetEnvironmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetEnvironmentInput"} if v.EnvironmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("EnvironmentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListApplicationVersionsInput(v *ListApplicationVersionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListApplicationVersionsInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListBatchJobDefinitionsInput(v *ListBatchJobDefinitionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListBatchJobDefinitionsInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListBatchJobExecutionsInput(v *ListBatchJobExecutionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListBatchJobExecutionsInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDataSetImportHistoryInput(v *ListDataSetImportHistoryInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDataSetImportHistoryInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDataSetsInput(v *ListDataSetsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDataSetsInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListDeploymentsInput(v *ListDeploymentsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListDeploymentsInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartApplicationInput(v *StartApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartApplicationInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartBatchJobInput(v *StartBatchJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartBatchJobInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.BatchJobIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("BatchJobIdentifier")) } else if v.BatchJobIdentifier != nil { if err := validateBatchJobIdentifier(v.BatchJobIdentifier); err != nil { invalidParams.AddNested("BatchJobIdentifier", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopApplicationInput(v *StopApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopApplicationInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateApplicationInput(v *UpdateApplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateApplicationInput"} if v.ApplicationId == nil { invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) } if v.CurrentApplicationVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentApplicationVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateEnvironmentInput(v *UpdateEnvironmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateEnvironmentInput"} if v.EnvironmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("EnvironmentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,588
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 m2 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: "m2.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "m2-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "m2-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "m2.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", Variant: endpoints.FIPSVariant, }: {}, endpoints.EndpointKey{ Region: "eu-central-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{ Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-east-2", }: endpoints.Endpoint{ Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-1", }: endpoints.Endpoint{ Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-2", }: endpoints.Endpoint{ Deprecated: aws.TrueTernary, }, 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, }: {}, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: {}, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: {}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: {}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "m2.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "m2-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "m2-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "m2.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "m2-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "m2.{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: "m2-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "m2.{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: "m2-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "m2.{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: "m2-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "m2.{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: "m2.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "m2-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "m2-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "m2.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
389
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 ApplicationDeploymentLifecycle string // Enum values for ApplicationDeploymentLifecycle const ( ApplicationDeploymentLifecycleDeploying ApplicationDeploymentLifecycle = "Deploying" ApplicationDeploymentLifecycleDeployed ApplicationDeploymentLifecycle = "Deployed" ) // Values returns all known values for ApplicationDeploymentLifecycle. 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 (ApplicationDeploymentLifecycle) Values() []ApplicationDeploymentLifecycle { return []ApplicationDeploymentLifecycle{ "Deploying", "Deployed", } } type ApplicationLifecycle string // Enum values for ApplicationLifecycle const ( ApplicationLifecycleCreating ApplicationLifecycle = "Creating" ApplicationLifecycleCreated ApplicationLifecycle = "Created" ApplicationLifecycleAvailable ApplicationLifecycle = "Available" ApplicationLifecycleReady ApplicationLifecycle = "Ready" ApplicationLifecycleStarting ApplicationLifecycle = "Starting" ApplicationLifecycleRunning ApplicationLifecycle = "Running" ApplicationLifecycleStopping ApplicationLifecycle = "Stopping" ApplicationLifecycleStopped ApplicationLifecycle = "Stopped" ApplicationLifecycleFailed ApplicationLifecycle = "Failed" ApplicationLifecycleDeleting ApplicationLifecycle = "Deleting" ApplicationLifecycleDeletingFromEnvironment ApplicationLifecycle = "Deleting From Environment" ) // Values returns all known values for ApplicationLifecycle. 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 (ApplicationLifecycle) Values() []ApplicationLifecycle { return []ApplicationLifecycle{ "Creating", "Created", "Available", "Ready", "Starting", "Running", "Stopping", "Stopped", "Failed", "Deleting", "Deleting From Environment", } } type ApplicationVersionLifecycle string // Enum values for ApplicationVersionLifecycle const ( ApplicationVersionLifecycleCreating ApplicationVersionLifecycle = "Creating" ApplicationVersionLifecycleAvailable ApplicationVersionLifecycle = "Available" ApplicationVersionLifecycleFailed ApplicationVersionLifecycle = "Failed" ) // Values returns all known values for ApplicationVersionLifecycle. 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 (ApplicationVersionLifecycle) Values() []ApplicationVersionLifecycle { return []ApplicationVersionLifecycle{ "Creating", "Available", "Failed", } } type BatchJobExecutionStatus string // Enum values for BatchJobExecutionStatus const ( BatchJobExecutionStatusSubmitting BatchJobExecutionStatus = "Submitting" BatchJobExecutionStatusHolding BatchJobExecutionStatus = "Holding" BatchJobExecutionStatusDispatch BatchJobExecutionStatus = "Dispatching" BatchJobExecutionStatusRunning BatchJobExecutionStatus = "Running" BatchJobExecutionStatusCancelling BatchJobExecutionStatus = "Cancelling" BatchJobExecutionStatusCancelled BatchJobExecutionStatus = "Cancelled" BatchJobExecutionStatusSucceeded BatchJobExecutionStatus = "Succeeded" BatchJobExecutionStatusFailed BatchJobExecutionStatus = "Failed" BatchJobExecutionStatusSucceededWithWarning BatchJobExecutionStatus = "Succeeded With Warning" ) // Values returns all known values for BatchJobExecutionStatus. 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 (BatchJobExecutionStatus) Values() []BatchJobExecutionStatus { return []BatchJobExecutionStatus{ "Submitting", "Holding", "Dispatching", "Running", "Cancelling", "Cancelled", "Succeeded", "Failed", "Succeeded With Warning", } } type BatchJobType string // Enum values for BatchJobType const ( BatchJobTypeVse BatchJobType = "VSE" BatchJobTypeJes2 BatchJobType = "JES2" BatchJobTypeJes3 BatchJobType = "JES3" ) // Values returns all known values for BatchJobType. 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 (BatchJobType) Values() []BatchJobType { return []BatchJobType{ "VSE", "JES2", "JES3", } } type DataSetTaskLifecycle string // Enum values for DataSetTaskLifecycle const ( DataSetTaskLifecycleCreating DataSetTaskLifecycle = "Creating" DataSetTaskLifecycleRunning DataSetTaskLifecycle = "Running" DataSetTaskLifecycleCompleted DataSetTaskLifecycle = "Completed" ) // Values returns all known values for DataSetTaskLifecycle. 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 (DataSetTaskLifecycle) Values() []DataSetTaskLifecycle { return []DataSetTaskLifecycle{ "Creating", "Running", "Completed", } } type DeploymentLifecycle string // Enum values for DeploymentLifecycle const ( DeploymentLifecycleDeploying DeploymentLifecycle = "Deploying" DeploymentLifecycleSucceeded DeploymentLifecycle = "Succeeded" DeploymentLifecycleFailed DeploymentLifecycle = "Failed" ) // Values returns all known values for DeploymentLifecycle. 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 (DeploymentLifecycle) Values() []DeploymentLifecycle { return []DeploymentLifecycle{ "Deploying", "Succeeded", "Failed", } } type EngineType string // Enum values for EngineType const ( EngineTypeMicrofocus EngineType = "microfocus" EngineTypeBluage EngineType = "bluage" ) // Values returns all known values for EngineType. 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 (EngineType) Values() []EngineType { return []EngineType{ "microfocus", "bluage", } } type EnvironmentLifecycle string // Enum values for EnvironmentLifecycle const ( EnvironmentLifecycleCreating EnvironmentLifecycle = "Creating" EnvironmentLifecycleAvailable EnvironmentLifecycle = "Available" EnvironmentLifecycleDeleting EnvironmentLifecycle = "Deleting" EnvironmentLifecycleFailed EnvironmentLifecycle = "Failed" EnvironmentLifecycleUpdating EnvironmentLifecycle = "Updating" ) // Values returns all known values for EnvironmentLifecycle. 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 (EnvironmentLifecycle) Values() []EnvironmentLifecycle { return []EnvironmentLifecycle{ "Creating", "Available", "Deleting", "Failed", "Updating", } } type ValidationExceptionReason string // Enum values for ValidationExceptionReason const ( ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "unknownOperation" ValidationExceptionReasonCannotParse ValidationExceptionReason = "cannotParse" ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" ValidationExceptionReasonOther ValidationExceptionReason = "other" ) // Values returns all known values for ValidationExceptionReason. Note that this // can be expanded in the future, and so it is only as up to date as the client. // The ordering of this slice is not guaranteed to be stable across updates. func (ValidationExceptionReason) Values() []ValidationExceptionReason { return []ValidationExceptionReason{ "unknownOperation", "cannotParse", "fieldValidationFailed", "other", } }
235
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // The account or role doesn't have the right permissions to make the request. type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The parameters provided in the request conflict with existing resources. type ConflictException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType *string noSmithyDocumentSerde } func (e *ConflictException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConflictException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConflictException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConflictException" } return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An unexpected error occurred during the processing of the request. type InternalServerException struct { Message *string ErrorCodeOverride *string RetryAfterSeconds int32 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 specified resource was not found. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType *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 } // One or more quotas for Amazon Web Services Mainframe Modernization exceeds the // limit. type ServiceQuotaExceededException struct { Message *string ErrorCodeOverride *string ResourceId *string ResourceType *string ServiceCode *string QuotaCode *string noSmithyDocumentSerde } func (e *ServiceQuotaExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceQuotaExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceQuotaExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceQuotaExceededException" } return *e.ErrorCodeOverride } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The number of requests made exceeds the limit. type ThrottlingException struct { Message *string ErrorCodeOverride *string ServiceCode *string QuotaCode *string RetryAfterSeconds int32 noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // One or more parameters provided in the request is not valid. type ValidationException struct { Message *string ErrorCodeOverride *string Reason ValidationExceptionReason FieldList []ValidationExceptionField noSmithyDocumentSerde } func (e *ValidationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ValidationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ValidationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ValidationException" } return *e.ErrorCodeOverride } func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
212
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" ) // Defines an alternate key. This value is optional. A legacy data set might not // have any alternate key defined but if those alternate keys definitions exist, // provide them, as some applications will make use of them. type AlternateKey struct { // A strictly positive integer value representing the length of the alternate key. // // This member is required. Length int32 // A positive integer value representing the offset to mark the start of the // alternate key part in the record byte array. // // This member is required. Offset int32 // Indicates whether the alternate key values are supposed to be unique for the // given data set. AllowDuplicates bool // The name of the alternate key. Name *string noSmithyDocumentSerde } // A subset of the possible application attributes. Used in the application list. type ApplicationSummary struct { // The Amazon Resource Name (ARN) of the application. // // This member is required. ApplicationArn *string // The unique identifier of the application. // // This member is required. ApplicationId *string // The version of the application. // // This member is required. ApplicationVersion *int32 // The timestamp when the application was created. // // This member is required. CreationTime *time.Time // The type of the target platform for this application. // // This member is required. EngineType EngineType // The name of the application. // // This member is required. Name *string // The status of the application. // // This member is required. Status ApplicationLifecycle // Indicates either an ongoing deployment or if the application has ever deployed // successfully. DeploymentStatus ApplicationDeploymentLifecycle // The description of the application. Description *string // The unique identifier of the runtime environment that hosts this application. EnvironmentId *string // The timestamp when you last started the application. Null until the application // runs for the first time. LastStartTime *time.Time // The Amazon Resource Name (ARN) of the role associated with the application. RoleArn *string // Indicates the status of the latest version of the application. VersionStatus ApplicationVersionLifecycle noSmithyDocumentSerde } // Defines an application version summary. type ApplicationVersionSummary struct { // The application version. // // This member is required. ApplicationVersion *int32 // The timestamp when the application version was created. // // This member is required. CreationTime *time.Time // The status of the application. // // This member is required. Status ApplicationVersionLifecycle // The reason for the reported status. StatusReason *string noSmithyDocumentSerde } // Defines the details of a batch job. // // The following types satisfy this interface: // // BatchJobDefinitionMemberFileBatchJobDefinition // BatchJobDefinitionMemberScriptBatchJobDefinition type BatchJobDefinition interface { isBatchJobDefinition() } // Specifies a file containing a batch job definition. type BatchJobDefinitionMemberFileBatchJobDefinition struct { Value FileBatchJobDefinition noSmithyDocumentSerde } func (*BatchJobDefinitionMemberFileBatchJobDefinition) isBatchJobDefinition() {} // A script containing a batch job definition. type BatchJobDefinitionMemberScriptBatchJobDefinition struct { Value ScriptBatchJobDefinition noSmithyDocumentSerde } func (*BatchJobDefinitionMemberScriptBatchJobDefinition) isBatchJobDefinition() {} // A subset of the possible batch job attributes. Used in the batch job list. type BatchJobExecutionSummary struct { // The unique identifier of the application that hosts this batch job. // // This member is required. ApplicationId *string // The unique identifier of this execution of the batch job. // // This member is required. ExecutionId *string // The timestamp when a particular batch job execution started. // // This member is required. StartTime *time.Time // The status of a particular batch job execution. // // This member is required. Status BatchJobExecutionStatus // The unique identifier of this batch job. BatchJobIdentifier BatchJobIdentifier // The timestamp when this batch job execution ended. EndTime *time.Time // The unique identifier of a particular batch job. JobId *string // The name of a particular batch job. JobName *string // The type of a particular batch job execution. JobType BatchJobType // The batch job return code from either the Blu Age or Micro Focus runtime // engines. For more information, see Batch return codes (https://www.ibm.com/docs/en/was/8.5.5?topic=model-batch-return-codes) // in the IBM WebSphere Application Server documentation. ReturnCode *string noSmithyDocumentSerde } // Identifies a specific batch job. // // The following types satisfy this interface: // // BatchJobIdentifierMemberFileBatchJobIdentifier // BatchJobIdentifierMemberScriptBatchJobIdentifier type BatchJobIdentifier interface { isBatchJobIdentifier() } // Specifies a file associated with a specific batch job. type BatchJobIdentifierMemberFileBatchJobIdentifier struct { Value FileBatchJobIdentifier noSmithyDocumentSerde } func (*BatchJobIdentifierMemberFileBatchJobIdentifier) isBatchJobIdentifier() {} // A batch job identifier in which the batch job to run is identified by the // script name. type BatchJobIdentifierMemberScriptBatchJobIdentifier struct { Value ScriptBatchJobIdentifier noSmithyDocumentSerde } func (*BatchJobIdentifierMemberScriptBatchJobIdentifier) isBatchJobIdentifier() {} // Defines a data set. type DataSet struct { // The logical identifier for a specific data set (in mainframe format). // // This member is required. DatasetName *string // The type of dataset. The only supported value is VSAM. // // This member is required. DatasetOrg DatasetOrgAttributes // The length of a record. // // This member is required. RecordLength *RecordLength // The relative location of the data set in the database or file system. RelativePath *string // The storage type of the data set: database or file system. For Micro Focus, // database corresponds to datastore and file system corresponds to EFS/FSX. For // Blu Age, there is no support of file system and database corresponds to Blusam. StorageType *string noSmithyDocumentSerde } // Additional details about the data set. Different attributes correspond to // different data set organizations. The values are populated based on datasetOrg, // storageType and backend (Blu Age or Micro Focus). // // The following types satisfy this interface: // // DatasetDetailOrgAttributesMemberGdg // DatasetDetailOrgAttributesMemberPo // DatasetDetailOrgAttributesMemberPs // DatasetDetailOrgAttributesMemberVsam type DatasetDetailOrgAttributes interface { isDatasetDetailOrgAttributes() } // The generation data group of the data set. type DatasetDetailOrgAttributesMemberGdg struct { Value GdgDetailAttributes noSmithyDocumentSerde } func (*DatasetDetailOrgAttributesMemberGdg) isDatasetDetailOrgAttributes() {} // The details of a PO type data set. type DatasetDetailOrgAttributesMemberPo struct { Value PoDetailAttributes noSmithyDocumentSerde } func (*DatasetDetailOrgAttributesMemberPo) isDatasetDetailOrgAttributes() {} // The details of a PS type data set. type DatasetDetailOrgAttributesMemberPs struct { Value PsDetailAttributes noSmithyDocumentSerde } func (*DatasetDetailOrgAttributesMemberPs) isDatasetDetailOrgAttributes() {} // The details of a VSAM data set. type DatasetDetailOrgAttributesMemberVsam struct { Value VsamDetailAttributes noSmithyDocumentSerde } func (*DatasetDetailOrgAttributesMemberVsam) isDatasetDetailOrgAttributes() {} // Identifies one or more data sets you want to import with the // CreateDataSetImportTask operation. // // The following types satisfy this interface: // // DataSetImportConfigMemberDataSets // DataSetImportConfigMemberS3Location type DataSetImportConfig interface { isDataSetImportConfig() } // The data sets. type DataSetImportConfigMemberDataSets struct { Value []DataSetImportItem noSmithyDocumentSerde } func (*DataSetImportConfigMemberDataSets) isDataSetImportConfig() {} // The Amazon S3 location of the data sets. type DataSetImportConfigMemberS3Location struct { Value string noSmithyDocumentSerde } func (*DataSetImportConfigMemberS3Location) isDataSetImportConfig() {} // Identifies a specific data set to import from an external location. type DataSetImportItem struct { // The data set. // // This member is required. DataSet *DataSet // The location of the data set. // // This member is required. ExternalLocation ExternalLocation noSmithyDocumentSerde } // Represents a summary of data set imports. type DataSetImportSummary struct { // The number of data set imports that have failed. // // This member is required. Failed int32 // The number of data set imports that are in progress. // // This member is required. InProgress int32 // The number of data set imports that are pending. // // This member is required. Pending int32 // The number of data set imports that have succeeded. // // This member is required. Succeeded int32 // The total number of data set imports. // // This member is required. Total int32 noSmithyDocumentSerde } // Contains information about a data set import task. type DataSetImportTask struct { // The status of the data set import task. // // This member is required. Status DataSetTaskLifecycle // A summary of the data set import task. // // This member is required. Summary *DataSetImportSummary // The identifier of the data set import task. // // This member is required. TaskId *string noSmithyDocumentSerde } // Additional details about the data set. Different attributes correspond to // different data set organizations. The values are populated based on datasetOrg, // storageType and backend (Blu Age or Micro Focus). // // The following types satisfy this interface: // // DatasetOrgAttributesMemberGdg // DatasetOrgAttributesMemberPo // DatasetOrgAttributesMemberPs // DatasetOrgAttributesMemberVsam type DatasetOrgAttributes interface { isDatasetOrgAttributes() } // The generation data group of the data set. type DatasetOrgAttributesMemberGdg struct { Value GdgAttributes noSmithyDocumentSerde } func (*DatasetOrgAttributesMemberGdg) isDatasetOrgAttributes() {} // The details of a PO type data set. type DatasetOrgAttributesMemberPo struct { Value PoAttributes noSmithyDocumentSerde } func (*DatasetOrgAttributesMemberPo) isDatasetOrgAttributes() {} // The details of a PS type data set. type DatasetOrgAttributesMemberPs struct { Value PsAttributes noSmithyDocumentSerde } func (*DatasetOrgAttributesMemberPs) isDatasetOrgAttributes() {} // The details of a VSAM data set. type DatasetOrgAttributesMemberVsam struct { Value VsamAttributes noSmithyDocumentSerde } func (*DatasetOrgAttributesMemberVsam) isDatasetOrgAttributes() {} // A subset of the possible data set attributes. type DataSetSummary struct { // The name of the data set. // // This member is required. DataSetName *string // The timestamp when the data set was created. CreationTime *time.Time // The type of data set. The only supported value is VSAM. DataSetOrg *string // The format of the data set. Format *string // The last time the data set was referenced. LastReferencedTime *time.Time // The last time the data set was updated. LastUpdatedTime *time.Time noSmithyDocumentSerde } // The application definition for a particular application. // // The following types satisfy this interface: // // DefinitionMemberContent // DefinitionMemberS3Location type Definition interface { isDefinition() } // The content of the application definition. This is a JSON object that contains // the resource configuration/definitions that identify an application. type DefinitionMemberContent struct { Value string noSmithyDocumentSerde } func (*DefinitionMemberContent) isDefinition() {} // The S3 bucket that contains the application definition. type DefinitionMemberS3Location struct { Value string noSmithyDocumentSerde } func (*DefinitionMemberS3Location) isDefinition() {} // Contains a summary of a deployed application. type DeployedVersionSummary struct { // The version of the deployed application. // // This member is required. ApplicationVersion *int32 // The status of the deployment. // // This member is required. Status DeploymentLifecycle // The reason for the reported status. StatusReason *string noSmithyDocumentSerde } // A subset of information about a specific deployment. type DeploymentSummary struct { // The unique identifier of the application. // // This member is required. ApplicationId *string // The version of the application. // // This member is required. ApplicationVersion *int32 // The timestamp when the deployment was created. // // This member is required. CreationTime *time.Time // The unique identifier of the deployment. // // This member is required. DeploymentId *string // The unique identifier of the runtime environment. // // This member is required. EnvironmentId *string // The current status of the deployment. // // This member is required. Status DeploymentLifecycle // The reason for the reported status. StatusReason *string noSmithyDocumentSerde } // Defines the storage configuration for an Amazon EFS file system. type EfsStorageConfiguration struct { // The file system identifier. // // This member is required. FileSystemId *string // The mount point for the file system. // // This member is required. MountPoint *string noSmithyDocumentSerde } // A subset of information about the engine version for a specific application. type EngineVersionsSummary struct { // The type of target platform for the application. // // This member is required. EngineType *string // The version of the engine type used by the application. // // This member is required. EngineVersion *string noSmithyDocumentSerde } // Contains a subset of the possible runtime environment attributes. Used in the // environment list. type EnvironmentSummary struct { // The timestamp when the runtime environment was created. // // This member is required. CreationTime *time.Time // The target platform for the runtime environment. // // This member is required. EngineType EngineType // The version of the runtime engine. // // This member is required. EngineVersion *string // The Amazon Resource Name (ARN) of a particular runtime environment. // // This member is required. EnvironmentArn *string // The unique identifier of a particular runtime environment. // // This member is required. EnvironmentId *string // The instance type of the runtime environment. // // This member is required. InstanceType *string // The name of the runtime environment. // // This member is required. Name *string // The status of the runtime environment // // This member is required. Status EnvironmentLifecycle noSmithyDocumentSerde } // Defines an external storage location. // // The following types satisfy this interface: // // ExternalLocationMemberS3Location type ExternalLocation interface { isExternalLocation() } // The URI of the Amazon S3 bucket. type ExternalLocationMemberS3Location struct { Value string noSmithyDocumentSerde } func (*ExternalLocationMemberS3Location) isExternalLocation() {} // A file containing a batch job definition. type FileBatchJobDefinition struct { // The name of the file containing the batch job definition. // // This member is required. FileName *string // The path to the file containing the batch job definition. FolderPath *string noSmithyDocumentSerde } // A batch job identifier in which the batch job to run is identified by the file // name and the relative path to the file name. type FileBatchJobIdentifier struct { // The file name for the batch job identifier. // // This member is required. FileName *string // The relative path to the file name for the batch job identifier. FolderPath *string noSmithyDocumentSerde } // Defines the storage configuration for an Amazon FSx file system. type FsxStorageConfiguration struct { // The file system identifier. // // This member is required. FileSystemId *string // The mount point for the file system. // // This member is required. MountPoint *string noSmithyDocumentSerde } // The required attributes for a generation data group data set. A generation data // set is one of a collection of successive, historically related, catalogued data // sets that together are known as a generation data group (GDG). Use this // structure when you want to import a GDG. For more information on GDG, see // Generation data sets (https://www.ibm.com/docs/en/zos/2.3.0?topic=guide-generation-data-sets) // . type GdgAttributes struct { // The maximum number of generation data sets, up to 255, in a GDG. Limit int32 // The disposition of the data set in the catalog. RollDisposition *string noSmithyDocumentSerde } // The required attributes for a generation data group data set. A generation data // set is one of a collection of successive, historically related, catalogued data // sets that together are known as a generation data group (GDG). Use this // structure when you want to import a GDG. For more information on GDG, see // Generation data sets (https://www.ibm.com/docs/en/zos/2.3.0?topic=guide-generation-data-sets) // . type GdgDetailAttributes struct { // The maximum number of generation data sets, up to 255, in a GDG. Limit int32 // The disposition of the data set in the catalog. RollDisposition *string noSmithyDocumentSerde } // Defines the details of a high availability configuration. type HighAvailabilityConfig struct { // The number of instances in a high availability configuration. // // This member is required. DesiredCapacity *int32 noSmithyDocumentSerde } // A subset of the attributes that describe a log group. In CloudWatch a log group // is a group of log streams that share the same retention, monitoring, and access // control settings. type LogGroupSummary struct { // The name of the log group. // // This member is required. LogGroupName *string // The type of log. // // This member is required. LogType *string noSmithyDocumentSerde } // The information about the maintenance schedule. type MaintenanceSchedule struct { // The time the scheduled maintenance is to end. EndTime *time.Time // The time the scheduled maintenance is to start. StartTime *time.Time noSmithyDocumentSerde } // The scheduled maintenance for a runtime engine. type PendingMaintenance struct { // The specific runtime engine that the maintenance schedule applies to. EngineVersion *string // The maintenance schedule for the runtime engine version. Schedule *MaintenanceSchedule noSmithyDocumentSerde } // The supported properties for a PO type data set. type PoAttributes struct { // The format of the data set records. // // This member is required. Format *string // An array containing one or more filename extensions, allowing you to specify // which files to be included as PDS member. // // This member is required. MemberFileExtensions []string // The character set encoding of the data set. Encoding *string noSmithyDocumentSerde } // The supported properties for a PO type data set. type PoDetailAttributes struct { // The character set encoding of the data set. // // This member is required. Encoding *string // The format of the data set records. // // This member is required. Format *string noSmithyDocumentSerde } // The primary key for a KSDS data set. type PrimaryKey struct { // A strictly positive integer value representing the length of the primary key. // // This member is required. Length int32 // A positive integer value representing the offset to mark the start of the // primary key in the record byte array. // // This member is required. Offset int32 // A name for the Primary Key. Name *string noSmithyDocumentSerde } // The supported properties for a PS type data set. type PsAttributes struct { // The format of the data set records. // // This member is required. Format *string // The character set encoding of the data set. Encoding *string noSmithyDocumentSerde } // The supported properties for a PS type data set. type PsDetailAttributes struct { // The character set encoding of the data set. // // This member is required. Encoding *string // The format of the data set records. // // This member is required. Format *string noSmithyDocumentSerde } // The length of the records in the data set. type RecordLength struct { // The maximum record length. In case of fixed, both minimum and maximum are the // same. // // This member is required. Max int32 // The minimum record length of a record. // // This member is required. Min int32 noSmithyDocumentSerde } // A batch job definition contained in a script. type ScriptBatchJobDefinition struct { // The name of the script containing the batch job definition. // // This member is required. ScriptName *string noSmithyDocumentSerde } // A batch job identifier in which the batch job to run is identified by the // script name. type ScriptBatchJobIdentifier struct { // The name of the script containing the batch job definition. // // This member is required. ScriptName *string noSmithyDocumentSerde } // Defines the storage configuration for a runtime environment. // // The following types satisfy this interface: // // StorageConfigurationMemberEfs // StorageConfigurationMemberFsx type StorageConfiguration interface { isStorageConfiguration() } // Defines the storage configuration for an Amazon EFS file system. type StorageConfigurationMemberEfs struct { Value EfsStorageConfiguration noSmithyDocumentSerde } func (*StorageConfigurationMemberEfs) isStorageConfiguration() {} // Defines the storage configuration for an Amazon FSx file system. type StorageConfigurationMemberFsx struct { Value FsxStorageConfiguration noSmithyDocumentSerde } func (*StorageConfigurationMemberFsx) isStorageConfiguration() {} // Contains information about a validation exception field. type ValidationExceptionField struct { // The message of the exception field. // // This member is required. Message *string // The name of the exception field. // // This member is required. Name *string noSmithyDocumentSerde } // The attributes of a VSAM type data set. type VsamAttributes struct { // The record format of the data set. // // This member is required. Format *string // The alternate key definitions, if any. A legacy dataset might not have any // alternate key defined, but if those alternate keys definitions exist, provide // them as some applications will make use of them. AlternateKeys []AlternateKey // Indicates whether indexes for this dataset are stored as compressed values. If // you have a large data set (typically > 100 Mb), consider setting this flag to // True. Compressed bool // The character set used by the data set. Can be ASCII, EBCDIC, or unknown. Encoding *string // The primary key of the data set. PrimaryKey *PrimaryKey noSmithyDocumentSerde } // The attributes of a VSAM type data set. type VsamDetailAttributes struct { // The alternate key definitions, if any. A legacy dataset might not have any // alternate key defined, but if those alternate keys definitions exist, provide // them as some applications will make use of them. AlternateKeys []AlternateKey // If set to True, enforces loading the data set into cache before it’s used by // the application. CacheAtStartup *bool // Indicates whether indexes for this dataset are stored as compressed values. If // you have a large data set (typically > 100 Mb), consider setting this flag to // True. Compressed *bool // The character set used by the data set. Can be ASCII, EBCDIC, or unknown. Encoding *string // The primary key of the data set. PrimaryKey *PrimaryKey // The record format of the data set. RecordFormat *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) isBatchJobDefinition() {} func (*UnknownUnionMember) isBatchJobIdentifier() {} func (*UnknownUnionMember) isDatasetDetailOrgAttributes() {} func (*UnknownUnionMember) isDataSetImportConfig() {} func (*UnknownUnionMember) isDatasetOrgAttributes() {} func (*UnknownUnionMember) isDefinition() {} func (*UnknownUnionMember) isExternalLocation() {} func (*UnknownUnionMember) isStorageConfiguration() {}
1,037
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/m2/types" ) func ExampleBatchJobDefinition_outputUsage() { var union types.BatchJobDefinition // type switches can be used to check the union value switch v := union.(type) { case *types.BatchJobDefinitionMemberFileBatchJobDefinition: _ = v.Value // Value is types.FileBatchJobDefinition case *types.BatchJobDefinitionMemberScriptBatchJobDefinition: _ = v.Value // Value is types.ScriptBatchJobDefinition case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ *types.ScriptBatchJobDefinition var _ *types.FileBatchJobDefinition func ExampleBatchJobIdentifier_outputUsage() { var union types.BatchJobIdentifier // type switches can be used to check the union value switch v := union.(type) { case *types.BatchJobIdentifierMemberFileBatchJobIdentifier: _ = v.Value // Value is types.FileBatchJobIdentifier case *types.BatchJobIdentifierMemberScriptBatchJobIdentifier: _ = v.Value // Value is types.ScriptBatchJobIdentifier case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ *types.FileBatchJobIdentifier var _ *types.ScriptBatchJobIdentifier func ExampleDatasetDetailOrgAttributes_outputUsage() { var union types.DatasetDetailOrgAttributes // type switches can be used to check the union value switch v := union.(type) { case *types.DatasetDetailOrgAttributesMemberGdg: _ = v.Value // Value is types.GdgDetailAttributes case *types.DatasetDetailOrgAttributesMemberPo: _ = v.Value // Value is types.PoDetailAttributes case *types.DatasetDetailOrgAttributesMemberPs: _ = v.Value // Value is types.PsDetailAttributes case *types.DatasetDetailOrgAttributesMemberVsam: _ = v.Value // Value is types.VsamDetailAttributes case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ *types.PoDetailAttributes var _ *types.VsamDetailAttributes var _ *types.PsDetailAttributes var _ *types.GdgDetailAttributes func ExampleDataSetImportConfig_outputUsage() { var union types.DataSetImportConfig // type switches can be used to check the union value switch v := union.(type) { case *types.DataSetImportConfigMemberDataSets: _ = v.Value // Value is []types.DataSetImportItem case *types.DataSetImportConfigMemberS3Location: _ = 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 var _ []types.DataSetImportItem func ExampleDatasetOrgAttributes_outputUsage() { var union types.DatasetOrgAttributes // type switches can be used to check the union value switch v := union.(type) { case *types.DatasetOrgAttributesMemberGdg: _ = v.Value // Value is types.GdgAttributes case *types.DatasetOrgAttributesMemberPo: _ = v.Value // Value is types.PoAttributes case *types.DatasetOrgAttributesMemberPs: _ = v.Value // Value is types.PsAttributes case *types.DatasetOrgAttributesMemberVsam: _ = v.Value // Value is types.VsamAttributes case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ *types.PsAttributes var _ *types.GdgAttributes var _ *types.VsamAttributes var _ *types.PoAttributes func ExampleDefinition_outputUsage() { var union types.Definition // type switches can be used to check the union value switch v := union.(type) { case *types.DefinitionMemberContent: _ = v.Value // Value is string case *types.DefinitionMemberS3Location: _ = 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 var _ *string func ExampleExternalLocation_outputUsage() { var union types.ExternalLocation // type switches can be used to check the union value switch v := union.(type) { case *types.ExternalLocationMemberS3Location: _ = 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 func ExampleStorageConfiguration_outputUsage() { var union types.StorageConfiguration // type switches can be used to check the union value switch v := union.(type) { case *types.StorageConfigurationMemberEfs: _ = v.Value // Value is types.EfsStorageConfiguration case *types.StorageConfigurationMemberFsx: _ = v.Value // Value is types.FsxStorageConfiguration case *types.UnknownUnionMember: fmt.Println("unknown tag:", v.Tag) default: fmt.Println("union is nil or unknown type") } } var _ *types.FsxStorageConfiguration var _ *types.EfsStorageConfiguration
197
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "Machine Learning" const ServiceAPIVersion = "2014-12-12" // Client provides the API client to make operations call for Amazon Machine // Learning. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "machinelearning", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
435
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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 machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds one or more tags to an object, up to a limit of 10. Each tag consists of a // key and an optional value. If you add a tag using a key that is already // associated with the ML object, AddTags updates the tag's value. func (c *Client) AddTags(ctx context.Context, params *AddTagsInput, optFns ...func(*Options)) (*AddTagsOutput, error) { if params == nil { params = &AddTagsInput{} } result, metadata, err := c.invokeOperation(ctx, "AddTags", params, optFns, c.addOperationAddTagsMiddlewares) if err != nil { return nil, err } out := result.(*AddTagsOutput) out.ResultMetadata = metadata return out, nil } type AddTagsInput struct { // The ID of the ML object to tag. For example, exampleModelId . // // This member is required. ResourceId *string // The type of the ML object to tag. // // This member is required. ResourceType types.TaggableResourceType // The key-value pairs to use to create tags. If you specify a key without // specifying a value, Amazon ML creates a tag with the specified key and a value // of null. // // This member is required. Tags []types.Tag noSmithyDocumentSerde } // Amazon ML returns the following elements. type AddTagsOutput struct { // The ID of the ML object that was tagged. ResourceId *string // The type of the ML object that was tagged. ResourceType types.TaggableResourceType // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAddTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAddTags{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAddTags{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAddTagsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTags(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opAddTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "AddTags", } }
143
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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" ) // Generates predictions for a group of observations. The observations to process // exist in one or more data files referenced by a DataSource . This operation // creates a new BatchPrediction , and uses an MLModel and the data files // referenced by the DataSource as information sources. CreateBatchPrediction is // an asynchronous operation. In response to CreateBatchPrediction , Amazon Machine // Learning (Amazon ML) immediately returns and sets the BatchPrediction status to // PENDING . After the BatchPrediction completes, Amazon ML sets the status to // COMPLETED . You can poll for status updates by using the GetBatchPrediction // operation and checking the Status parameter of the result. After the COMPLETED // status appears, the results are available in the location specified by the // OutputUri parameter. func (c *Client) CreateBatchPrediction(ctx context.Context, params *CreateBatchPredictionInput, optFns ...func(*Options)) (*CreateBatchPredictionOutput, error) { if params == nil { params = &CreateBatchPredictionInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateBatchPrediction", params, optFns, c.addOperationCreateBatchPredictionMiddlewares) if err != nil { return nil, err } out := result.(*CreateBatchPredictionOutput) out.ResultMetadata = metadata return out, nil } type CreateBatchPredictionInput struct { // The ID of the DataSource that points to the group of observations to predict. // // This member is required. BatchPredictionDataSourceId *string // A user-supplied ID that uniquely identifies the BatchPrediction . // // This member is required. BatchPredictionId *string // The ID of the MLModel that will generate predictions for the group of // observations. // // This member is required. MLModelId *string // The location of an Amazon Simple Storage Service (Amazon S3) bucket or // directory to store the batch prediction results. The following substrings are // not allowed in the s3 key portion of the outputURI field: ':', '//', '/./', // '/../'. Amazon ML needs permissions to store and retrieve the logs on your // behalf. For information about how to set permissions, see the Amazon Machine // Learning Developer Guide (https://docs.aws.amazon.com/machine-learning/latest/dg) // . // // This member is required. OutputUri *string // A user-supplied name or description of the BatchPrediction . BatchPredictionName // can only use the UTF-8 character set. BatchPredictionName *string noSmithyDocumentSerde } // Represents the output of a CreateBatchPrediction operation, and is an // acknowledgement that Amazon ML received the request. The CreateBatchPrediction // operation is asynchronous. You can poll for status updates by using the // >GetBatchPrediction operation and checking the Status parameter of the result. type CreateBatchPredictionOutput struct { // A user-supplied ID that uniquely identifies the BatchPrediction . This value is // identical to the value of the BatchPredictionId in the request. BatchPredictionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateBatchPredictionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateBatchPrediction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateBatchPrediction{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateBatchPredictionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBatchPrediction(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateBatchPrediction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "CreateBatchPrediction", } }
165
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a DataSource object from an Amazon Relational Database Service (http://aws.amazon.com/rds/) // (Amazon RDS). A DataSource references data that can be used to perform // CreateMLModel , CreateEvaluation , or CreateBatchPrediction operations. // CreateDataSourceFromRDS is an asynchronous operation. In response to // CreateDataSourceFromRDS , Amazon Machine Learning (Amazon ML) immediately // returns and sets the DataSource status to PENDING . After the DataSource is // created and ready for use, Amazon ML sets the Status parameter to COMPLETED . // DataSource in the COMPLETED or PENDING state can be used only to perform // >CreateMLModel >, CreateEvaluation , or CreateBatchPrediction operations. If // Amazon ML cannot accept the input source, it sets the Status parameter to FAILED // and includes an error message in the Message attribute of the GetDataSource // operation response. func (c *Client) CreateDataSourceFromRDS(ctx context.Context, params *CreateDataSourceFromRDSInput, optFns ...func(*Options)) (*CreateDataSourceFromRDSOutput, error) { if params == nil { params = &CreateDataSourceFromRDSInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDataSourceFromRDS", params, optFns, c.addOperationCreateDataSourceFromRDSMiddlewares) if err != nil { return nil, err } out := result.(*CreateDataSourceFromRDSOutput) out.ResultMetadata = metadata return out, nil } type CreateDataSourceFromRDSInput struct { // A user-supplied ID that uniquely identifies the DataSource . Typically, an // Amazon Resource Number (ARN) becomes the ID for a DataSource . // // This member is required. DataSourceId *string // The data specification of an Amazon RDS DataSource : // - DatabaseInformation - // - DatabaseName - The name of the Amazon RDS database. // - InstanceIdentifier - A unique identifier for the Amazon RDS database // instance. // - DatabaseCredentials - AWS Identity and Access Management (IAM) credentials // that are used to connect to the Amazon RDS database. // - ResourceRole - A role (DataPipelineDefaultResourceRole) assumed by an EC2 // instance to carry out the copy task from Amazon RDS to Amazon Simple Storage // Service (Amazon S3). For more information, see Role templates (https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-iam-roles.html) // for data pipelines. // - ServiceRole - A role (DataPipelineDefaultRole) assumed by the AWS Data // Pipeline service to monitor the progress of the copy task from Amazon RDS to // Amazon S3. For more information, see Role templates (https://docs.aws.amazon.com/datapipeline/latest/DeveloperGuide/dp-iam-roles.html) // for data pipelines. // - SecurityInfo - The security information to use to access an RDS DB // instance. You need to set up appropriate ingress rules for the security entity // IDs provided to allow access to the Amazon RDS instance. Specify a [ SubnetId // , SecurityGroupIds ] pair for a VPC-based RDS DB instance. // - SelectSqlQuery - A query that is used to retrieve the observation data for // the Datasource . // - S3StagingLocation - The Amazon S3 location for staging Amazon RDS data. The // data retrieved from Amazon RDS using SelectSqlQuery is stored in this // location. // - DataSchemaUri - The Amazon S3 location of the DataSchema . // - DataSchema - A JSON string representing the schema. This is not required if // DataSchemaUri is specified. // - DataRearrangement - A JSON string that represents the splitting and // rearrangement requirements for the Datasource . Sample - // "{\"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}" // // This member is required. RDSData *types.RDSDataSpec // The role that Amazon ML assumes on behalf of the user to create and activate a // data pipeline in the user's account and copy data using the SelectSqlQuery // query from Amazon RDS to Amazon S3. // // This member is required. RoleARN *string // The compute statistics for a DataSource . The statistics are generated from the // observation data referenced by a DataSource . Amazon ML uses the statistics // internally during MLModel training. This parameter must be set to true if the // DataSource needs to be used for MLModel training. ComputeStatistics bool // A user-supplied name or description of the DataSource . DataSourceName *string noSmithyDocumentSerde } // Represents the output of a CreateDataSourceFromRDS operation, and is an // acknowledgement that Amazon ML received the request. The CreateDataSourceFromRDS // > operation is asynchronous. You can poll for updates by using the // GetBatchPrediction operation and checking the Status parameter. You can inspect // the Message when Status shows up as FAILED . You can also check the progress of // the copy operation by going to the DataPipeline console and looking up the // pipeline using the pipelineId from the describe call. type CreateDataSourceFromRDSOutput struct { // A user-supplied ID that uniquely identifies the datasource. This value should // be identical to the value of the DataSourceID in the request. DataSourceId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDataSourceFromRDSMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDataSourceFromRDS{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDataSourceFromRDS{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateDataSourceFromRDSValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataSourceFromRDS(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateDataSourceFromRDS(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "CreateDataSourceFromRDS", } }
195
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a DataSource from a database hosted on an Amazon Redshift cluster. A // DataSource references data that can be used to perform either CreateMLModel , // CreateEvaluation , or CreateBatchPrediction operations. // CreateDataSourceFromRedshift is an asynchronous operation. In response to // CreateDataSourceFromRedshift , Amazon Machine Learning (Amazon ML) immediately // returns and sets the DataSource status to PENDING . After the DataSource is // created and ready for use, Amazon ML sets the Status parameter to COMPLETED . // DataSource in COMPLETED or PENDING states can be used to perform only // CreateMLModel , CreateEvaluation , or CreateBatchPrediction operations. If // Amazon ML can't accept the input source, it sets the Status parameter to FAILED // and includes an error message in the Message attribute of the GetDataSource // operation response. The observations should be contained in the database hosted // on an Amazon Redshift cluster and should be specified by a SelectSqlQuery // query. Amazon ML executes an Unload command in Amazon Redshift to transfer the // result set of the SelectSqlQuery query to S3StagingLocation . After the // DataSource has been created, it's ready for use in evaluations and batch // predictions. If you plan to use the DataSource to train an MLModel , the // DataSource also requires a recipe. A recipe describes how each input variable // will be used in training an MLModel . Will the variable be included or excluded // from training? Will the variable be manipulated; for example, will it be // combined with another variable or will it be split apart into word combinations? // The recipe provides answers to these questions. You can't change an existing // datasource, but you can copy and modify the settings from an existing Amazon // Redshift datasource to create a new datasource. To do so, call GetDataSource // for an existing datasource and copy the values to a CreateDataSource call. // Change the settings that you want to change and make sure that all required // fields have the appropriate values. func (c *Client) CreateDataSourceFromRedshift(ctx context.Context, params *CreateDataSourceFromRedshiftInput, optFns ...func(*Options)) (*CreateDataSourceFromRedshiftOutput, error) { if params == nil { params = &CreateDataSourceFromRedshiftInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDataSourceFromRedshift", params, optFns, c.addOperationCreateDataSourceFromRedshiftMiddlewares) if err != nil { return nil, err } out := result.(*CreateDataSourceFromRedshiftOutput) out.ResultMetadata = metadata return out, nil } type CreateDataSourceFromRedshiftInput struct { // A user-supplied ID that uniquely identifies the DataSource . // // This member is required. DataSourceId *string // The data specification of an Amazon Redshift DataSource : // - DatabaseInformation - // - DatabaseName - The name of the Amazon Redshift database. // - ClusterIdentifier - The unique ID for the Amazon Redshift cluster. // - DatabaseCredentials - The AWS Identity and Access Management (IAM) // credentials that are used to connect to the Amazon Redshift database. // - SelectSqlQuery - The query that is used to retrieve the observation data // for the Datasource . // - S3StagingLocation - The Amazon Simple Storage Service (Amazon S3) location // for staging Amazon Redshift data. The data retrieved from Amazon Redshift using // the SelectSqlQuery query is stored in this location. // - DataSchemaUri - The Amazon S3 location of the DataSchema . // - DataSchema - A JSON string representing the schema. This is not required if // DataSchemaUri is specified. // - DataRearrangement - A JSON string that represents the splitting and // rearrangement requirements for the DataSource . Sample - // "{\"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}" // // This member is required. DataSpec *types.RedshiftDataSpec // A fully specified role Amazon Resource Name (ARN). Amazon ML assumes the role // on behalf of the user to create the following: // - A security group to allow Amazon ML to execute the SelectSqlQuery query on // an Amazon Redshift cluster // - An Amazon S3 bucket policy to grant Amazon ML read/write permissions on the // S3StagingLocation // // This member is required. RoleARN *string // The compute statistics for a DataSource . The statistics are generated from the // observation data referenced by a DataSource . Amazon ML uses the statistics // internally during MLModel training. This parameter must be set to true if the // DataSource needs to be used for MLModel training. ComputeStatistics bool // A user-supplied name or description of the DataSource . DataSourceName *string noSmithyDocumentSerde } // Represents the output of a CreateDataSourceFromRedshift operation, and is an // acknowledgement that Amazon ML received the request. The // CreateDataSourceFromRedshift operation is asynchronous. You can poll for updates // by using the GetBatchPrediction operation and checking the Status parameter. type CreateDataSourceFromRedshiftOutput struct { // A user-supplied ID that uniquely identifies the datasource. This value should // be identical to the value of the DataSourceID in the request. DataSourceId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDataSourceFromRedshiftMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDataSourceFromRedshift{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDataSourceFromRedshift{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateDataSourceFromRedshiftValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataSourceFromRedshift(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateDataSourceFromRedshift(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "CreateDataSourceFromRedshift", } }
196
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a DataSource object. A DataSource references data that can be used to // perform CreateMLModel , CreateEvaluation , or CreateBatchPrediction operations. // CreateDataSourceFromS3 is an asynchronous operation. In response to // CreateDataSourceFromS3 , Amazon Machine Learning (Amazon ML) immediately returns // and sets the DataSource status to PENDING . After the DataSource has been // created and is ready for use, Amazon ML sets the Status parameter to COMPLETED . // DataSource in the COMPLETED or PENDING state can be used to perform only // CreateMLModel , CreateEvaluation or CreateBatchPrediction operations. If Amazon // ML can't accept the input source, it sets the Status parameter to FAILED and // includes an error message in the Message attribute of the GetDataSource // operation response. The observation data used in a DataSource should be ready // to use; that is, it should have a consistent structure, and missing data values // should be kept to a minimum. The observation data must reside in one or more // .csv files in an Amazon Simple Storage Service (Amazon S3) location, along with // a schema that describes the data items by name and type. The same schema must be // used for all of the data files referenced by the DataSource . After the // DataSource has been created, it's ready to use in evaluations and batch // predictions. If you plan to use the DataSource to train an MLModel , the // DataSource also needs a recipe. A recipe describes how each input variable will // be used in training an MLModel . Will the variable be included or excluded from // training? Will the variable be manipulated; for example, will it be combined // with another variable or will it be split apart into word combinations? The // recipe provides answers to these questions. func (c *Client) CreateDataSourceFromS3(ctx context.Context, params *CreateDataSourceFromS3Input, optFns ...func(*Options)) (*CreateDataSourceFromS3Output, error) { if params == nil { params = &CreateDataSourceFromS3Input{} } result, metadata, err := c.invokeOperation(ctx, "CreateDataSourceFromS3", params, optFns, c.addOperationCreateDataSourceFromS3Middlewares) if err != nil { return nil, err } out := result.(*CreateDataSourceFromS3Output) out.ResultMetadata = metadata return out, nil } type CreateDataSourceFromS3Input struct { // A user-supplied identifier that uniquely identifies the DataSource . // // This member is required. DataSourceId *string // The data specification of a DataSource : // - DataLocationS3 - The Amazon S3 location of the observation data. // - DataSchemaLocationS3 - The Amazon S3 location of the DataSchema . // - DataSchema - A JSON string representing the schema. This is not required if // DataSchemaUri is specified. // - DataRearrangement - A JSON string that represents the splitting and // rearrangement requirements for the Datasource . Sample - // "{\"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}" // // This member is required. DataSpec *types.S3DataSpec // The compute statistics for a DataSource . The statistics are generated from the // observation data referenced by a DataSource . Amazon ML uses the statistics // internally during MLModel training. This parameter must be set to true if the // DataSource needs to be used for MLModel training. ComputeStatistics bool // A user-supplied name or description of the DataSource . DataSourceName *string noSmithyDocumentSerde } // Represents the output of a CreateDataSourceFromS3 operation, and is an // acknowledgement that Amazon ML received the request. The CreateDataSourceFromS3 // operation is asynchronous. You can poll for updates by using the // GetBatchPrediction operation and checking the Status parameter. type CreateDataSourceFromS3Output struct { // A user-supplied ID that uniquely identifies the DataSource . This value should // be identical to the value of the DataSourceID in the request. DataSourceId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDataSourceFromS3Middlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDataSourceFromS3{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDataSourceFromS3{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateDataSourceFromS3ValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataSourceFromS3(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateDataSourceFromS3(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "CreateDataSourceFromS3", } }
173
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new Evaluation of an MLModel . An MLModel is evaluated on a set of // observations associated to a DataSource . Like a DataSource for an MLModel , the // DataSource for an Evaluation contains values for the Target Variable . The // Evaluation compares the predicted result for each observation to the actual // outcome and provides a summary so that you know how effective the MLModel // functions on the test data. Evaluation generates a relevant performance metric, // such as BinaryAUC, RegressionRMSE or MulticlassAvgFScore based on the // corresponding MLModelType : BINARY , REGRESSION or MULTICLASS . CreateEvaluation // is an asynchronous operation. In response to CreateEvaluation , Amazon Machine // Learning (Amazon ML) immediately returns and sets the evaluation status to // PENDING . After the Evaluation is created and ready for use, Amazon ML sets the // status to COMPLETED . You can use the GetEvaluation operation to check progress // of the evaluation during the creation operation. func (c *Client) CreateEvaluation(ctx context.Context, params *CreateEvaluationInput, optFns ...func(*Options)) (*CreateEvaluationOutput, error) { if params == nil { params = &CreateEvaluationInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateEvaluation", params, optFns, c.addOperationCreateEvaluationMiddlewares) if err != nil { return nil, err } out := result.(*CreateEvaluationOutput) out.ResultMetadata = metadata return out, nil } type CreateEvaluationInput struct { // The ID of the DataSource for the evaluation. The schema of the DataSource must // match the schema used to create the MLModel . // // This member is required. EvaluationDataSourceId *string // A user-supplied ID that uniquely identifies the Evaluation . // // This member is required. EvaluationId *string // The ID of the MLModel to evaluate. The schema used in creating the MLModel must // match the schema of the DataSource used in the Evaluation . // // This member is required. MLModelId *string // A user-supplied name or description of the Evaluation . EvaluationName *string noSmithyDocumentSerde } // Represents the output of a CreateEvaluation operation, and is an // acknowledgement that Amazon ML received the request. CreateEvaluation operation // is asynchronous. You can poll for status updates by using the GetEvcaluation // operation and checking the Status parameter. type CreateEvaluationOutput struct { // The user-supplied ID that uniquely identifies the Evaluation . This value should // be identical to the value of the EvaluationId in the request. EvaluationId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateEvaluationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateEvaluation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateEvaluation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateEvaluationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEvaluation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateEvaluation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "CreateEvaluation", } }
156
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new MLModel using the DataSource and the recipe as information // sources. An MLModel is nearly immutable. Users can update only the MLModelName // and the ScoreThreshold in an MLModel without creating a new MLModel . // CreateMLModel is an asynchronous operation. In response to CreateMLModel , // Amazon Machine Learning (Amazon ML) immediately returns and sets the MLModel // status to PENDING . After the MLModel has been created and ready is for use, // Amazon ML sets the status to COMPLETED . You can use the GetMLModel operation // to check the progress of the MLModel during the creation operation. // CreateMLModel requires a DataSource with computed statistics, which can be // created by setting ComputeStatistics to true in CreateDataSourceFromRDS , // CreateDataSourceFromS3 , or CreateDataSourceFromRedshift operations. func (c *Client) CreateMLModel(ctx context.Context, params *CreateMLModelInput, optFns ...func(*Options)) (*CreateMLModelOutput, error) { if params == nil { params = &CreateMLModelInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateMLModel", params, optFns, c.addOperationCreateMLModelMiddlewares) if err != nil { return nil, err } out := result.(*CreateMLModelOutput) out.ResultMetadata = metadata return out, nil } type CreateMLModelInput struct { // A user-supplied ID that uniquely identifies the MLModel . // // This member is required. MLModelId *string // The category of supervised learning that this MLModel will address. Choose from // the following types: // - Choose REGRESSION if the MLModel will be used to predict a numeric value. // - Choose BINARY if the MLModel result has two possible values. // - Choose MULTICLASS if the MLModel result has a limited number of values. // For more information, see the Amazon Machine Learning Developer Guide (https://docs.aws.amazon.com/machine-learning/latest/dg) // . // // This member is required. MLModelType types.MLModelType // The DataSource that points to the training data. // // This member is required. TrainingDataSourceId *string // A user-supplied name or description of the MLModel . MLModelName *string // A list of the training parameters in the MLModel . The list is implemented as a // map of key-value pairs. The following is the current set of training parameters: // // - sgd.maxMLModelSizeInBytes - The maximum allowed size of the model. Depending // on the input data, the size of the model might affect its performance. The value // is an integer that ranges from 100000 to 2147483648 . The default value is // 33554432 . // - sgd.maxPasses - The number of times that the training process traverses the // observations to build the MLModel . The value is an integer that ranges from 1 // to 10000 . The default value is 10 . // - sgd.shuffleType - Whether Amazon ML shuffles the training data. Shuffling // the data improves a model's ability to find the optimal solution for a variety // of data types. The valid values are auto and none . The default value is none // . We strongly recommend that you shuffle your data. // - sgd.l1RegularizationAmount - The coefficient regularization L1 norm. It // controls overfitting the data by penalizing large coefficients. This tends to // drive coefficients to zero, resulting in a sparse feature set. If you use this // parameter, start by specifying a small value, such as 1.0E-08 . The value is a // double that ranges from 0 to MAX_DOUBLE . The default is to not use L1 // normalization. This parameter can't be used when L2 is specified. Use this // parameter sparingly. // - sgd.l2RegularizationAmount - The coefficient regularization L2 norm. It // controls overfitting the data by penalizing large coefficients. This tends to // drive coefficients to small, nonzero values. If you use this parameter, start by // specifying a small value, such as 1.0E-08 . The value is a double that ranges // from 0 to MAX_DOUBLE . The default is to not use L2 normalization. This // parameter can't be used when L1 is specified. Use this parameter sparingly. Parameters map[string]string // The data recipe for creating the MLModel . You must specify either the recipe or // its URI. If you don't specify a recipe or its URI, Amazon ML creates a default. Recipe *string // The Amazon Simple Storage Service (Amazon S3) location and file name that // contains the MLModel recipe. You must specify either the recipe or its URI. If // you don't specify a recipe or its URI, Amazon ML creates a default. RecipeUri *string noSmithyDocumentSerde } // Represents the output of a CreateMLModel operation, and is an acknowledgement // that Amazon ML received the request. The CreateMLModel operation is // asynchronous. You can poll for status updates by using the GetMLModel operation // and checking the Status parameter. type CreateMLModelOutput struct { // A user-supplied ID that uniquely identifies the MLModel . This value should be // identical to the value of the MLModelId in the request. MLModelId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateMLModelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateMLModel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateMLModel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateMLModelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMLModel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateMLModel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "CreateMLModel", } }
197
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a real-time endpoint for the MLModel . The endpoint contains the URI of // the MLModel ; that is, the location to send real-time prediction requests for // the specified MLModel . func (c *Client) CreateRealtimeEndpoint(ctx context.Context, params *CreateRealtimeEndpointInput, optFns ...func(*Options)) (*CreateRealtimeEndpointOutput, error) { if params == nil { params = &CreateRealtimeEndpointInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateRealtimeEndpoint", params, optFns, c.addOperationCreateRealtimeEndpointMiddlewares) if err != nil { return nil, err } out := result.(*CreateRealtimeEndpointOutput) out.ResultMetadata = metadata return out, nil } type CreateRealtimeEndpointInput struct { // The ID assigned to the MLModel during creation. // // This member is required. MLModelId *string noSmithyDocumentSerde } // Represents the output of an CreateRealtimeEndpoint operation. The result // contains the MLModelId and the endpoint information for the MLModel . Note: The // endpoint information includes the URI of the MLModel ; that is, the location to // send online prediction requests for the specified MLModel . type CreateRealtimeEndpointOutput struct { // A user-supplied ID that uniquely identifies the MLModel . This value should be // identical to the value of the MLModelId in the request. MLModelId *string // The endpoint information of the MLModel RealtimeEndpointInfo *types.RealtimeEndpointInfo // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateRealtimeEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateRealtimeEndpoint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateRealtimeEndpoint{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateRealtimeEndpointValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRealtimeEndpoint(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateRealtimeEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "CreateRealtimeEndpoint", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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 the DELETED status to a BatchPrediction , rendering it unusable. After // using the DeleteBatchPrediction operation, you can use the GetBatchPrediction // operation to verify that the status of the BatchPrediction changed to DELETED. // Caution: The result of the DeleteBatchPrediction operation is irreversible. func (c *Client) DeleteBatchPrediction(ctx context.Context, params *DeleteBatchPredictionInput, optFns ...func(*Options)) (*DeleteBatchPredictionOutput, error) { if params == nil { params = &DeleteBatchPredictionInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteBatchPrediction", params, optFns, c.addOperationDeleteBatchPredictionMiddlewares) if err != nil { return nil, err } out := result.(*DeleteBatchPredictionOutput) out.ResultMetadata = metadata return out, nil } type DeleteBatchPredictionInput struct { // A user-supplied ID that uniquely identifies the BatchPrediction . // // This member is required. BatchPredictionId *string noSmithyDocumentSerde } // Represents the output of a DeleteBatchPrediction operation. You can use the // GetBatchPrediction operation and check the value of the Status parameter to see // whether a BatchPrediction is marked as DELETED . type DeleteBatchPredictionOutput struct { // A user-supplied ID that uniquely identifies the BatchPrediction . This value // should be identical to the value of the BatchPredictionID in the request. BatchPredictionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteBatchPredictionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteBatchPrediction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteBatchPrediction{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteBatchPredictionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBatchPrediction(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteBatchPrediction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DeleteBatchPrediction", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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 the DELETED status to a DataSource , rendering it unusable. After using // the DeleteDataSource operation, you can use the GetDataSource operation to // verify that the status of the DataSource changed to DELETED. Caution: The // results of the DeleteDataSource operation are irreversible. func (c *Client) DeleteDataSource(ctx context.Context, params *DeleteDataSourceInput, optFns ...func(*Options)) (*DeleteDataSourceOutput, error) { if params == nil { params = &DeleteDataSourceInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDataSource", params, optFns, c.addOperationDeleteDataSourceMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDataSourceOutput) out.ResultMetadata = metadata return out, nil } type DeleteDataSourceInput struct { // A user-supplied ID that uniquely identifies the DataSource . // // This member is required. DataSourceId *string noSmithyDocumentSerde } // Represents the output of a DeleteDataSource operation. type DeleteDataSourceOutput struct { // A user-supplied ID that uniquely identifies the DataSource . This value should // be identical to the value of the DataSourceID in the request. DataSourceId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDataSource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDataSource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteDataSourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDataSource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteDataSource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DeleteDataSource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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 the DELETED status to an Evaluation , rendering it unusable. After // invoking the DeleteEvaluation operation, you can use the GetEvaluation // operation to verify that the status of the Evaluation changed to DELETED . // Caution: The results of the DeleteEvaluation operation are irreversible. func (c *Client) DeleteEvaluation(ctx context.Context, params *DeleteEvaluationInput, optFns ...func(*Options)) (*DeleteEvaluationOutput, error) { if params == nil { params = &DeleteEvaluationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteEvaluation", params, optFns, c.addOperationDeleteEvaluationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteEvaluationOutput) out.ResultMetadata = metadata return out, nil } type DeleteEvaluationInput struct { // A user-supplied ID that uniquely identifies the Evaluation to delete. // // This member is required. EvaluationId *string noSmithyDocumentSerde } // Represents the output of a DeleteEvaluation operation. The output indicates // that Amazon Machine Learning (Amazon ML) received the request. You can use the // GetEvaluation operation and check the value of the Status parameter to see // whether an Evaluation is marked as DELETED . type DeleteEvaluationOutput struct { // A user-supplied ID that uniquely identifies the Evaluation . This value should // be identical to the value of the EvaluationId in the request. EvaluationId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteEvaluationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteEvaluation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteEvaluation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteEvaluationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEvaluation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteEvaluation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DeleteEvaluation", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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 the DELETED status to an MLModel , rendering it unusable. After using // the DeleteMLModel operation, you can use the GetMLModel operation to verify // that the status of the MLModel changed to DELETED. Caution: The result of the // DeleteMLModel operation is irreversible. func (c *Client) DeleteMLModel(ctx context.Context, params *DeleteMLModelInput, optFns ...func(*Options)) (*DeleteMLModelOutput, error) { if params == nil { params = &DeleteMLModelInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteMLModel", params, optFns, c.addOperationDeleteMLModelMiddlewares) if err != nil { return nil, err } out := result.(*DeleteMLModelOutput) out.ResultMetadata = metadata return out, nil } type DeleteMLModelInput struct { // A user-supplied ID that uniquely identifies the MLModel . // // This member is required. MLModelId *string noSmithyDocumentSerde } // Represents the output of a DeleteMLModel operation. You can use the GetMLModel // operation and check the value of the Status parameter to see whether an MLModel // is marked as DELETED . type DeleteMLModelOutput struct { // A user-supplied ID that uniquely identifies the MLModel . This value should be // identical to the value of the MLModelID in the request. MLModelId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteMLModelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteMLModel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteMLModel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteMLModelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMLModel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteMLModel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DeleteMLModel", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a real time endpoint of an MLModel . func (c *Client) DeleteRealtimeEndpoint(ctx context.Context, params *DeleteRealtimeEndpointInput, optFns ...func(*Options)) (*DeleteRealtimeEndpointOutput, error) { if params == nil { params = &DeleteRealtimeEndpointInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteRealtimeEndpoint", params, optFns, c.addOperationDeleteRealtimeEndpointMiddlewares) if err != nil { return nil, err } out := result.(*DeleteRealtimeEndpointOutput) out.ResultMetadata = metadata return out, nil } type DeleteRealtimeEndpointInput struct { // The ID assigned to the MLModel during creation. // // This member is required. MLModelId *string noSmithyDocumentSerde } // Represents the output of an DeleteRealtimeEndpoint operation. The result // contains the MLModelId and the endpoint information for the MLModel . type DeleteRealtimeEndpointOutput struct { // A user-supplied ID that uniquely identifies the MLModel . This value should be // identical to the value of the MLModelId in the request. MLModelId *string // The endpoint information of the MLModel RealtimeEndpointInfo *types.RealtimeEndpointInfo // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteRealtimeEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRealtimeEndpoint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRealtimeEndpoint{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteRealtimeEndpointValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRealtimeEndpoint(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteRealtimeEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DeleteRealtimeEndpoint", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the specified tags associated with an ML object. After this operation // is complete, you can't recover deleted tags. If you specify a tag that doesn't // exist, Amazon ML ignores it. func (c *Client) DeleteTags(ctx context.Context, params *DeleteTagsInput, optFns ...func(*Options)) (*DeleteTagsOutput, error) { if params == nil { params = &DeleteTagsInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteTags", params, optFns, c.addOperationDeleteTagsMiddlewares) if err != nil { return nil, err } out := result.(*DeleteTagsOutput) out.ResultMetadata = metadata return out, nil } type DeleteTagsInput struct { // The ID of the tagged ML object. For example, exampleModelId . // // This member is required. ResourceId *string // The type of the tagged ML object. // // This member is required. ResourceType types.TaggableResourceType // One or more tags to delete. // // This member is required. TagKeys []string noSmithyDocumentSerde } // Amazon ML returns the following elements. type DeleteTagsOutput struct { // The ID of the ML object from which tags were deleted. ResourceId *string // The type of the ML object from which tags were deleted. ResourceType types.TaggableResourceType // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteTags{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteTags{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteTagsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTags(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DeleteTags", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/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" ) // Returns a list of BatchPrediction operations that match the search criteria in // the request. func (c *Client) DescribeBatchPredictions(ctx context.Context, params *DescribeBatchPredictionsInput, optFns ...func(*Options)) (*DescribeBatchPredictionsOutput, error) { if params == nil { params = &DescribeBatchPredictionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeBatchPredictions", params, optFns, c.addOperationDescribeBatchPredictionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeBatchPredictionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeBatchPredictionsInput struct { // The equal to operator. The BatchPrediction results will have FilterVariable // values that exactly match the value specified with EQ . EQ *string // Use one of the following variables to filter a list of BatchPrediction : // - CreatedAt - Sets the search criteria to the BatchPrediction creation date. // - Status - Sets the search criteria to the BatchPrediction status. // - Name - Sets the search criteria to the contents of the BatchPrediction Name // . // - IAMUser - Sets the search criteria to the user account that invoked the // BatchPrediction creation. // - MLModelId - Sets the search criteria to the MLModel used in the // BatchPrediction . // - DataSourceId - Sets the search criteria to the DataSource used in the // BatchPrediction . // - DataURI - Sets the search criteria to the data file(s) used in the // BatchPrediction . The URL can identify either a file or an Amazon Simple // Storage Solution (Amazon S3) bucket or directory. FilterVariable types.BatchPredictionFilterVariable // The greater than or equal to operator. The BatchPrediction results will have // FilterVariable values that are greater than or equal to the value specified with // GE . GE *string // The greater than operator. The BatchPrediction results will have FilterVariable // values that are greater than the value specified with GT . GT *string // The less than or equal to operator. The BatchPrediction results will have // FilterVariable values that are less than or equal to the value specified with LE // . LE *string // The less than operator. The BatchPrediction results will have FilterVariable // values that are less than the value specified with LT . LT *string // The number of pages of information to include in the result. The range of // acceptable values is 1 through 100 . The default value is 100 . Limit *int32 // The not equal to operator. The BatchPrediction results will have FilterVariable // values not equal to the value specified with NE . NE *string // An ID of the page in the paginated results. NextToken *string // A string that is found at the beginning of a variable, such as Name or Id . For // example, a Batch Prediction operation could have the Name // 2014-09-09-HolidayGiftMailer . To search for this BatchPrediction , select Name // for the FilterVariable and any of the following strings for the Prefix : // - 2014-09 // - 2014-09-09 // - 2014-09-09-Holiday Prefix *string // A two-value parameter that determines the sequence of the resulting list of // MLModel s. // - asc - Arranges the list in ascending order (A-Z, 0-9). // - dsc - Arranges the list in descending order (Z-A, 9-0). // Results are sorted by FilterVariable . SortOrder types.SortOrder noSmithyDocumentSerde } // Represents the output of a DescribeBatchPredictions operation. The content is // essentially a list of BatchPrediction s. type DescribeBatchPredictionsOutput struct { // The ID of the next page in the paginated results that indicates at least one // more page follows. NextToken *string // A list of BatchPrediction objects that meet the search criteria. Results []types.BatchPrediction // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeBatchPredictionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeBatchPredictions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeBatchPredictions{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeBatchPredictions(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeBatchPredictionsAPIClient is a client that implements the // DescribeBatchPredictions operation. type DescribeBatchPredictionsAPIClient interface { DescribeBatchPredictions(context.Context, *DescribeBatchPredictionsInput, ...func(*Options)) (*DescribeBatchPredictionsOutput, error) } var _ DescribeBatchPredictionsAPIClient = (*Client)(nil) // DescribeBatchPredictionsPaginatorOptions is the paginator options for // DescribeBatchPredictions type DescribeBatchPredictionsPaginatorOptions struct { // The number of pages of information to include in the result. The range of // acceptable values is 1 through 100 . The default value 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 } // DescribeBatchPredictionsPaginator is a paginator for DescribeBatchPredictions type DescribeBatchPredictionsPaginator struct { options DescribeBatchPredictionsPaginatorOptions client DescribeBatchPredictionsAPIClient params *DescribeBatchPredictionsInput nextToken *string firstPage bool } // NewDescribeBatchPredictionsPaginator returns a new // DescribeBatchPredictionsPaginator func NewDescribeBatchPredictionsPaginator(client DescribeBatchPredictionsAPIClient, params *DescribeBatchPredictionsInput, optFns ...func(*DescribeBatchPredictionsPaginatorOptions)) *DescribeBatchPredictionsPaginator { if params == nil { params = &DescribeBatchPredictionsInput{} } options := DescribeBatchPredictionsPaginatorOptions{} if params.Limit != nil { options.Limit = *params.Limit } for _, fn := range optFns { fn(&options) } return &DescribeBatchPredictionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeBatchPredictionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeBatchPredictions page. func (p *DescribeBatchPredictionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBatchPredictionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.Limit = limit result, err := p.client.DescribeBatchPredictions(ctx, &params, 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 } // BatchPredictionAvailableWaiterOptions are waiter options for // BatchPredictionAvailableWaiter type BatchPredictionAvailableWaiterOptions 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, // BatchPredictionAvailableWaiter 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, BatchPredictionAvailableWaiter 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, *DescribeBatchPredictionsInput, *DescribeBatchPredictionsOutput, error) (bool, error) } // BatchPredictionAvailableWaiter defines the waiters for BatchPredictionAvailable type BatchPredictionAvailableWaiter struct { client DescribeBatchPredictionsAPIClient options BatchPredictionAvailableWaiterOptions } // NewBatchPredictionAvailableWaiter constructs a BatchPredictionAvailableWaiter. func NewBatchPredictionAvailableWaiter(client DescribeBatchPredictionsAPIClient, optFns ...func(*BatchPredictionAvailableWaiterOptions)) *BatchPredictionAvailableWaiter { options := BatchPredictionAvailableWaiterOptions{} options.MinDelay = 30 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = batchPredictionAvailableStateRetryable for _, fn := range optFns { fn(&options) } return &BatchPredictionAvailableWaiter{ client: client, options: options, } } // Wait calls the waiter function for BatchPredictionAvailable waiter. The // maxWaitDur is the maximum wait duration the waiter will wait. The maxWaitDur is // required and must be greater than zero. func (w *BatchPredictionAvailableWaiter) Wait(ctx context.Context, params *DescribeBatchPredictionsInput, maxWaitDur time.Duration, optFns ...func(*BatchPredictionAvailableWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for BatchPredictionAvailable 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 *BatchPredictionAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeBatchPredictionsInput, maxWaitDur time.Duration, optFns ...func(*BatchPredictionAvailableWaiterOptions)) (*DescribeBatchPredictionsOutput, 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.DescribeBatchPredictions(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 BatchPredictionAvailable waiter") } func batchPredictionAvailableStateRetryable(ctx context.Context, input *DescribeBatchPredictionsInput, output *DescribeBatchPredictionsOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("Results[].Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "COMPLETED" var match = true listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } if len(listOfValues) == 0 { match = false } for _, v := range listOfValues { value, ok := v.(types.EntityStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.EntityStatus value, got %T", pathValue) } if string(value) != expectedValue { match = false } } if match { return false, nil } } if err == nil { pathValue, err := jmespath.Search("Results[].Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "FAILED" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(types.EntityStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.EntityStatus value, got %T", pathValue) } if string(value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } return true, nil } func newServiceMetadataMiddleware_opDescribeBatchPredictions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DescribeBatchPredictions", } }
488
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/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" ) // Returns a list of DataSource that match the search criteria in the request. func (c *Client) DescribeDataSources(ctx context.Context, params *DescribeDataSourcesInput, optFns ...func(*Options)) (*DescribeDataSourcesOutput, error) { if params == nil { params = &DescribeDataSourcesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDataSources", params, optFns, c.addOperationDescribeDataSourcesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDataSourcesOutput) out.ResultMetadata = metadata return out, nil } type DescribeDataSourcesInput struct { // The equal to operator. The DataSource results will have FilterVariable values // that exactly match the value specified with EQ . EQ *string // Use one of the following variables to filter a list of DataSource : // - CreatedAt - Sets the search criteria to DataSource creation dates. // - Status - Sets the search criteria to DataSource statuses. // - Name - Sets the search criteria to the contents of DataSource Name . // - DataUri - Sets the search criteria to the URI of data files used to create // the DataSource . The URI can identify either a file or an Amazon Simple // Storage Service (Amazon S3) bucket or directory. // - IAMUser - Sets the search criteria to the user account that invoked the // DataSource creation. FilterVariable types.DataSourceFilterVariable // The greater than or equal to operator. The DataSource results will have // FilterVariable values that are greater than or equal to the value specified with // GE . GE *string // The greater than operator. The DataSource results will have FilterVariable // values that are greater than the value specified with GT . GT *string // The less than or equal to operator. The DataSource results will have // FilterVariable values that are less than or equal to the value specified with LE // . LE *string // The less than operator. The DataSource results will have FilterVariable values // that are less than the value specified with LT . LT *string // The maximum number of DataSource to include in the result. Limit *int32 // The not equal to operator. The DataSource results will have FilterVariable // values not equal to the value specified with NE . NE *string // The ID of the page in the paginated results. NextToken *string // A string that is found at the beginning of a variable, such as Name or Id . For // example, a DataSource could have the Name 2014-09-09-HolidayGiftMailer . To // search for this DataSource , select Name for the FilterVariable and any of the // following strings for the Prefix : // - 2014-09 // - 2014-09-09 // - 2014-09-09-Holiday Prefix *string // A two-value parameter that determines the sequence of the resulting list of // DataSource . // - asc - Arranges the list in ascending order (A-Z, 0-9). // - dsc - Arranges the list in descending order (Z-A, 9-0). // Results are sorted by FilterVariable . SortOrder types.SortOrder noSmithyDocumentSerde } // Represents the query results from a DescribeDataSources operation. The content // is essentially a list of DataSource . type DescribeDataSourcesOutput struct { // An ID of the next page in the paginated results that indicates at least one // more page follows. NextToken *string // A list of DataSource that meet the search criteria. Results []types.DataSource // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDataSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDataSources{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDataSources{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeDataSources(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeDataSourcesAPIClient is a client that implements the // DescribeDataSources operation. type DescribeDataSourcesAPIClient interface { DescribeDataSources(context.Context, *DescribeDataSourcesInput, ...func(*Options)) (*DescribeDataSourcesOutput, error) } var _ DescribeDataSourcesAPIClient = (*Client)(nil) // DescribeDataSourcesPaginatorOptions is the paginator options for // DescribeDataSources type DescribeDataSourcesPaginatorOptions struct { // The maximum number of DataSource to include in the result. 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 } // DescribeDataSourcesPaginator is a paginator for DescribeDataSources type DescribeDataSourcesPaginator struct { options DescribeDataSourcesPaginatorOptions client DescribeDataSourcesAPIClient params *DescribeDataSourcesInput nextToken *string firstPage bool } // NewDescribeDataSourcesPaginator returns a new DescribeDataSourcesPaginator func NewDescribeDataSourcesPaginator(client DescribeDataSourcesAPIClient, params *DescribeDataSourcesInput, optFns ...func(*DescribeDataSourcesPaginatorOptions)) *DescribeDataSourcesPaginator { if params == nil { params = &DescribeDataSourcesInput{} } options := DescribeDataSourcesPaginatorOptions{} if params.Limit != nil { options.Limit = *params.Limit } for _, fn := range optFns { fn(&options) } return &DescribeDataSourcesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDataSourcesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDataSources page. func (p *DescribeDataSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDataSourcesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.Limit = limit result, err := p.client.DescribeDataSources(ctx, &params, 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 } // DataSourceAvailableWaiterOptions are waiter options for // DataSourceAvailableWaiter type DataSourceAvailableWaiterOptions 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, // DataSourceAvailableWaiter 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, DataSourceAvailableWaiter 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, *DescribeDataSourcesInput, *DescribeDataSourcesOutput, error) (bool, error) } // DataSourceAvailableWaiter defines the waiters for DataSourceAvailable type DataSourceAvailableWaiter struct { client DescribeDataSourcesAPIClient options DataSourceAvailableWaiterOptions } // NewDataSourceAvailableWaiter constructs a DataSourceAvailableWaiter. func NewDataSourceAvailableWaiter(client DescribeDataSourcesAPIClient, optFns ...func(*DataSourceAvailableWaiterOptions)) *DataSourceAvailableWaiter { options := DataSourceAvailableWaiterOptions{} options.MinDelay = 30 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = dataSourceAvailableStateRetryable for _, fn := range optFns { fn(&options) } return &DataSourceAvailableWaiter{ client: client, options: options, } } // Wait calls the waiter function for DataSourceAvailable waiter. The maxWaitDur // is the maximum wait duration the waiter will wait. The maxWaitDur is required // and must be greater than zero. func (w *DataSourceAvailableWaiter) Wait(ctx context.Context, params *DescribeDataSourcesInput, maxWaitDur time.Duration, optFns ...func(*DataSourceAvailableWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for DataSourceAvailable 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 *DataSourceAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeDataSourcesInput, maxWaitDur time.Duration, optFns ...func(*DataSourceAvailableWaiterOptions)) (*DescribeDataSourcesOutput, 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.DescribeDataSources(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 DataSourceAvailable waiter") } func dataSourceAvailableStateRetryable(ctx context.Context, input *DescribeDataSourcesInput, output *DescribeDataSourcesOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("Results[].Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "COMPLETED" var match = true listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } if len(listOfValues) == 0 { match = false } for _, v := range listOfValues { value, ok := v.(types.EntityStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.EntityStatus value, got %T", pathValue) } if string(value) != expectedValue { match = false } } if match { return false, nil } } if err == nil { pathValue, err := jmespath.Search("Results[].Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "FAILED" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(types.EntityStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.EntityStatus value, got %T", pathValue) } if string(value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } return true, nil } func newServiceMetadataMiddleware_opDescribeDataSources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DescribeDataSources", } }
479
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/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" ) // Returns a list of DescribeEvaluations that match the search criteria in the // request. func (c *Client) DescribeEvaluations(ctx context.Context, params *DescribeEvaluationsInput, optFns ...func(*Options)) (*DescribeEvaluationsOutput, error) { if params == nil { params = &DescribeEvaluationsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEvaluations", params, optFns, c.addOperationDescribeEvaluationsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEvaluationsOutput) out.ResultMetadata = metadata return out, nil } type DescribeEvaluationsInput struct { // The equal to operator. The Evaluation results will have FilterVariable values // that exactly match the value specified with EQ . EQ *string // Use one of the following variable to filter a list of Evaluation objects: // - CreatedAt - Sets the search criteria to the Evaluation creation date. // - Status - Sets the search criteria to the Evaluation status. // - Name - Sets the search criteria to the contents of Evaluation Name . // - IAMUser - Sets the search criteria to the user account that invoked an // Evaluation . // - MLModelId - Sets the search criteria to the MLModel that was evaluated. // - DataSourceId - Sets the search criteria to the DataSource used in Evaluation // . // - DataUri - Sets the search criteria to the data file(s) used in Evaluation . // The URL can identify either a file or an Amazon Simple Storage Solution (Amazon // S3) bucket or directory. FilterVariable types.EvaluationFilterVariable // The greater than or equal to operator. The Evaluation results will have // FilterVariable values that are greater than or equal to the value specified with // GE . GE *string // The greater than operator. The Evaluation results will have FilterVariable // values that are greater than the value specified with GT . GT *string // The less than or equal to operator. The Evaluation results will have // FilterVariable values that are less than or equal to the value specified with LE // . LE *string // The less than operator. The Evaluation results will have FilterVariable values // that are less than the value specified with LT . LT *string // The maximum number of Evaluation to include in the result. Limit *int32 // The not equal to operator. The Evaluation results will have FilterVariable // values not equal to the value specified with NE . NE *string // The ID of the page in the paginated results. NextToken *string // A string that is found at the beginning of a variable, such as Name or Id . For // example, an Evaluation could have the Name 2014-09-09-HolidayGiftMailer . To // search for this Evaluation , select Name for the FilterVariable and any of the // following strings for the Prefix : // - 2014-09 // - 2014-09-09 // - 2014-09-09-Holiday Prefix *string // A two-value parameter that determines the sequence of the resulting list of // Evaluation . // - asc - Arranges the list in ascending order (A-Z, 0-9). // - dsc - Arranges the list in descending order (Z-A, 9-0). // Results are sorted by FilterVariable . SortOrder types.SortOrder noSmithyDocumentSerde } // Represents the query results from a DescribeEvaluations operation. The content // is essentially a list of Evaluation . type DescribeEvaluationsOutput struct { // The ID of the next page in the paginated results that indicates at least one // more page follows. NextToken *string // A list of Evaluation that meet the search criteria. Results []types.Evaluation // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEvaluationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEvaluations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeEvaluations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeEvaluations(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeEvaluationsAPIClient is a client that implements the // DescribeEvaluations operation. type DescribeEvaluationsAPIClient interface { DescribeEvaluations(context.Context, *DescribeEvaluationsInput, ...func(*Options)) (*DescribeEvaluationsOutput, error) } var _ DescribeEvaluationsAPIClient = (*Client)(nil) // DescribeEvaluationsPaginatorOptions is the paginator options for // DescribeEvaluations type DescribeEvaluationsPaginatorOptions struct { // The maximum number of Evaluation to include in the result. 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 } // DescribeEvaluationsPaginator is a paginator for DescribeEvaluations type DescribeEvaluationsPaginator struct { options DescribeEvaluationsPaginatorOptions client DescribeEvaluationsAPIClient params *DescribeEvaluationsInput nextToken *string firstPage bool } // NewDescribeEvaluationsPaginator returns a new DescribeEvaluationsPaginator func NewDescribeEvaluationsPaginator(client DescribeEvaluationsAPIClient, params *DescribeEvaluationsInput, optFns ...func(*DescribeEvaluationsPaginatorOptions)) *DescribeEvaluationsPaginator { if params == nil { params = &DescribeEvaluationsInput{} } options := DescribeEvaluationsPaginatorOptions{} if params.Limit != nil { options.Limit = *params.Limit } for _, fn := range optFns { fn(&options) } return &DescribeEvaluationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeEvaluationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeEvaluations page. func (p *DescribeEvaluationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEvaluationsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.Limit = limit result, err := p.client.DescribeEvaluations(ctx, &params, 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 } // EvaluationAvailableWaiterOptions are waiter options for // EvaluationAvailableWaiter type EvaluationAvailableWaiterOptions 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, // EvaluationAvailableWaiter 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, EvaluationAvailableWaiter 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, *DescribeEvaluationsInput, *DescribeEvaluationsOutput, error) (bool, error) } // EvaluationAvailableWaiter defines the waiters for EvaluationAvailable type EvaluationAvailableWaiter struct { client DescribeEvaluationsAPIClient options EvaluationAvailableWaiterOptions } // NewEvaluationAvailableWaiter constructs a EvaluationAvailableWaiter. func NewEvaluationAvailableWaiter(client DescribeEvaluationsAPIClient, optFns ...func(*EvaluationAvailableWaiterOptions)) *EvaluationAvailableWaiter { options := EvaluationAvailableWaiterOptions{} options.MinDelay = 30 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = evaluationAvailableStateRetryable for _, fn := range optFns { fn(&options) } return &EvaluationAvailableWaiter{ client: client, options: options, } } // Wait calls the waiter function for EvaluationAvailable waiter. The maxWaitDur // is the maximum wait duration the waiter will wait. The maxWaitDur is required // and must be greater than zero. func (w *EvaluationAvailableWaiter) Wait(ctx context.Context, params *DescribeEvaluationsInput, maxWaitDur time.Duration, optFns ...func(*EvaluationAvailableWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for EvaluationAvailable 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 *EvaluationAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeEvaluationsInput, maxWaitDur time.Duration, optFns ...func(*EvaluationAvailableWaiterOptions)) (*DescribeEvaluationsOutput, 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.DescribeEvaluations(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 EvaluationAvailable waiter") } func evaluationAvailableStateRetryable(ctx context.Context, input *DescribeEvaluationsInput, output *DescribeEvaluationsOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("Results[].Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "COMPLETED" var match = true listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } if len(listOfValues) == 0 { match = false } for _, v := range listOfValues { value, ok := v.(types.EntityStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.EntityStatus value, got %T", pathValue) } if string(value) != expectedValue { match = false } } if match { return false, nil } } if err == nil { pathValue, err := jmespath.Search("Results[].Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "FAILED" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(types.EntityStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.EntityStatus value, got %T", pathValue) } if string(value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } return true, nil } func newServiceMetadataMiddleware_opDescribeEvaluations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DescribeEvaluations", } }
483
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/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" ) // Returns a list of MLModel that match the search criteria in the request. func (c *Client) DescribeMLModels(ctx context.Context, params *DescribeMLModelsInput, optFns ...func(*Options)) (*DescribeMLModelsOutput, error) { if params == nil { params = &DescribeMLModelsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeMLModels", params, optFns, c.addOperationDescribeMLModelsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeMLModelsOutput) out.ResultMetadata = metadata return out, nil } type DescribeMLModelsInput struct { // The equal to operator. The MLModel results will have FilterVariable values that // exactly match the value specified with EQ . EQ *string // Use one of the following variables to filter a list of MLModel : // - CreatedAt - Sets the search criteria to MLModel creation date. // - Status - Sets the search criteria to MLModel status. // - Name - Sets the search criteria to the contents of MLModel Name . // - IAMUser - Sets the search criteria to the user account that invoked the // MLModel creation. // - TrainingDataSourceId - Sets the search criteria to the DataSource used to // train one or more MLModel . // - RealtimeEndpointStatus - Sets the search criteria to the MLModel real-time // endpoint status. // - MLModelType - Sets the search criteria to MLModel type: binary, regression, // or multi-class. // - Algorithm - Sets the search criteria to the algorithm that the MLModel uses. // - TrainingDataURI - Sets the search criteria to the data file(s) used in // training a MLModel . The URL can identify either a file or an Amazon Simple // Storage Service (Amazon S3) bucket or directory. FilterVariable types.MLModelFilterVariable // The greater than or equal to operator. The MLModel results will have // FilterVariable values that are greater than or equal to the value specified with // GE . GE *string // The greater than operator. The MLModel results will have FilterVariable values // that are greater than the value specified with GT . GT *string // The less than or equal to operator. The MLModel results will have FilterVariable // values that are less than or equal to the value specified with LE . LE *string // The less than operator. The MLModel results will have FilterVariable values // that are less than the value specified with LT . LT *string // The number of pages of information to include in the result. The range of // acceptable values is 1 through 100 . The default value is 100 . Limit *int32 // The not equal to operator. The MLModel results will have FilterVariable values // not equal to the value specified with NE . NE *string // The ID of the page in the paginated results. NextToken *string // A string that is found at the beginning of a variable, such as Name or Id . For // example, an MLModel could have the Name 2014-09-09-HolidayGiftMailer . To search // for this MLModel , select Name for the FilterVariable and any of the following // strings for the Prefix : // - 2014-09 // - 2014-09-09 // - 2014-09-09-Holiday Prefix *string // A two-value parameter that determines the sequence of the resulting list of // MLModel . // - asc - Arranges the list in ascending order (A-Z, 0-9). // - dsc - Arranges the list in descending order (Z-A, 9-0). // Results are sorted by FilterVariable . SortOrder types.SortOrder noSmithyDocumentSerde } // Represents the output of a DescribeMLModels operation. The content is // essentially a list of MLModel . type DescribeMLModelsOutput struct { // The ID of the next page in the paginated results that indicates at least one // more page follows. NextToken *string // A list of MLModel that meet the search criteria. Results []types.MLModel // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeMLModelsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMLModels{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMLModels{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeMLModels(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeMLModelsAPIClient is a client that implements the DescribeMLModels // operation. type DescribeMLModelsAPIClient interface { DescribeMLModels(context.Context, *DescribeMLModelsInput, ...func(*Options)) (*DescribeMLModelsOutput, error) } var _ DescribeMLModelsAPIClient = (*Client)(nil) // DescribeMLModelsPaginatorOptions is the paginator options for DescribeMLModels type DescribeMLModelsPaginatorOptions struct { // The number of pages of information to include in the result. The range of // acceptable values is 1 through 100 . The default value 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 } // DescribeMLModelsPaginator is a paginator for DescribeMLModels type DescribeMLModelsPaginator struct { options DescribeMLModelsPaginatorOptions client DescribeMLModelsAPIClient params *DescribeMLModelsInput nextToken *string firstPage bool } // NewDescribeMLModelsPaginator returns a new DescribeMLModelsPaginator func NewDescribeMLModelsPaginator(client DescribeMLModelsAPIClient, params *DescribeMLModelsInput, optFns ...func(*DescribeMLModelsPaginatorOptions)) *DescribeMLModelsPaginator { if params == nil { params = &DescribeMLModelsInput{} } options := DescribeMLModelsPaginatorOptions{} if params.Limit != nil { options.Limit = *params.Limit } for _, fn := range optFns { fn(&options) } return &DescribeMLModelsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeMLModelsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeMLModels page. func (p *DescribeMLModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMLModelsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.Limit = limit result, err := p.client.DescribeMLModels(ctx, &params, 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 } // MLModelAvailableWaiterOptions are waiter options for MLModelAvailableWaiter type MLModelAvailableWaiterOptions 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, // MLModelAvailableWaiter 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, MLModelAvailableWaiter 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, *DescribeMLModelsInput, *DescribeMLModelsOutput, error) (bool, error) } // MLModelAvailableWaiter defines the waiters for MLModelAvailable type MLModelAvailableWaiter struct { client DescribeMLModelsAPIClient options MLModelAvailableWaiterOptions } // NewMLModelAvailableWaiter constructs a MLModelAvailableWaiter. func NewMLModelAvailableWaiter(client DescribeMLModelsAPIClient, optFns ...func(*MLModelAvailableWaiterOptions)) *MLModelAvailableWaiter { options := MLModelAvailableWaiterOptions{} options.MinDelay = 30 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = mLModelAvailableStateRetryable for _, fn := range optFns { fn(&options) } return &MLModelAvailableWaiter{ client: client, options: options, } } // Wait calls the waiter function for MLModelAvailable waiter. The maxWaitDur is // the maximum wait duration the waiter will wait. The maxWaitDur is required and // must be greater than zero. func (w *MLModelAvailableWaiter) Wait(ctx context.Context, params *DescribeMLModelsInput, maxWaitDur time.Duration, optFns ...func(*MLModelAvailableWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for MLModelAvailable 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 *MLModelAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeMLModelsInput, maxWaitDur time.Duration, optFns ...func(*MLModelAvailableWaiterOptions)) (*DescribeMLModelsOutput, 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.DescribeMLModels(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 MLModelAvailable waiter") } func mLModelAvailableStateRetryable(ctx context.Context, input *DescribeMLModelsInput, output *DescribeMLModelsOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("Results[].Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "COMPLETED" var match = true listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } if len(listOfValues) == 0 { match = false } for _, v := range listOfValues { value, ok := v.(types.EntityStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.EntityStatus value, got %T", pathValue) } if string(value) != expectedValue { match = false } } if match { return false, nil } } if err == nil { pathValue, err := jmespath.Search("Results[].Status", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "FAILED" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(types.EntityStatus) if !ok { return false, fmt.Errorf("waiter comparator expected types.EntityStatus value, got %T", pathValue) } if string(value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } return true, nil } func newServiceMetadataMiddleware_opDescribeMLModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DescribeMLModels", } }
484
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes one or more of the tags for your Amazon ML object. func (c *Client) DescribeTags(ctx context.Context, params *DescribeTagsInput, optFns ...func(*Options)) (*DescribeTagsOutput, error) { if params == nil { params = &DescribeTagsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeTags", params, optFns, c.addOperationDescribeTagsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeTagsOutput) out.ResultMetadata = metadata return out, nil } type DescribeTagsInput struct { // The ID of the ML object. For example, exampleModelId . // // This member is required. ResourceId *string // The type of the ML object. // // This member is required. ResourceType types.TaggableResourceType noSmithyDocumentSerde } // Amazon ML returns the following elements. type DescribeTagsOutput struct { // The ID of the tagged ML object. ResourceId *string // The type of the tagged ML object. ResourceType types.TaggableResourceType // A list of tags associated with the ML object. Tags []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeTags{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeTags{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeTagsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeTags(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "DescribeTags", } }
137
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns a BatchPrediction that includes detailed metadata, status, and data // file information for a Batch Prediction request. func (c *Client) GetBatchPrediction(ctx context.Context, params *GetBatchPredictionInput, optFns ...func(*Options)) (*GetBatchPredictionOutput, error) { if params == nil { params = &GetBatchPredictionInput{} } result, metadata, err := c.invokeOperation(ctx, "GetBatchPrediction", params, optFns, c.addOperationGetBatchPredictionMiddlewares) if err != nil { return nil, err } out := result.(*GetBatchPredictionOutput) out.ResultMetadata = metadata return out, nil } type GetBatchPredictionInput struct { // An ID assigned to the BatchPrediction at creation. // // This member is required. BatchPredictionId *string noSmithyDocumentSerde } // Represents the output of a GetBatchPrediction operation and describes a // BatchPrediction . type GetBatchPredictionOutput struct { // The ID of the DataSource that was used to create the BatchPrediction . BatchPredictionDataSourceId *string // An ID assigned to the BatchPrediction at creation. This value should be // identical to the value of the BatchPredictionID in the request. BatchPredictionId *string // The approximate CPU time in milliseconds that Amazon Machine Learning spent // processing the BatchPrediction , normalized and scaled on computation resources. // ComputeTime is only available if the BatchPrediction is in the COMPLETED state. ComputeTime *int64 // The time when the BatchPrediction was created. The time is expressed in epoch // time. CreatedAt *time.Time // The AWS user account that invoked the BatchPrediction . The account type can be // either an AWS root account or an AWS Identity and Access Management (IAM) user // account. CreatedByIamUser *string // The epoch time when Amazon Machine Learning marked the BatchPrediction as // COMPLETED or FAILED . FinishedAt is only available when the BatchPrediction is // in the COMPLETED or FAILED state. FinishedAt *time.Time // The location of the data file or directory in Amazon Simple Storage Service // (Amazon S3). InputDataLocationS3 *string // The number of invalid records that Amazon Machine Learning saw while processing // the BatchPrediction . InvalidRecordCount *int64 // The time of the most recent edit to BatchPrediction . The time is expressed in // epoch time. LastUpdatedAt *time.Time // A link to the file that contains logs of the CreateBatchPrediction operation. LogUri *string // The ID of the MLModel that generated predictions for the BatchPrediction // request. MLModelId *string // A description of the most recent details about processing the batch prediction // request. Message *string // A user-supplied name or description of the BatchPrediction . Name *string // The location of an Amazon S3 bucket or directory to receive the operation // results. OutputUri *string // The epoch time when Amazon Machine Learning marked the BatchPrediction as // INPROGRESS . StartedAt isn't available if the BatchPrediction is in the PENDING // state. StartedAt *time.Time // The status of the BatchPrediction , which can be one of the following values: // - PENDING - Amazon Machine Learning (Amazon ML) submitted a request to // generate batch predictions. // - INPROGRESS - The batch predictions are in progress. // - FAILED - The request to perform a batch prediction did not run to // completion. It is not usable. // - COMPLETED - The batch prediction process completed successfully. // - DELETED - The BatchPrediction is marked as deleted. It is not usable. Status types.EntityStatus // The number of total records that Amazon Machine Learning saw while processing // the BatchPrediction . TotalRecordCount *int64 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetBatchPredictionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetBatchPrediction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetBatchPrediction{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetBatchPredictionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBatchPrediction(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetBatchPrediction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "GetBatchPrediction", } }
201
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns a DataSource that includes metadata and data file information, as well // as the current status of the DataSource . GetDataSource provides results in // normal or verbose format. The verbose format adds the schema description and the // list of files pointed to by the DataSource to the normal format. func (c *Client) GetDataSource(ctx context.Context, params *GetDataSourceInput, optFns ...func(*Options)) (*GetDataSourceOutput, error) { if params == nil { params = &GetDataSourceInput{} } result, metadata, err := c.invokeOperation(ctx, "GetDataSource", params, optFns, c.addOperationGetDataSourceMiddlewares) if err != nil { return nil, err } out := result.(*GetDataSourceOutput) out.ResultMetadata = metadata return out, nil } type GetDataSourceInput struct { // The ID assigned to the DataSource at creation. // // This member is required. DataSourceId *string // Specifies whether the GetDataSource operation should return DataSourceSchema . // If true, DataSourceSchema is returned. If false, DataSourceSchema is not // returned. Verbose bool noSmithyDocumentSerde } // Represents the output of a GetDataSource operation and describes a DataSource . type GetDataSourceOutput struct { // The parameter is true if statistics need to be generated from the observation // data. ComputeStatistics bool // The approximate CPU time in milliseconds that Amazon Machine Learning spent // processing the DataSource , normalized and scaled on computation resources. // ComputeTime is only available if the DataSource is in the COMPLETED state and // the ComputeStatistics is set to true. ComputeTime *int64 // The time that the DataSource was created. The time is expressed in epoch time. CreatedAt *time.Time // The AWS user account from which the DataSource was created. The account type // can be either an AWS root account or an AWS Identity and Access Management (IAM) // user account. CreatedByIamUser *string // The location of the data file or directory in Amazon Simple Storage Service // (Amazon S3). DataLocationS3 *string // A JSON string that represents the splitting and rearrangement requirement used // when this DataSource was created. DataRearrangement *string // The total size of observations in the data files. DataSizeInBytes *int64 // The ID assigned to the DataSource at creation. This value should be identical // to the value of the DataSourceId in the request. DataSourceId *string // The schema used by all of the data files of this DataSource . Note: This // parameter is provided as part of the verbose format. DataSourceSchema *string // The epoch time when Amazon Machine Learning marked the DataSource as COMPLETED // or FAILED . FinishedAt is only available when the DataSource is in the COMPLETED // or FAILED state. FinishedAt *time.Time // The time of the most recent edit to the DataSource . The time is expressed in // epoch time. LastUpdatedAt *time.Time // A link to the file containing logs of CreateDataSourceFrom* operations. LogUri *string // The user-supplied description of the most recent details about creating the // DataSource . Message *string // A user-supplied name or description of the DataSource . Name *string // The number of data files referenced by the DataSource . NumberOfFiles *int64 // The datasource details that are specific to Amazon RDS. RDSMetadata *types.RDSMetadata // Describes the DataSource details specific to Amazon Redshift. RedshiftMetadata *types.RedshiftMetadata // The Amazon Resource Name (ARN) of an AWS IAM Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html#roles-about-termsandconcepts) // , such as the following: arn:aws:iam::account:role/rolename. RoleARN *string // The epoch time when Amazon Machine Learning marked the DataSource as INPROGRESS // . StartedAt isn't available if the DataSource is in the PENDING state. StartedAt *time.Time // The current status of the DataSource . This element can have one of the // following values: // - PENDING - Amazon ML submitted a request to create a DataSource . // - INPROGRESS - The creation process is underway. // - FAILED - The request to create a DataSource did not run to completion. It is // not usable. // - COMPLETED - The creation process completed successfully. // - DELETED - The DataSource is marked as deleted. It is not usable. Status types.EntityStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDataSource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDataSource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetDataSourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataSource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetDataSource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "GetDataSource", } }
215
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns an Evaluation that includes metadata as well as the current status of // the Evaluation . func (c *Client) GetEvaluation(ctx context.Context, params *GetEvaluationInput, optFns ...func(*Options)) (*GetEvaluationOutput, error) { if params == nil { params = &GetEvaluationInput{} } result, metadata, err := c.invokeOperation(ctx, "GetEvaluation", params, optFns, c.addOperationGetEvaluationMiddlewares) if err != nil { return nil, err } out := result.(*GetEvaluationOutput) out.ResultMetadata = metadata return out, nil } type GetEvaluationInput struct { // The ID of the Evaluation to retrieve. The evaluation of each MLModel is // recorded and cataloged. The ID provides the means to access the information. // // This member is required. EvaluationId *string noSmithyDocumentSerde } // Represents the output of a GetEvaluation operation and describes an Evaluation . type GetEvaluationOutput struct { // The approximate CPU time in milliseconds that Amazon Machine Learning spent // processing the Evaluation , normalized and scaled on computation resources. // ComputeTime is only available if the Evaluation is in the COMPLETED state. ComputeTime *int64 // The time that the Evaluation was created. The time is expressed in epoch time. CreatedAt *time.Time // The AWS user account that invoked the evaluation. The account type can be // either an AWS root account or an AWS Identity and Access Management (IAM) user // account. CreatedByIamUser *string // The DataSource used for this evaluation. EvaluationDataSourceId *string // The evaluation ID which is same as the EvaluationId in the request. EvaluationId *string // The epoch time when Amazon Machine Learning marked the Evaluation as COMPLETED // or FAILED . FinishedAt is only available when the Evaluation is in the COMPLETED // or FAILED state. FinishedAt *time.Time // The location of the data file or directory in Amazon Simple Storage Service // (Amazon S3). InputDataLocationS3 *string // The time of the most recent edit to the Evaluation . The time is expressed in // epoch time. LastUpdatedAt *time.Time // A link to the file that contains logs of the CreateEvaluation operation. LogUri *string // The ID of the MLModel that was the focus of the evaluation. MLModelId *string // A description of the most recent details about evaluating the MLModel . Message *string // A user-supplied name or description of the Evaluation . Name *string // Measurements of how well the MLModel performed using observations referenced by // the DataSource . One of the following metric is returned based on the type of // the MLModel : // - BinaryAUC: A binary MLModel uses the Area Under the Curve (AUC) technique to // measure performance. // - RegressionRMSE: A regression MLModel uses the Root Mean Square Error (RMSE) // technique to measure performance. RMSE measures the difference between predicted // and actual values for a single variable. // - MulticlassAvgFScore: A multiclass MLModel uses the F1 score technique to // measure performance. // For more information about performance metrics, please see the Amazon Machine // Learning Developer Guide (https://docs.aws.amazon.com/machine-learning/latest/dg) // . PerformanceMetrics *types.PerformanceMetrics // The epoch time when Amazon Machine Learning marked the Evaluation as INPROGRESS // . StartedAt isn't available if the Evaluation is in the PENDING state. StartedAt *time.Time // The status of the evaluation. This element can have one of the following // values: // - PENDING - Amazon Machine Language (Amazon ML) submitted a request to // evaluate an MLModel . // - INPROGRESS - The evaluation is underway. // - FAILED - The request to evaluate an MLModel did not run to completion. It is // not usable. // - COMPLETED - The evaluation process completed successfully. // - DELETED - The Evaluation is marked as deleted. It is not usable. Status types.EntityStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetEvaluationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetEvaluation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetEvaluation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetEvaluationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEvaluation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetEvaluation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "GetEvaluation", } }
200
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns an MLModel that includes detailed metadata, data source information, // and the current status of the MLModel . GetMLModel provides results in normal // or verbose format. func (c *Client) GetMLModel(ctx context.Context, params *GetMLModelInput, optFns ...func(*Options)) (*GetMLModelOutput, error) { if params == nil { params = &GetMLModelInput{} } result, metadata, err := c.invokeOperation(ctx, "GetMLModel", params, optFns, c.addOperationGetMLModelMiddlewares) if err != nil { return nil, err } out := result.(*GetMLModelOutput) out.ResultMetadata = metadata return out, nil } type GetMLModelInput struct { // The ID assigned to the MLModel at creation. // // This member is required. MLModelId *string // Specifies whether the GetMLModel operation should return Recipe . If true, // Recipe is returned. If false, Recipe is not returned. Verbose bool noSmithyDocumentSerde } // Represents the output of a GetMLModel operation, and provides detailed // information about a MLModel . type GetMLModelOutput struct { // The approximate CPU time in milliseconds that Amazon Machine Learning spent // processing the MLModel , normalized and scaled on computation resources. // ComputeTime is only available if the MLModel is in the COMPLETED state. ComputeTime *int64 // The time that the MLModel was created. The time is expressed in epoch time. CreatedAt *time.Time // The AWS user account from which the MLModel was created. The account type can // be either an AWS root account or an AWS Identity and Access Management (IAM) // user account. CreatedByIamUser *string // The current endpoint of the MLModel EndpointInfo *types.RealtimeEndpointInfo // The epoch time when Amazon Machine Learning marked the MLModel as COMPLETED or // FAILED . FinishedAt is only available when the MLModel is in the COMPLETED or // FAILED state. FinishedAt *time.Time // The location of the data file or directory in Amazon Simple Storage Service // (Amazon S3). InputDataLocationS3 *string // The time of the most recent edit to the MLModel . The time is expressed in epoch // time. LastUpdatedAt *time.Time // A link to the file that contains logs of the CreateMLModel operation. LogUri *string // The MLModel ID, which is same as the MLModelId in the request. MLModelId *string // Identifies the MLModel category. The following are the available types: // - REGRESSION -- Produces a numeric result. For example, "What price should a // house be listed at?" // - BINARY -- Produces one of two possible results. For example, "Is this an // e-commerce website?" // - MULTICLASS -- Produces one of several possible results. For example, "Is // this a HIGH, LOW or MEDIUM risk trade?" MLModelType types.MLModelType // A description of the most recent details about accessing the MLModel . Message *string // A user-supplied name or description of the MLModel . Name *string // The recipe to use when training the MLModel . The Recipe provides detailed // information about the observation data to use during training, and manipulations // to perform on the observation data during training. Note: This parameter is // provided as part of the verbose format. Recipe *string // The schema used by all of the data files referenced by the DataSource . Note: // This parameter is provided as part of the verbose format. Schema *string // The scoring threshold is used in binary classification MLModel models. It marks // the boundary between a positive prediction and a negative prediction. Output // values greater than or equal to the threshold receive a positive result from the // MLModel, such as true . Output values less than the threshold receive a negative // response from the MLModel, such as false . ScoreThreshold *float32 // The time of the most recent edit to the ScoreThreshold . The time is expressed // in epoch time. ScoreThresholdLastUpdatedAt *time.Time // Long integer type that is a 64-bit signed number. SizeInBytes *int64 // The epoch time when Amazon Machine Learning marked the MLModel as INPROGRESS . // StartedAt isn't available if the MLModel is in the PENDING state. StartedAt *time.Time // The current status of the MLModel . This element can have one of the following // values: // - PENDING - Amazon Machine Learning (Amazon ML) submitted a request to // describe a MLModel . // - INPROGRESS - The request is processing. // - FAILED - The request did not run to completion. The ML model isn't usable. // - COMPLETED - The request completed successfully. // - DELETED - The MLModel is marked as deleted. It isn't usable. Status types.EntityStatus // The ID of the training DataSource . TrainingDataSourceId *string // A list of the training parameters in the MLModel . The list is implemented as a // map of key-value pairs. The following is the current set of training parameters: // // - sgd.maxMLModelSizeInBytes - The maximum allowed size of the model. Depending // on the input data, the size of the model might affect its performance. The value // is an integer that ranges from 100000 to 2147483648 . The default value is // 33554432 . // - sgd.maxPasses - The number of times that the training process traverses the // observations to build the MLModel . The value is an integer that ranges from 1 // to 10000 . The default value is 10 . // - sgd.shuffleType - Whether Amazon ML shuffles the training data. Shuffling // data improves a model's ability to find the optimal solution for a variety of // data types. The valid values are auto and none . The default value is none . // We strongly recommend that you shuffle your data. // - sgd.l1RegularizationAmount - The coefficient regularization L1 norm. It // controls overfitting the data by penalizing large coefficients. This tends to // drive coefficients to zero, resulting in a sparse feature set. If you use this // parameter, start by specifying a small value, such as 1.0E-08 . The value is a // double that ranges from 0 to MAX_DOUBLE . The default is to not use L1 // normalization. This parameter can't be used when L2 is specified. Use this // parameter sparingly. // - sgd.l2RegularizationAmount - The coefficient regularization L2 norm. It // controls overfitting the data by penalizing large coefficients. This tends to // drive coefficients to small, nonzero values. If you use this parameter, start by // specifying a small value, such as 1.0E-08 . The value is a double that ranges // from 0 to MAX_DOUBLE . The default is to not use L2 normalization. This // parameter can't be used when L1 is specified. Use this parameter sparingly. TrainingParameters map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetMLModelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMLModel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMLModel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetMLModelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMLModel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetMLModel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "GetMLModel", } }
251
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" mlcust "github.com/aws/aws-sdk-go-v2/service/machinelearning/internal/customizations" "github.com/aws/aws-sdk-go-v2/service/machinelearning/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Generates a prediction for the observation using the specified ML Model . Note: // Not all response parameters will be populated. Whether a response parameter is // populated depends on the type of model requested. func (c *Client) Predict(ctx context.Context, params *PredictInput, optFns ...func(*Options)) (*PredictOutput, error) { if params == nil { params = &PredictInput{} } result, metadata, err := c.invokeOperation(ctx, "Predict", params, optFns, c.addOperationPredictMiddlewares) if err != nil { return nil, err } out := result.(*PredictOutput) out.ResultMetadata = metadata return out, nil } type PredictInput struct { // A unique identifier of the MLModel . // // This member is required. MLModelId *string // This member is required. PredictEndpoint *string // A map of variable name-value pairs that represent an observation. // // This member is required. Record map[string]string noSmithyDocumentSerde } type PredictOutput struct { // The output from a Predict operation: // - Details - Contains the following attributes: // DetailsAttributes.PREDICTIVE_MODEL_TYPE - REGRESSION | BINARY | MULTICLASS // DetailsAttributes.ALGORITHM - SGD // - PredictedLabel - Present for either a BINARY or MULTICLASS MLModel request. // - PredictedScores - Contains the raw classification score corresponding to // each label. // - PredictedValue - Present for a REGRESSION MLModel request. Prediction *types.Prediction // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPredictMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpPredict{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPredict{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPredictValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPredict(options.Region), middleware.Before); err != nil { return err } if err = mlcust.AddPredictEndpointMiddleware(stack, getPredictEndpoint); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opPredict(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "Predict", } } func getPredictEndpoint(input interface{}) (*string, error) { in, ok := input.(*PredictInput) if !ok { return nil, &smithy.SerializationError{Err: fmt.Errorf("expected *PredictInput, but was %T", input)} } return in.PredictEndpoint, nil }
156
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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 the BatchPredictionName of a BatchPrediction . You can use the // GetBatchPrediction operation to view the contents of the updated data element. func (c *Client) UpdateBatchPrediction(ctx context.Context, params *UpdateBatchPredictionInput, optFns ...func(*Options)) (*UpdateBatchPredictionOutput, error) { if params == nil { params = &UpdateBatchPredictionInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateBatchPrediction", params, optFns, c.addOperationUpdateBatchPredictionMiddlewares) if err != nil { return nil, err } out := result.(*UpdateBatchPredictionOutput) out.ResultMetadata = metadata return out, nil } type UpdateBatchPredictionInput struct { // The ID assigned to the BatchPrediction during creation. // // This member is required. BatchPredictionId *string // A new user-supplied name or description of the BatchPrediction . // // This member is required. BatchPredictionName *string noSmithyDocumentSerde } // Represents the output of an UpdateBatchPrediction operation. You can see the // updated content by using the GetBatchPrediction operation. type UpdateBatchPredictionOutput struct { // The ID assigned to the BatchPrediction during creation. This value should be // identical to the value of the BatchPredictionId in the request. BatchPredictionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateBatchPredictionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateBatchPrediction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateBatchPrediction{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateBatchPredictionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBatchPrediction(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateBatchPrediction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "UpdateBatchPrediction", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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 the DataSourceName of a DataSource . You can use the GetDataSource // operation to view the contents of the updated data element. func (c *Client) UpdateDataSource(ctx context.Context, params *UpdateDataSourceInput, optFns ...func(*Options)) (*UpdateDataSourceOutput, error) { if params == nil { params = &UpdateDataSourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateDataSource", params, optFns, c.addOperationUpdateDataSourceMiddlewares) if err != nil { return nil, err } out := result.(*UpdateDataSourceOutput) out.ResultMetadata = metadata return out, nil } type UpdateDataSourceInput struct { // The ID assigned to the DataSource during creation. // // This member is required. DataSourceId *string // A new user-supplied name or description of the DataSource that will replace the // current description. // // This member is required. DataSourceName *string noSmithyDocumentSerde } // Represents the output of an UpdateDataSource operation. You can see the updated // content by using the GetBatchPrediction operation. type UpdateDataSourceOutput struct { // The ID assigned to the DataSource during creation. This value should be // identical to the value of the DataSourceID in the request. DataSourceId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDataSource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDataSource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateDataSourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDataSource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateDataSource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "UpdateDataSource", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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 the EvaluationName of an Evaluation . You can use the GetEvaluation // operation to view the contents of the updated data element. func (c *Client) UpdateEvaluation(ctx context.Context, params *UpdateEvaluationInput, optFns ...func(*Options)) (*UpdateEvaluationOutput, error) { if params == nil { params = &UpdateEvaluationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateEvaluation", params, optFns, c.addOperationUpdateEvaluationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateEvaluationOutput) out.ResultMetadata = metadata return out, nil } type UpdateEvaluationInput struct { // The ID assigned to the Evaluation during creation. // // This member is required. EvaluationId *string // A new user-supplied name or description of the Evaluation that will replace the // current content. // // This member is required. EvaluationName *string noSmithyDocumentSerde } // Represents the output of an UpdateEvaluation operation. You can see the updated // content by using the GetEvaluation operation. type UpdateEvaluationOutput struct { // The ID assigned to the Evaluation during creation. This value should be // identical to the value of the Evaluation in the request. EvaluationId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateEvaluationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateEvaluation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateEvaluation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateEvaluationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEvaluation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateEvaluation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "UpdateEvaluation", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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 the MLModelName and the ScoreThreshold of an MLModel . You can use the // GetMLModel operation to view the contents of the updated data element. func (c *Client) UpdateMLModel(ctx context.Context, params *UpdateMLModelInput, optFns ...func(*Options)) (*UpdateMLModelOutput, error) { if params == nil { params = &UpdateMLModelInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateMLModel", params, optFns, c.addOperationUpdateMLModelMiddlewares) if err != nil { return nil, err } out := result.(*UpdateMLModelOutput) out.ResultMetadata = metadata return out, nil } type UpdateMLModelInput struct { // The ID assigned to the MLModel during creation. // // This member is required. MLModelId *string // A user-supplied name or description of the MLModel . MLModelName *string // The ScoreThreshold used in binary classification MLModel that marks the // boundary between a positive prediction and a negative prediction. Output values // greater than or equal to the ScoreThreshold receive a positive result from the // MLModel , such as true . Output values less than the ScoreThreshold receive a // negative response from the MLModel , such as false . ScoreThreshold *float32 noSmithyDocumentSerde } // Represents the output of an UpdateMLModel operation. You can see the updated // content by using the GetMLModel operation. type UpdateMLModelOutput struct { // The ID assigned to the MLModel during creation. This value should be identical // to the value of the MLModelID in the request. MLModelId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateMLModelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateMLModel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateMLModel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateMLModelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMLModel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateMLModel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "machinelearning", OperationName: "UpdateMLModel", } }
138
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/machinelearning/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "math" "strings" ) type awsAwsjson11_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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("InvalidTagException", errorCode): return awsAwsjson11_deserializeErrorInvalidTagException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TagLimitExceededException", errorCode): return awsAwsjson11_deserializeErrorTagLimitExceededException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateBatchPrediction struct { } func (*awsAwsjson11_deserializeOpCreateBatchPrediction) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateBatchPrediction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateBatchPrediction(response, &metadata) } output := &CreateBatchPredictionOutput{} 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_deserializeOpDocumentCreateBatchPredictionOutput(&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_deserializeOpErrorCreateBatchPrediction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateDataSourceFromRDS struct { } func (*awsAwsjson11_deserializeOpCreateDataSourceFromRDS) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateDataSourceFromRDS) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateDataSourceFromRDS(response, &metadata) } output := &CreateDataSourceFromRDSOutput{} 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_deserializeOpDocumentCreateDataSourceFromRDSOutput(&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_deserializeOpErrorCreateDataSourceFromRDS(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateDataSourceFromRedshift struct { } func (*awsAwsjson11_deserializeOpCreateDataSourceFromRedshift) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateDataSourceFromRedshift) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateDataSourceFromRedshift(response, &metadata) } output := &CreateDataSourceFromRedshiftOutput{} 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_deserializeOpDocumentCreateDataSourceFromRedshiftOutput(&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_deserializeOpErrorCreateDataSourceFromRedshift(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateDataSourceFromS3 struct { } func (*awsAwsjson11_deserializeOpCreateDataSourceFromS3) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateDataSourceFromS3) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateDataSourceFromS3(response, &metadata) } output := &CreateDataSourceFromS3Output{} 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_deserializeOpDocumentCreateDataSourceFromS3Output(&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_deserializeOpErrorCreateDataSourceFromS3(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateEvaluation struct { } func (*awsAwsjson11_deserializeOpCreateEvaluation) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateEvaluation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateEvaluation(response, &metadata) } output := &CreateEvaluationOutput{} 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_deserializeOpDocumentCreateEvaluationOutput(&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_deserializeOpErrorCreateEvaluation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateMLModel struct { } func (*awsAwsjson11_deserializeOpCreateMLModel) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateMLModel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateMLModel(response, &metadata) } output := &CreateMLModelOutput{} 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_deserializeOpDocumentCreateMLModelOutput(&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_deserializeOpErrorCreateMLModel(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("IdempotentParameterMismatchException", errorCode): return awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateRealtimeEndpoint struct { } func (*awsAwsjson11_deserializeOpCreateRealtimeEndpoint) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateRealtimeEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorCreateRealtimeEndpoint(response, &metadata) } output := &CreateRealtimeEndpointOutput{} 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_deserializeOpDocumentCreateRealtimeEndpointOutput(&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_deserializeOpErrorCreateRealtimeEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteBatchPrediction struct { } func (*awsAwsjson11_deserializeOpDeleteBatchPrediction) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteBatchPrediction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteBatchPrediction(response, &metadata) } output := &DeleteBatchPredictionOutput{} 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_deserializeOpDocumentDeleteBatchPredictionOutput(&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_deserializeOpErrorDeleteBatchPrediction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteDataSource struct { } func (*awsAwsjson11_deserializeOpDeleteDataSource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteDataSource(response, &metadata) } output := &DeleteDataSourceOutput{} 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_deserializeOpDocumentDeleteDataSourceOutput(&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_deserializeOpErrorDeleteDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteEvaluation struct { } func (*awsAwsjson11_deserializeOpDeleteEvaluation) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteEvaluation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteEvaluation(response, &metadata) } output := &DeleteEvaluationOutput{} 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_deserializeOpDocumentDeleteEvaluationOutput(&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_deserializeOpErrorDeleteEvaluation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteMLModel struct { } func (*awsAwsjson11_deserializeOpDeleteMLModel) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteMLModel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteMLModel(response, &metadata) } output := &DeleteMLModelOutput{} 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_deserializeOpDocumentDeleteMLModelOutput(&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_deserializeOpErrorDeleteMLModel(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteRealtimeEndpoint struct { } func (*awsAwsjson11_deserializeOpDeleteRealtimeEndpoint) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteRealtimeEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteRealtimeEndpoint(response, &metadata) } output := &DeleteRealtimeEndpointOutput{} 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_deserializeOpDocumentDeleteRealtimeEndpointOutput(&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_deserializeOpErrorDeleteRealtimeEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteTags struct { } func (*awsAwsjson11_deserializeOpDeleteTags) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDeleteTags(response, &metadata) } output := &DeleteTagsOutput{} 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_deserializeOpDocumentDeleteTagsOutput(&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_deserializeOpErrorDeleteTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("InvalidTagException", errorCode): return awsAwsjson11_deserializeErrorInvalidTagException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeBatchPredictions struct { } func (*awsAwsjson11_deserializeOpDescribeBatchPredictions) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeBatchPredictions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeBatchPredictions(response, &metadata) } output := &DescribeBatchPredictionsOutput{} 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_deserializeOpDocumentDescribeBatchPredictionsOutput(&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_deserializeOpErrorDescribeBatchPredictions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeDataSources struct { } func (*awsAwsjson11_deserializeOpDescribeDataSources) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeDataSources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeDataSources(response, &metadata) } output := &DescribeDataSourcesOutput{} 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_deserializeOpDocumentDescribeDataSourcesOutput(&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_deserializeOpErrorDescribeDataSources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeEvaluations struct { } func (*awsAwsjson11_deserializeOpDescribeEvaluations) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeEvaluations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeEvaluations(response, &metadata) } output := &DescribeEvaluationsOutput{} 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_deserializeOpDocumentDescribeEvaluationsOutput(&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_deserializeOpErrorDescribeEvaluations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeMLModels struct { } func (*awsAwsjson11_deserializeOpDescribeMLModels) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeMLModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeMLModels(response, &metadata) } output := &DescribeMLModelsOutput{} 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_deserializeOpDocumentDescribeMLModelsOutput(&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_deserializeOpErrorDescribeMLModels(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDescribeTags struct { } func (*awsAwsjson11_deserializeOpDescribeTags) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDescribeTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorDescribeTags(response, &metadata) } output := &DescribeTagsOutput{} 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_deserializeOpDocumentDescribeTagsOutput(&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_deserializeOpErrorDescribeTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetBatchPrediction struct { } func (*awsAwsjson11_deserializeOpGetBatchPrediction) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetBatchPrediction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetBatchPrediction(response, &metadata) } output := &GetBatchPredictionOutput{} 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_deserializeOpDocumentGetBatchPredictionOutput(&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_deserializeOpErrorGetBatchPrediction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetDataSource struct { } func (*awsAwsjson11_deserializeOpGetDataSource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetDataSource(response, &metadata) } output := &GetDataSourceOutput{} 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_deserializeOpDocumentGetDataSourceOutput(&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_deserializeOpErrorGetDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetEvaluation struct { } func (*awsAwsjson11_deserializeOpGetEvaluation) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetEvaluation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetEvaluation(response, &metadata) } output := &GetEvaluationOutput{} 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_deserializeOpDocumentGetEvaluationOutput(&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_deserializeOpErrorGetEvaluation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetMLModel struct { } func (*awsAwsjson11_deserializeOpGetMLModel) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetMLModel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorGetMLModel(response, &metadata) } output := &GetMLModelOutput{} 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_deserializeOpDocumentGetMLModelOutput(&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_deserializeOpErrorGetMLModel(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpPredict struct { } func (*awsAwsjson11_deserializeOpPredict) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpPredict) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorPredict(response, &metadata) } output := &PredictOutput{} 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_deserializeOpDocumentPredictOutput(&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_deserializeOpErrorPredict(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("PredictorNotMountedException", errorCode): return awsAwsjson11_deserializeErrorPredictorNotMountedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateBatchPrediction struct { } func (*awsAwsjson11_deserializeOpUpdateBatchPrediction) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateBatchPrediction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateBatchPrediction(response, &metadata) } output := &UpdateBatchPredictionOutput{} 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_deserializeOpDocumentUpdateBatchPredictionOutput(&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_deserializeOpErrorUpdateBatchPrediction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateDataSource struct { } func (*awsAwsjson11_deserializeOpUpdateDataSource) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateDataSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateDataSource(response, &metadata) } output := &UpdateDataSourceOutput{} 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_deserializeOpDocumentUpdateDataSourceOutput(&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_deserializeOpErrorUpdateDataSource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateEvaluation struct { } func (*awsAwsjson11_deserializeOpUpdateEvaluation) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateEvaluation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateEvaluation(response, &metadata) } output := &UpdateEvaluationOutput{} 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_deserializeOpDocumentUpdateEvaluationOutput(&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_deserializeOpErrorUpdateEvaluation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateMLModel struct { } func (*awsAwsjson11_deserializeOpUpdateMLModel) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateMLModel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { 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_deserializeOpErrorUpdateMLModel(response, &metadata) } output := &UpdateMLModelOutput{} 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_deserializeOpDocumentUpdateMLModelOutput(&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_deserializeOpErrorUpdateMLModel(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(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("InvalidInputException", errorCode): return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_deserializeErrorIdempotentParameterMismatchException(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.IdempotentParameterMismatchException{} err := awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(&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_deserializeErrorInvalidInputException(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.InvalidInputException{} err := awsAwsjson11_deserializeDocumentInvalidInputException(&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_deserializeErrorInvalidTagException(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.InvalidTagException{} err := awsAwsjson11_deserializeDocumentInvalidTagException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.LimitExceededException{} err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorPredictorNotMountedException(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.PredictorNotMountedException{} err := awsAwsjson11_deserializeDocumentPredictorNotMountedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ResourceNotFoundException{} err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorTagLimitExceededException(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.TagLimitExceededException{} err := awsAwsjson11_deserializeDocumentTagLimitExceededException(&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_deserializeDocumentBatchPrediction(v **types.BatchPrediction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BatchPrediction if *v == nil { sv = &types.BatchPrediction{} } else { sv = *v } for key, value := range shape { switch key { case "BatchPredictionDataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.BatchPredictionDataSourceId = ptr.String(jtv) } case "BatchPredictionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.BatchPredictionId = ptr.String(jtv) } case "ComputeTime": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ComputeTime = ptr.Int64(i64) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "CreatedByIamUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsUserArn to be of type string, got %T instead", value) } sv.CreatedByIamUser = ptr.String(jtv) } case "FinishedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "InputDataLocationS3": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.InputDataLocationS3 = ptr.String(jtv) } case "InvalidRecordCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InvalidRecordCount = ptr.Int64(i64) } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "OutputUri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.OutputUri = ptr.String(jtv) } case "StartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityStatus to be of type string, got %T instead", value) } sv.Status = types.EntityStatus(jtv) } case "TotalRecordCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalRecordCount = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentBatchPredictions(v *[]types.BatchPrediction, 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.BatchPrediction if *v == nil { cv = []types.BatchPrediction{} } else { cv = *v } for _, value := range shape { var col types.BatchPrediction destAddr := &col if err := awsAwsjson11_deserializeDocumentBatchPrediction(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDataSource(v **types.DataSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataSource if *v == nil { sv = &types.DataSource{} } else { sv = *v } for key, value := range shape { switch key { case "ComputeStatistics": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected ComputeStatistics to be of type *bool, got %T instead", value) } sv.ComputeStatistics = jtv } case "ComputeTime": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ComputeTime = ptr.Int64(i64) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "CreatedByIamUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsUserArn to be of type string, got %T instead", value) } sv.CreatedByIamUser = ptr.String(jtv) } case "DataLocationS3": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.DataLocationS3 = ptr.String(jtv) } case "DataRearrangement": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataRearrangement to be of type string, got %T instead", value) } sv.DataRearrangement = ptr.String(jtv) } case "DataSizeInBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DataSizeInBytes = ptr.Int64(i64) } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "FinishedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "NumberOfFiles": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.NumberOfFiles = ptr.Int64(i64) } case "RDSMetadata": if err := awsAwsjson11_deserializeDocumentRDSMetadata(&sv.RDSMetadata, value); err != nil { return err } case "RedshiftMetadata": if err := awsAwsjson11_deserializeDocumentRedshiftMetadata(&sv.RedshiftMetadata, value); err != nil { return err } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "StartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityStatus to be of type string, got %T instead", value) } sv.Status = types.EntityStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentDataSources(v *[]types.DataSource, 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.DataSource if *v == nil { cv = []types.DataSource{} } else { cv = *v } for _, value := range shape { var col types.DataSource destAddr := &col if err := awsAwsjson11_deserializeDocumentDataSource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDetailsMap(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 DetailsValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsAwsjson11_deserializeDocumentEvaluation(v **types.Evaluation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Evaluation if *v == nil { sv = &types.Evaluation{} } else { sv = *v } for key, value := range shape { switch key { case "ComputeTime": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ComputeTime = ptr.Int64(i64) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "CreatedByIamUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsUserArn to be of type string, got %T instead", value) } sv.CreatedByIamUser = ptr.String(jtv) } case "EvaluationDataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.EvaluationDataSourceId = ptr.String(jtv) } case "EvaluationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.EvaluationId = ptr.String(jtv) } case "FinishedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "InputDataLocationS3": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.InputDataLocationS3 = ptr.String(jtv) } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "PerformanceMetrics": if err := awsAwsjson11_deserializeDocumentPerformanceMetrics(&sv.PerformanceMetrics, value); err != nil { return err } case "StartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityStatus to be of type string, got %T instead", value) } sv.Status = types.EntityStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentEvaluations(v *[]types.Evaluation, 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.Evaluation if *v == nil { cv = []types.Evaluation{} } else { cv = *v } for _, value := range shape { var col types.Evaluation destAddr := &col if err := awsAwsjson11_deserializeDocumentEvaluation(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentIdempotentParameterMismatchException(v **types.IdempotentParameterMismatchException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IdempotentParameterMismatchException if *v == nil { sv = &types.IdempotentParameterMismatchException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ErrorCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Code = int32(i64) } 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_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 "code": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ErrorCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Code = int32(i64) } 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_deserializeDocumentInvalidInputException(v **types.InvalidInputException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidInputException if *v == nil { sv = &types.InvalidInputException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ErrorCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Code = int32(i64) } 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_deserializeDocumentInvalidTagException(v **types.InvalidTagException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InvalidTagException if *v == nil { sv = &types.InvalidTagException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LimitExceededException if *v == nil { sv = &types.LimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ErrorCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Code = int32(i64) } 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_deserializeDocumentMLModel(v **types.MLModel, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MLModel if *v == nil { sv = &types.MLModel{} } else { sv = *v } for key, value := range shape { switch key { case "Algorithm": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Algorithm to be of type string, got %T instead", value) } sv.Algorithm = types.Algorithm(jtv) } case "ComputeTime": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ComputeTime = ptr.Int64(i64) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "CreatedByIamUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsUserArn to be of type string, got %T instead", value) } sv.CreatedByIamUser = ptr.String(jtv) } case "EndpointInfo": if err := awsAwsjson11_deserializeDocumentRealtimeEndpointInfo(&sv.EndpointInfo, value); err != nil { return err } case "FinishedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "InputDataLocationS3": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.InputDataLocationS3 = ptr.String(jtv) } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } case "MLModelType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MLModelType to be of type string, got %T instead", value) } sv.MLModelType = types.MLModelType(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MLModelName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ScoreThreshold": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ScoreThreshold = ptr.Float32(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.ScoreThreshold = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected ScoreThreshold to be a JSON Number, got %T instead", value) } } case "ScoreThresholdLastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ScoreThresholdLastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "SizeInBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SizeInBytes = ptr.Int64(i64) } case "StartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityStatus to be of type string, got %T instead", value) } sv.Status = types.EntityStatus(jtv) } case "TrainingDataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.TrainingDataSourceId = ptr.String(jtv) } case "TrainingParameters": if err := awsAwsjson11_deserializeDocumentTrainingParameters(&sv.TrainingParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentMLModels(v *[]types.MLModel, 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.MLModel if *v == nil { cv = []types.MLModel{} } else { cv = *v } for _, value := range shape { var col types.MLModel destAddr := &col if err := awsAwsjson11_deserializeDocumentMLModel(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPerformanceMetrics(v **types.PerformanceMetrics, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PerformanceMetrics if *v == nil { sv = &types.PerformanceMetrics{} } else { sv = *v } for key, value := range shape { switch key { case "Properties": if err := awsAwsjson11_deserializeDocumentPerformanceMetricsProperties(&sv.Properties, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPerformanceMetricsProperties(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 PerformanceMetricsPropertyValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsAwsjson11_deserializeDocumentPrediction(v **types.Prediction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Prediction if *v == nil { sv = &types.Prediction{} } else { sv = *v } for key, value := range shape { switch key { case "details": if err := awsAwsjson11_deserializeDocumentDetailsMap(&sv.Details, value); err != nil { return err } case "predictedLabel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Label to be of type string, got %T instead", value) } sv.PredictedLabel = ptr.String(jtv) } case "predictedScores": if err := awsAwsjson11_deserializeDocumentScoreValuePerLabelMap(&sv.PredictedScores, value); err != nil { return err } case "predictedValue": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.PredictedValue = ptr.Float32(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.PredictedValue = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected floatLabel to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPredictorNotMountedException(v **types.PredictorNotMountedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PredictorNotMountedException if *v == nil { sv = &types.PredictorNotMountedException{} } 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_deserializeDocumentRDSDatabase(v **types.RDSDatabase, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RDSDatabase if *v == nil { sv = &types.RDSDatabase{} } else { sv = *v } for key, value := range shape { switch key { case "DatabaseName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RDSDatabaseName to be of type string, got %T instead", value) } sv.DatabaseName = ptr.String(jtv) } case "InstanceIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RDSInstanceIdentifier to be of type string, got %T instead", value) } sv.InstanceIdentifier = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRDSMetadata(v **types.RDSMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RDSMetadata if *v == nil { sv = &types.RDSMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "Database": if err := awsAwsjson11_deserializeDocumentRDSDatabase(&sv.Database, value); err != nil { return err } case "DatabaseUserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RDSDatabaseUsername to be of type string, got %T instead", value) } sv.DatabaseUserName = ptr.String(jtv) } case "DataPipelineId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EDPPipelineId to be of type string, got %T instead", value) } sv.DataPipelineId = ptr.String(jtv) } case "ResourceRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EDPResourceRole to be of type string, got %T instead", value) } sv.ResourceRole = ptr.String(jtv) } case "SelectSqlQuery": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RDSSelectSqlQuery to be of type string, got %T instead", value) } sv.SelectSqlQuery = ptr.String(jtv) } case "ServiceRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EDPServiceRole to be of type string, got %T instead", value) } sv.ServiceRole = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRealtimeEndpointInfo(v **types.RealtimeEndpointInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RealtimeEndpointInfo if *v == nil { sv = &types.RealtimeEndpointInfo{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "EndpointStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RealtimeEndpointStatus to be of type string, got %T instead", value) } sv.EndpointStatus = types.RealtimeEndpointStatus(jtv) } case "EndpointUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VipURL to be of type string, got %T instead", value) } sv.EndpointUrl = ptr.String(jtv) } case "PeakRequestsPerSecond": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected IntegerType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.PeakRequestsPerSecond = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRedshiftDatabase(v **types.RedshiftDatabase, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RedshiftDatabase if *v == nil { sv = &types.RedshiftDatabase{} } else { sv = *v } for key, value := range shape { switch key { case "ClusterIdentifier": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RedshiftClusterIdentifier to be of type string, got %T instead", value) } sv.ClusterIdentifier = ptr.String(jtv) } case "DatabaseName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RedshiftDatabaseName to be of type string, got %T instead", value) } sv.DatabaseName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentRedshiftMetadata(v **types.RedshiftMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RedshiftMetadata if *v == nil { sv = &types.RedshiftMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "DatabaseUserName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RedshiftDatabaseUsername to be of type string, got %T instead", value) } sv.DatabaseUserName = ptr.String(jtv) } case "RedshiftDatabase": if err := awsAwsjson11_deserializeDocumentRedshiftDatabase(&sv.RedshiftDatabase, value); err != nil { return err } case "SelectSqlQuery": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RedshiftSelectSqlQuery to be of type string, got %T instead", value) } sv.SelectSqlQuery = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ErrorCode to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Code = int32(i64) } 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_deserializeDocumentScoreValuePerLabelMap(v *map[string]float32, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %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]float32 if *v == nil { mv = map[string]float32{} } else { mv = *v } for key, value := range shape { var parsedVal float32 if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } parsedVal = 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) } parsedVal = float32(f64) default: return fmt.Errorf("expected ScoreValue to be a JSON Number, got %T instead", value) } } mv[key] = parsedVal } *v = mv return nil } func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentTagLimitExceededException(v **types.TagLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TagLimitExceededException if *v == nil { sv = &types.TagLimitExceededException{} } 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_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_deserializeDocumentTrainingParameters(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 StringType to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv 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 { case "ResourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaggableResourceType to be of type string, got %T instead", value) } sv.ResourceType = types.TaggableResourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateBatchPredictionOutput(v **CreateBatchPredictionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateBatchPredictionOutput if *v == nil { sv = &CreateBatchPredictionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "BatchPredictionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.BatchPredictionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateDataSourceFromRDSOutput(v **CreateDataSourceFromRDSOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDataSourceFromRDSOutput if *v == nil { sv = &CreateDataSourceFromRDSOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateDataSourceFromRedshiftOutput(v **CreateDataSourceFromRedshiftOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDataSourceFromRedshiftOutput if *v == nil { sv = &CreateDataSourceFromRedshiftOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateDataSourceFromS3Output(v **CreateDataSourceFromS3Output, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateDataSourceFromS3Output if *v == nil { sv = &CreateDataSourceFromS3Output{} } else { sv = *v } for key, value := range shape { switch key { case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateEvaluationOutput(v **CreateEvaluationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateEvaluationOutput if *v == nil { sv = &CreateEvaluationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "EvaluationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.EvaluationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateMLModelOutput(v **CreateMLModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateMLModelOutput if *v == nil { sv = &CreateMLModelOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateRealtimeEndpointOutput(v **CreateRealtimeEndpointOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateRealtimeEndpointOutput if *v == nil { sv = &CreateRealtimeEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } case "RealtimeEndpointInfo": if err := awsAwsjson11_deserializeDocumentRealtimeEndpointInfo(&sv.RealtimeEndpointInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteBatchPredictionOutput(v **DeleteBatchPredictionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteBatchPredictionOutput if *v == nil { sv = &DeleteBatchPredictionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "BatchPredictionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.BatchPredictionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteDataSourceOutput(v **DeleteDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteDataSourceOutput if *v == nil { sv = &DeleteDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteEvaluationOutput(v **DeleteEvaluationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteEvaluationOutput if *v == nil { sv = &DeleteEvaluationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "EvaluationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.EvaluationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteMLModelOutput(v **DeleteMLModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteMLModelOutput if *v == nil { sv = &DeleteMLModelOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteRealtimeEndpointOutput(v **DeleteRealtimeEndpointOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteRealtimeEndpointOutput if *v == nil { sv = &DeleteRealtimeEndpointOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } case "RealtimeEndpointInfo": if err := awsAwsjson11_deserializeDocumentRealtimeEndpointInfo(&sv.RealtimeEndpointInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteTagsOutput(v **DeleteTagsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteTagsOutput if *v == nil { sv = &DeleteTagsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ResourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaggableResourceType to be of type string, got %T instead", value) } sv.ResourceType = types.TaggableResourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeBatchPredictionsOutput(v **DescribeBatchPredictionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeBatchPredictionsOutput if *v == nil { sv = &DescribeBatchPredictionsOutput{} } 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 StringType to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Results": if err := awsAwsjson11_deserializeDocumentBatchPredictions(&sv.Results, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeDataSourcesOutput(v **DescribeDataSourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeDataSourcesOutput if *v == nil { sv = &DescribeDataSourcesOutput{} } 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 StringType to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Results": if err := awsAwsjson11_deserializeDocumentDataSources(&sv.Results, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeEvaluationsOutput(v **DescribeEvaluationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeEvaluationsOutput if *v == nil { sv = &DescribeEvaluationsOutput{} } 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 StringType to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Results": if err := awsAwsjson11_deserializeDocumentEvaluations(&sv.Results, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeMLModelsOutput(v **DescribeMLModelsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeMLModelsOutput if *v == nil { sv = &DescribeMLModelsOutput{} } 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 StringType to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Results": if err := awsAwsjson11_deserializeDocumentMLModels(&sv.Results, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDescribeTagsOutput(v **DescribeTagsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeTagsOutput if *v == nil { sv = &DescribeTagsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ResourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } case "ResourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TaggableResourceType to be of type string, got %T instead", value) } sv.ResourceType = types.TaggableResourceType(jtv) } case "Tags": if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetBatchPredictionOutput(v **GetBatchPredictionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetBatchPredictionOutput if *v == nil { sv = &GetBatchPredictionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "BatchPredictionDataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.BatchPredictionDataSourceId = ptr.String(jtv) } case "BatchPredictionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.BatchPredictionId = ptr.String(jtv) } case "ComputeTime": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ComputeTime = ptr.Int64(i64) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "CreatedByIamUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsUserArn to be of type string, got %T instead", value) } sv.CreatedByIamUser = ptr.String(jtv) } case "FinishedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "InputDataLocationS3": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.InputDataLocationS3 = ptr.String(jtv) } case "InvalidRecordCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.InvalidRecordCount = ptr.Int64(i64) } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "LogUri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PresignedS3Url to be of type string, got %T instead", value) } sv.LogUri = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "OutputUri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.OutputUri = ptr.String(jtv) } case "StartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityStatus to be of type string, got %T instead", value) } sv.Status = types.EntityStatus(jtv) } case "TotalRecordCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalRecordCount = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetDataSourceOutput(v **GetDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetDataSourceOutput if *v == nil { sv = &GetDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ComputeStatistics": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected ComputeStatistics to be of type *bool, got %T instead", value) } sv.ComputeStatistics = jtv } case "ComputeTime": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ComputeTime = ptr.Int64(i64) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "CreatedByIamUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsUserArn to be of type string, got %T instead", value) } sv.CreatedByIamUser = ptr.String(jtv) } case "DataLocationS3": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.DataLocationS3 = ptr.String(jtv) } case "DataRearrangement": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataRearrangement to be of type string, got %T instead", value) } sv.DataRearrangement = ptr.String(jtv) } case "DataSizeInBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.DataSizeInBytes = ptr.Int64(i64) } case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } case "DataSourceSchema": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSchema to be of type string, got %T instead", value) } sv.DataSourceSchema = ptr.String(jtv) } case "FinishedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "LogUri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PresignedS3Url to be of type string, got %T instead", value) } sv.LogUri = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "NumberOfFiles": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.NumberOfFiles = ptr.Int64(i64) } case "RDSMetadata": if err := awsAwsjson11_deserializeDocumentRDSMetadata(&sv.RDSMetadata, value); err != nil { return err } case "RedshiftMetadata": if err := awsAwsjson11_deserializeDocumentRedshiftMetadata(&sv.RedshiftMetadata, value); err != nil { return err } case "RoleARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleARN to be of type string, got %T instead", value) } sv.RoleARN = ptr.String(jtv) } case "StartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityStatus to be of type string, got %T instead", value) } sv.Status = types.EntityStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetEvaluationOutput(v **GetEvaluationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetEvaluationOutput if *v == nil { sv = &GetEvaluationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ComputeTime": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ComputeTime = ptr.Int64(i64) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "CreatedByIamUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsUserArn to be of type string, got %T instead", value) } sv.CreatedByIamUser = ptr.String(jtv) } case "EvaluationDataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.EvaluationDataSourceId = ptr.String(jtv) } case "EvaluationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.EvaluationId = ptr.String(jtv) } case "FinishedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "InputDataLocationS3": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.InputDataLocationS3 = ptr.String(jtv) } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "LogUri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PresignedS3Url to be of type string, got %T instead", value) } sv.LogUri = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "PerformanceMetrics": if err := awsAwsjson11_deserializeDocumentPerformanceMetrics(&sv.PerformanceMetrics, value); err != nil { return err } case "StartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityStatus to be of type string, got %T instead", value) } sv.Status = types.EntityStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetMLModelOutput(v **GetMLModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetMLModelOutput if *v == nil { sv = &GetMLModelOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ComputeTime": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ComputeTime = ptr.Int64(i64) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "CreatedByIamUser": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AwsUserArn to be of type string, got %T instead", value) } sv.CreatedByIamUser = ptr.String(jtv) } case "EndpointInfo": if err := awsAwsjson11_deserializeDocumentRealtimeEndpointInfo(&sv.EndpointInfo, value); err != nil { return err } case "FinishedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.FinishedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "InputDataLocationS3": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3Url to be of type string, got %T instead", value) } sv.InputDataLocationS3 = ptr.String(jtv) } case "LastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "LogUri": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PresignedS3Url to be of type string, got %T instead", value) } sv.LogUri = ptr.String(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Message to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } case "MLModelType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MLModelType to be of type string, got %T instead", value) } sv.MLModelType = types.MLModelType(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MLModelName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Recipe": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Recipe to be of type string, got %T instead", value) } sv.Recipe = ptr.String(jtv) } case "Schema": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DataSchema to be of type string, got %T instead", value) } sv.Schema = ptr.String(jtv) } case "ScoreThreshold": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ScoreThreshold = ptr.Float32(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.ScoreThreshold = ptr.Float32(float32(f64)) default: return fmt.Errorf("expected ScoreThreshold to be a JSON Number, got %T instead", value) } } case "ScoreThresholdLastUpdatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ScoreThresholdLastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "SizeInBytes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LongType to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.SizeInBytes = ptr.Int64(i64) } case "StartedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected EpochTime to be a JSON Number, got %T instead", value) } } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityStatus to be of type string, got %T instead", value) } sv.Status = types.EntityStatus(jtv) } case "TrainingDataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.TrainingDataSourceId = ptr.String(jtv) } case "TrainingParameters": if err := awsAwsjson11_deserializeDocumentTrainingParameters(&sv.TrainingParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentPredictOutput(v **PredictOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PredictOutput if *v == nil { sv = &PredictOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Prediction": if err := awsAwsjson11_deserializeDocumentPrediction(&sv.Prediction, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateBatchPredictionOutput(v **UpdateBatchPredictionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateBatchPredictionOutput if *v == nil { sv = &UpdateBatchPredictionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "BatchPredictionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.BatchPredictionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateDataSourceOutput(v **UpdateDataSourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateDataSourceOutput if *v == nil { sv = &UpdateDataSourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "DataSourceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.DataSourceId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateEvaluationOutput(v **UpdateEvaluationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateEvaluationOutput if *v == nil { sv = &UpdateEvaluationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "EvaluationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.EvaluationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateMLModelOutput(v **UpdateMLModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateMLModelOutput if *v == nil { sv = &UpdateMLModelOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MLModelId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.MLModelId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
7,631
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package machinelearning provides the API client, operations, and parameter // types for Amazon Machine Learning. // // Definition of the public APIs exposed by Amazon Machine Learning package machinelearning
8
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning 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/machinelearning/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 = "machinelearning" } 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 machinelearning // goModuleVersion is the tagged release for this module const goModuleVersion = "1.15.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/machinelearning/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "math" "path" ) type awsAwsjson11_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("AmazonML_20141212.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_serializeOpCreateBatchPrediction struct { } func (*awsAwsjson11_serializeOpCreateBatchPrediction) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateBatchPrediction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateBatchPredictionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.CreateBatchPrediction") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateBatchPredictionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateDataSourceFromRDS struct { } func (*awsAwsjson11_serializeOpCreateDataSourceFromRDS) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateDataSourceFromRDS) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateDataSourceFromRDSInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.CreateDataSourceFromRDS") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateDataSourceFromRDSInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateDataSourceFromRedshift struct { } func (*awsAwsjson11_serializeOpCreateDataSourceFromRedshift) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateDataSourceFromRedshift) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateDataSourceFromRedshiftInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.CreateDataSourceFromRedshift") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateDataSourceFromRedshiftInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateDataSourceFromS3 struct { } func (*awsAwsjson11_serializeOpCreateDataSourceFromS3) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateDataSourceFromS3) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateDataSourceFromS3Input) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.CreateDataSourceFromS3") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateDataSourceFromS3Input(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateEvaluation struct { } func (*awsAwsjson11_serializeOpCreateEvaluation) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateEvaluation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateEvaluationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.CreateEvaluation") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateEvaluationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateMLModel struct { } func (*awsAwsjson11_serializeOpCreateMLModel) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateMLModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateMLModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.CreateMLModel") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateMLModelInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateRealtimeEndpoint struct { } func (*awsAwsjson11_serializeOpCreateRealtimeEndpoint) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateRealtimeEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateRealtimeEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.CreateRealtimeEndpoint") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateRealtimeEndpointInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteBatchPrediction struct { } func (*awsAwsjson11_serializeOpDeleteBatchPrediction) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteBatchPrediction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteBatchPredictionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DeleteBatchPrediction") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteBatchPredictionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteDataSource struct { } func (*awsAwsjson11_serializeOpDeleteDataSource) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteDataSourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DeleteDataSource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteDataSourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteEvaluation struct { } func (*awsAwsjson11_serializeOpDeleteEvaluation) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteEvaluation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteEvaluationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DeleteEvaluation") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteEvaluationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteMLModel struct { } func (*awsAwsjson11_serializeOpDeleteMLModel) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteMLModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteMLModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DeleteMLModel") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteMLModelInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteRealtimeEndpoint struct { } func (*awsAwsjson11_serializeOpDeleteRealtimeEndpoint) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteRealtimeEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteRealtimeEndpointInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DeleteRealtimeEndpoint") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteRealtimeEndpointInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteTags struct { } func (*awsAwsjson11_serializeOpDeleteTags) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DeleteTags") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteTagsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDescribeBatchPredictions struct { } func (*awsAwsjson11_serializeOpDescribeBatchPredictions) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeBatchPredictions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeBatchPredictionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DescribeBatchPredictions") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeBatchPredictionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDescribeDataSources struct { } func (*awsAwsjson11_serializeOpDescribeDataSources) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeDataSources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeDataSourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DescribeDataSources") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeDataSourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDescribeEvaluations struct { } func (*awsAwsjson11_serializeOpDescribeEvaluations) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeEvaluations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeEvaluationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DescribeEvaluations") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeEvaluationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDescribeMLModels struct { } func (*awsAwsjson11_serializeOpDescribeMLModels) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeMLModels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeMLModelsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DescribeMLModels") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeMLModelsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDescribeTags struct { } func (*awsAwsjson11_serializeOpDescribeTags) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDescribeTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeTagsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.DescribeTags") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDescribeTagsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetBatchPrediction struct { } func (*awsAwsjson11_serializeOpGetBatchPrediction) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetBatchPrediction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetBatchPredictionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.GetBatchPrediction") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetBatchPredictionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetDataSource struct { } func (*awsAwsjson11_serializeOpGetDataSource) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetDataSourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.GetDataSource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetDataSourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetEvaluation struct { } func (*awsAwsjson11_serializeOpGetEvaluation) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetEvaluation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetEvaluationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.GetEvaluation") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetEvaluationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetMLModel struct { } func (*awsAwsjson11_serializeOpGetMLModel) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetMLModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetMLModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.GetMLModel") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetMLModelInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpPredict struct { } func (*awsAwsjson11_serializeOpPredict) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpPredict) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PredictInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.Predict") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentPredictInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateBatchPrediction struct { } func (*awsAwsjson11_serializeOpUpdateBatchPrediction) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateBatchPrediction) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateBatchPredictionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.UpdateBatchPrediction") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateBatchPredictionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateDataSource struct { } func (*awsAwsjson11_serializeOpUpdateDataSource) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateDataSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateDataSourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.UpdateDataSource") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateDataSourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateEvaluation struct { } func (*awsAwsjson11_serializeOpUpdateEvaluation) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateEvaluation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateEvaluationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.UpdateEvaluation") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateEvaluationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateMLModel struct { } func (*awsAwsjson11_serializeOpUpdateMLModel) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateMLModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateMLModelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonML_20141212.UpdateMLModel") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateMLModelInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if 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_serializeDocumentEDPSecurityGroupIds(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_serializeDocumentRDSDatabase(v *types.RDSDatabase, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DatabaseName != nil { ok := object.Key("DatabaseName") ok.String(*v.DatabaseName) } if v.InstanceIdentifier != nil { ok := object.Key("InstanceIdentifier") ok.String(*v.InstanceIdentifier) } return nil } func awsAwsjson11_serializeDocumentRDSDatabaseCredentials(v *types.RDSDatabaseCredentials, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Password != nil { ok := object.Key("Password") ok.String(*v.Password) } if v.Username != nil { ok := object.Key("Username") ok.String(*v.Username) } return nil } func awsAwsjson11_serializeDocumentRDSDataSpec(v *types.RDSDataSpec, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DatabaseCredentials != nil { ok := object.Key("DatabaseCredentials") if err := awsAwsjson11_serializeDocumentRDSDatabaseCredentials(v.DatabaseCredentials, ok); err != nil { return err } } if v.DatabaseInformation != nil { ok := object.Key("DatabaseInformation") if err := awsAwsjson11_serializeDocumentRDSDatabase(v.DatabaseInformation, ok); err != nil { return err } } if v.DataRearrangement != nil { ok := object.Key("DataRearrangement") ok.String(*v.DataRearrangement) } if v.DataSchema != nil { ok := object.Key("DataSchema") ok.String(*v.DataSchema) } if v.DataSchemaUri != nil { ok := object.Key("DataSchemaUri") ok.String(*v.DataSchemaUri) } if v.ResourceRole != nil { ok := object.Key("ResourceRole") ok.String(*v.ResourceRole) } if v.S3StagingLocation != nil { ok := object.Key("S3StagingLocation") ok.String(*v.S3StagingLocation) } if v.SecurityGroupIds != nil { ok := object.Key("SecurityGroupIds") if err := awsAwsjson11_serializeDocumentEDPSecurityGroupIds(v.SecurityGroupIds, ok); err != nil { return err } } if v.SelectSqlQuery != nil { ok := object.Key("SelectSqlQuery") ok.String(*v.SelectSqlQuery) } if v.ServiceRole != nil { ok := object.Key("ServiceRole") ok.String(*v.ServiceRole) } if v.SubnetId != nil { ok := object.Key("SubnetId") ok.String(*v.SubnetId) } return nil } func awsAwsjson11_serializeDocumentRecord(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_serializeDocumentRedshiftDatabase(v *types.RedshiftDatabase, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClusterIdentifier != nil { ok := object.Key("ClusterIdentifier") ok.String(*v.ClusterIdentifier) } if v.DatabaseName != nil { ok := object.Key("DatabaseName") ok.String(*v.DatabaseName) } return nil } func awsAwsjson11_serializeDocumentRedshiftDatabaseCredentials(v *types.RedshiftDatabaseCredentials, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Password != nil { ok := object.Key("Password") ok.String(*v.Password) } if v.Username != nil { ok := object.Key("Username") ok.String(*v.Username) } return nil } func awsAwsjson11_serializeDocumentRedshiftDataSpec(v *types.RedshiftDataSpec, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DatabaseCredentials != nil { ok := object.Key("DatabaseCredentials") if err := awsAwsjson11_serializeDocumentRedshiftDatabaseCredentials(v.DatabaseCredentials, ok); err != nil { return err } } if v.DatabaseInformation != nil { ok := object.Key("DatabaseInformation") if err := awsAwsjson11_serializeDocumentRedshiftDatabase(v.DatabaseInformation, ok); err != nil { return err } } if v.DataRearrangement != nil { ok := object.Key("DataRearrangement") ok.String(*v.DataRearrangement) } if v.DataSchema != nil { ok := object.Key("DataSchema") ok.String(*v.DataSchema) } if v.DataSchemaUri != nil { ok := object.Key("DataSchemaUri") ok.String(*v.DataSchemaUri) } if v.S3StagingLocation != nil { ok := object.Key("S3StagingLocation") ok.String(*v.S3StagingLocation) } if v.SelectSqlQuery != nil { ok := object.Key("SelectSqlQuery") ok.String(*v.SelectSqlQuery) } return nil } func awsAwsjson11_serializeDocumentS3DataSpec(v *types.S3DataSpec, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DataLocationS3 != nil { ok := object.Key("DataLocationS3") ok.String(*v.DataLocationS3) } if v.DataRearrangement != nil { ok := object.Key("DataRearrangement") ok.String(*v.DataRearrangement) } if v.DataSchema != nil { ok := object.Key("DataSchema") ok.String(*v.DataSchema) } if v.DataSchemaLocationS3 != nil { ok := object.Key("DataSchemaLocationS3") ok.String(*v.DataSchemaLocationS3) } return nil } func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("Key") ok.String(*v.Key) } if v.Value != nil { ok := object.Key("Value") ok.String(*v.Value) } return nil } func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentTrainingParameters(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_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 len(v.ResourceType) > 0 { ok := object.Key("ResourceType") ok.String(string(v.ResourceType)) } if v.Tags != nil { ok := object.Key("Tags") if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateBatchPredictionInput(v *CreateBatchPredictionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BatchPredictionDataSourceId != nil { ok := object.Key("BatchPredictionDataSourceId") ok.String(*v.BatchPredictionDataSourceId) } if v.BatchPredictionId != nil { ok := object.Key("BatchPredictionId") ok.String(*v.BatchPredictionId) } if v.BatchPredictionName != nil { ok := object.Key("BatchPredictionName") ok.String(*v.BatchPredictionName) } if v.MLModelId != nil { ok := object.Key("MLModelId") ok.String(*v.MLModelId) } if v.OutputUri != nil { ok := object.Key("OutputUri") ok.String(*v.OutputUri) } return nil } func awsAwsjson11_serializeOpDocumentCreateDataSourceFromRDSInput(v *CreateDataSourceFromRDSInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ComputeStatistics { ok := object.Key("ComputeStatistics") ok.Boolean(v.ComputeStatistics) } if v.DataSourceId != nil { ok := object.Key("DataSourceId") ok.String(*v.DataSourceId) } if v.DataSourceName != nil { ok := object.Key("DataSourceName") ok.String(*v.DataSourceName) } if v.RDSData != nil { ok := object.Key("RDSData") if err := awsAwsjson11_serializeDocumentRDSDataSpec(v.RDSData, ok); err != nil { return err } } if v.RoleARN != nil { ok := object.Key("RoleARN") ok.String(*v.RoleARN) } return nil } func awsAwsjson11_serializeOpDocumentCreateDataSourceFromRedshiftInput(v *CreateDataSourceFromRedshiftInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ComputeStatistics { ok := object.Key("ComputeStatistics") ok.Boolean(v.ComputeStatistics) } if v.DataSourceId != nil { ok := object.Key("DataSourceId") ok.String(*v.DataSourceId) } if v.DataSourceName != nil { ok := object.Key("DataSourceName") ok.String(*v.DataSourceName) } if v.DataSpec != nil { ok := object.Key("DataSpec") if err := awsAwsjson11_serializeDocumentRedshiftDataSpec(v.DataSpec, ok); err != nil { return err } } if v.RoleARN != nil { ok := object.Key("RoleARN") ok.String(*v.RoleARN) } return nil } func awsAwsjson11_serializeOpDocumentCreateDataSourceFromS3Input(v *CreateDataSourceFromS3Input, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ComputeStatistics { ok := object.Key("ComputeStatistics") ok.Boolean(v.ComputeStatistics) } if v.DataSourceId != nil { ok := object.Key("DataSourceId") ok.String(*v.DataSourceId) } if v.DataSourceName != nil { ok := object.Key("DataSourceName") ok.String(*v.DataSourceName) } if v.DataSpec != nil { ok := object.Key("DataSpec") if err := awsAwsjson11_serializeDocumentS3DataSpec(v.DataSpec, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateEvaluationInput(v *CreateEvaluationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EvaluationDataSourceId != nil { ok := object.Key("EvaluationDataSourceId") ok.String(*v.EvaluationDataSourceId) } if v.EvaluationId != nil { ok := object.Key("EvaluationId") ok.String(*v.EvaluationId) } if v.EvaluationName != nil { ok := object.Key("EvaluationName") ok.String(*v.EvaluationName) } if v.MLModelId != nil { ok := object.Key("MLModelId") ok.String(*v.MLModelId) } return nil } func awsAwsjson11_serializeOpDocumentCreateMLModelInput(v *CreateMLModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MLModelId != nil { ok := object.Key("MLModelId") ok.String(*v.MLModelId) } if v.MLModelName != nil { ok := object.Key("MLModelName") ok.String(*v.MLModelName) } if len(v.MLModelType) > 0 { ok := object.Key("MLModelType") ok.String(string(v.MLModelType)) } if v.Parameters != nil { ok := object.Key("Parameters") if err := awsAwsjson11_serializeDocumentTrainingParameters(v.Parameters, ok); err != nil { return err } } if v.Recipe != nil { ok := object.Key("Recipe") ok.String(*v.Recipe) } if v.RecipeUri != nil { ok := object.Key("RecipeUri") ok.String(*v.RecipeUri) } if v.TrainingDataSourceId != nil { ok := object.Key("TrainingDataSourceId") ok.String(*v.TrainingDataSourceId) } return nil } func awsAwsjson11_serializeOpDocumentCreateRealtimeEndpointInput(v *CreateRealtimeEndpointInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MLModelId != nil { ok := object.Key("MLModelId") ok.String(*v.MLModelId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteBatchPredictionInput(v *DeleteBatchPredictionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BatchPredictionId != nil { ok := object.Key("BatchPredictionId") ok.String(*v.BatchPredictionId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteDataSourceInput(v *DeleteDataSourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DataSourceId != nil { ok := object.Key("DataSourceId") ok.String(*v.DataSourceId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteEvaluationInput(v *DeleteEvaluationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EvaluationId != nil { ok := object.Key("EvaluationId") ok.String(*v.EvaluationId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteMLModelInput(v *DeleteMLModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MLModelId != nil { ok := object.Key("MLModelId") ok.String(*v.MLModelId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteRealtimeEndpointInput(v *DeleteRealtimeEndpointInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MLModelId != nil { ok := object.Key("MLModelId") ok.String(*v.MLModelId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteTagsInput(v *DeleteTagsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceId != nil { ok := object.Key("ResourceId") ok.String(*v.ResourceId) } if len(v.ResourceType) > 0 { ok := object.Key("ResourceType") ok.String(string(v.ResourceType)) } if v.TagKeys != nil { ok := object.Key("TagKeys") if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentDescribeBatchPredictionsInput(v *DescribeBatchPredictionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EQ != nil { ok := object.Key("EQ") ok.String(*v.EQ) } if len(v.FilterVariable) > 0 { ok := object.Key("FilterVariable") ok.String(string(v.FilterVariable)) } if v.GE != nil { ok := object.Key("GE") ok.String(*v.GE) } if v.GT != nil { ok := object.Key("GT") ok.String(*v.GT) } if v.LE != nil { ok := object.Key("LE") ok.String(*v.LE) } if v.Limit != nil { ok := object.Key("Limit") ok.Integer(*v.Limit) } if v.LT != nil { ok := object.Key("LT") ok.String(*v.LT) } if v.NE != nil { ok := object.Key("NE") ok.String(*v.NE) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.Prefix != nil { ok := object.Key("Prefix") ok.String(*v.Prefix) } if len(v.SortOrder) > 0 { ok := object.Key("SortOrder") ok.String(string(v.SortOrder)) } return nil } func awsAwsjson11_serializeOpDocumentDescribeDataSourcesInput(v *DescribeDataSourcesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EQ != nil { ok := object.Key("EQ") ok.String(*v.EQ) } if len(v.FilterVariable) > 0 { ok := object.Key("FilterVariable") ok.String(string(v.FilterVariable)) } if v.GE != nil { ok := object.Key("GE") ok.String(*v.GE) } if v.GT != nil { ok := object.Key("GT") ok.String(*v.GT) } if v.LE != nil { ok := object.Key("LE") ok.String(*v.LE) } if v.Limit != nil { ok := object.Key("Limit") ok.Integer(*v.Limit) } if v.LT != nil { ok := object.Key("LT") ok.String(*v.LT) } if v.NE != nil { ok := object.Key("NE") ok.String(*v.NE) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.Prefix != nil { ok := object.Key("Prefix") ok.String(*v.Prefix) } if len(v.SortOrder) > 0 { ok := object.Key("SortOrder") ok.String(string(v.SortOrder)) } return nil } func awsAwsjson11_serializeOpDocumentDescribeEvaluationsInput(v *DescribeEvaluationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EQ != nil { ok := object.Key("EQ") ok.String(*v.EQ) } if len(v.FilterVariable) > 0 { ok := object.Key("FilterVariable") ok.String(string(v.FilterVariable)) } if v.GE != nil { ok := object.Key("GE") ok.String(*v.GE) } if v.GT != nil { ok := object.Key("GT") ok.String(*v.GT) } if v.LE != nil { ok := object.Key("LE") ok.String(*v.LE) } if v.Limit != nil { ok := object.Key("Limit") ok.Integer(*v.Limit) } if v.LT != nil { ok := object.Key("LT") ok.String(*v.LT) } if v.NE != nil { ok := object.Key("NE") ok.String(*v.NE) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.Prefix != nil { ok := object.Key("Prefix") ok.String(*v.Prefix) } if len(v.SortOrder) > 0 { ok := object.Key("SortOrder") ok.String(string(v.SortOrder)) } return nil } func awsAwsjson11_serializeOpDocumentDescribeMLModelsInput(v *DescribeMLModelsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EQ != nil { ok := object.Key("EQ") ok.String(*v.EQ) } if len(v.FilterVariable) > 0 { ok := object.Key("FilterVariable") ok.String(string(v.FilterVariable)) } if v.GE != nil { ok := object.Key("GE") ok.String(*v.GE) } if v.GT != nil { ok := object.Key("GT") ok.String(*v.GT) } if v.LE != nil { ok := object.Key("LE") ok.String(*v.LE) } if v.Limit != nil { ok := object.Key("Limit") ok.Integer(*v.Limit) } if v.LT != nil { ok := object.Key("LT") ok.String(*v.LT) } if v.NE != nil { ok := object.Key("NE") ok.String(*v.NE) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.Prefix != nil { ok := object.Key("Prefix") ok.String(*v.Prefix) } if len(v.SortOrder) > 0 { ok := object.Key("SortOrder") ok.String(string(v.SortOrder)) } return nil } func awsAwsjson11_serializeOpDocumentDescribeTagsInput(v *DescribeTagsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ResourceId != nil { ok := object.Key("ResourceId") ok.String(*v.ResourceId) } if len(v.ResourceType) > 0 { ok := object.Key("ResourceType") ok.String(string(v.ResourceType)) } return nil } func awsAwsjson11_serializeOpDocumentGetBatchPredictionInput(v *GetBatchPredictionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BatchPredictionId != nil { ok := object.Key("BatchPredictionId") ok.String(*v.BatchPredictionId) } return nil } func awsAwsjson11_serializeOpDocumentGetDataSourceInput(v *GetDataSourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DataSourceId != nil { ok := object.Key("DataSourceId") ok.String(*v.DataSourceId) } if v.Verbose { ok := object.Key("Verbose") ok.Boolean(v.Verbose) } return nil } func awsAwsjson11_serializeOpDocumentGetEvaluationInput(v *GetEvaluationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EvaluationId != nil { ok := object.Key("EvaluationId") ok.String(*v.EvaluationId) } return nil } func awsAwsjson11_serializeOpDocumentGetMLModelInput(v *GetMLModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MLModelId != nil { ok := object.Key("MLModelId") ok.String(*v.MLModelId) } if v.Verbose { ok := object.Key("Verbose") ok.Boolean(v.Verbose) } return nil } func awsAwsjson11_serializeOpDocumentPredictInput(v *PredictInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MLModelId != nil { ok := object.Key("MLModelId") ok.String(*v.MLModelId) } if v.PredictEndpoint != nil { ok := object.Key("PredictEndpoint") ok.String(*v.PredictEndpoint) } if v.Record != nil { ok := object.Key("Record") if err := awsAwsjson11_serializeDocumentRecord(v.Record, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUpdateBatchPredictionInput(v *UpdateBatchPredictionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BatchPredictionId != nil { ok := object.Key("BatchPredictionId") ok.String(*v.BatchPredictionId) } if v.BatchPredictionName != nil { ok := object.Key("BatchPredictionName") ok.String(*v.BatchPredictionName) } return nil } func awsAwsjson11_serializeOpDocumentUpdateDataSourceInput(v *UpdateDataSourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DataSourceId != nil { ok := object.Key("DataSourceId") ok.String(*v.DataSourceId) } if v.DataSourceName != nil { ok := object.Key("DataSourceName") ok.String(*v.DataSourceName) } return nil } func awsAwsjson11_serializeOpDocumentUpdateEvaluationInput(v *UpdateEvaluationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EvaluationId != nil { ok := object.Key("EvaluationId") ok.String(*v.EvaluationId) } if v.EvaluationName != nil { ok := object.Key("EvaluationName") ok.String(*v.EvaluationName) } return nil } func awsAwsjson11_serializeOpDocumentUpdateMLModelInput(v *UpdateMLModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MLModelId != nil { ok := object.Key("MLModelId") ok.String(*v.MLModelId) } if v.MLModelName != nil { ok := object.Key("MLModelName") ok.String(*v.MLModelName) } if v.ScoreThreshold != nil { ok := object.Key("ScoreThreshold") switch { case math.IsNaN(float64(*v.ScoreThreshold)): ok.String("NaN") case math.IsInf(float64(*v.ScoreThreshold), 1): ok.String("Infinity") case math.IsInf(float64(*v.ScoreThreshold), -1): ok.String("-Infinity") default: ok.Float(*v.ScoreThreshold) } } return nil }
2,593
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package machinelearning import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/machinelearning/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) 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 validateOpCreateBatchPrediction struct { } func (*validateOpCreateBatchPrediction) ID() string { return "OperationInputValidation" } func (m *validateOpCreateBatchPrediction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateBatchPredictionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateBatchPredictionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateDataSourceFromRDS struct { } func (*validateOpCreateDataSourceFromRDS) ID() string { return "OperationInputValidation" } func (m *validateOpCreateDataSourceFromRDS) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateDataSourceFromRDSInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateDataSourceFromRDSInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateDataSourceFromRedshift struct { } func (*validateOpCreateDataSourceFromRedshift) ID() string { return "OperationInputValidation" } func (m *validateOpCreateDataSourceFromRedshift) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateDataSourceFromRedshiftInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateDataSourceFromRedshiftInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateDataSourceFromS3 struct { } func (*validateOpCreateDataSourceFromS3) ID() string { return "OperationInputValidation" } func (m *validateOpCreateDataSourceFromS3) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateDataSourceFromS3Input) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateDataSourceFromS3Input(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateEvaluation struct { } func (*validateOpCreateEvaluation) ID() string { return "OperationInputValidation" } func (m *validateOpCreateEvaluation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateEvaluationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateEvaluationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateMLModel struct { } func (*validateOpCreateMLModel) ID() string { return "OperationInputValidation" } func (m *validateOpCreateMLModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateMLModelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateMLModelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateRealtimeEndpoint struct { } func (*validateOpCreateRealtimeEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpCreateRealtimeEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateRealtimeEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateRealtimeEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteBatchPrediction struct { } func (*validateOpDeleteBatchPrediction) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteBatchPrediction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteBatchPredictionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteBatchPredictionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteDataSource struct { } func (*validateOpDeleteDataSource) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteDataSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteDataSourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteDataSourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteEvaluation struct { } func (*validateOpDeleteEvaluation) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteEvaluation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteEvaluationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteEvaluationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteMLModel struct { } func (*validateOpDeleteMLModel) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteMLModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteMLModelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteMLModelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteRealtimeEndpoint struct { } func (*validateOpDeleteRealtimeEndpoint) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteRealtimeEndpoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteRealtimeEndpointInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteRealtimeEndpointInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteTags struct { } func (*validateOpDeleteTags) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteTagsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteTagsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeTags struct { } func (*validateOpDescribeTags) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeTagsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeTagsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetBatchPrediction struct { } func (*validateOpGetBatchPrediction) ID() string { return "OperationInputValidation" } func (m *validateOpGetBatchPrediction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetBatchPredictionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetBatchPredictionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetDataSource struct { } func (*validateOpGetDataSource) ID() string { return "OperationInputValidation" } func (m *validateOpGetDataSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetDataSourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetDataSourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetEvaluation struct { } func (*validateOpGetEvaluation) ID() string { return "OperationInputValidation" } func (m *validateOpGetEvaluation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetEvaluationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetEvaluationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetMLModel struct { } func (*validateOpGetMLModel) ID() string { return "OperationInputValidation" } func (m *validateOpGetMLModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetMLModelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetMLModelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPredict struct { } func (*validateOpPredict) ID() string { return "OperationInputValidation" } func (m *validateOpPredict) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PredictInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPredictInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateBatchPrediction struct { } func (*validateOpUpdateBatchPrediction) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateBatchPrediction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateBatchPredictionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateBatchPredictionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateDataSource struct { } func (*validateOpUpdateDataSource) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateDataSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateDataSourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateDataSourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateEvaluation struct { } func (*validateOpUpdateEvaluation) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateEvaluation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateEvaluationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateEvaluationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateMLModel struct { } func (*validateOpUpdateMLModel) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateMLModel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateMLModelInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateMLModelInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAddTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAddTags{}, middleware.After) } func addOpCreateBatchPredictionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateBatchPrediction{}, middleware.After) } func addOpCreateDataSourceFromRDSValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataSourceFromRDS{}, middleware.After) } func addOpCreateDataSourceFromRedshiftValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataSourceFromRedshift{}, middleware.After) } func addOpCreateDataSourceFromS3ValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDataSourceFromS3{}, middleware.After) } func addOpCreateEvaluationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateEvaluation{}, middleware.After) } func addOpCreateMLModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateMLModel{}, middleware.After) } func addOpCreateRealtimeEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRealtimeEndpoint{}, middleware.After) } func addOpDeleteBatchPredictionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteBatchPrediction{}, middleware.After) } func addOpDeleteDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDataSource{}, middleware.After) } func addOpDeleteEvaluationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteEvaluation{}, middleware.After) } func addOpDeleteMLModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteMLModel{}, middleware.After) } func addOpDeleteRealtimeEndpointValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteRealtimeEndpoint{}, middleware.After) } func addOpDeleteTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteTags{}, middleware.After) } func addOpDescribeTagsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeTags{}, middleware.After) } func addOpGetBatchPredictionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetBatchPrediction{}, middleware.After) } func addOpGetDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDataSource{}, middleware.After) } func addOpGetEvaluationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEvaluation{}, middleware.After) } func addOpGetMLModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetMLModel{}, middleware.After) } func addOpPredictValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPredict{}, middleware.After) } func addOpUpdateBatchPredictionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateBatchPrediction{}, middleware.After) } func addOpUpdateDataSourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDataSource{}, middleware.After) } func addOpUpdateEvaluationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateEvaluation{}, middleware.After) } func addOpUpdateMLModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateMLModel{}, middleware.After) } func validateRDSDatabase(v *types.RDSDatabase) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RDSDatabase"} if v.InstanceIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("InstanceIdentifier")) } if v.DatabaseName == nil { invalidParams.Add(smithy.NewErrParamRequired("DatabaseName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRDSDatabaseCredentials(v *types.RDSDatabaseCredentials) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RDSDatabaseCredentials"} if v.Username == nil { invalidParams.Add(smithy.NewErrParamRequired("Username")) } if v.Password == nil { invalidParams.Add(smithy.NewErrParamRequired("Password")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRDSDataSpec(v *types.RDSDataSpec) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RDSDataSpec"} if v.DatabaseInformation == nil { invalidParams.Add(smithy.NewErrParamRequired("DatabaseInformation")) } else if v.DatabaseInformation != nil { if err := validateRDSDatabase(v.DatabaseInformation); err != nil { invalidParams.AddNested("DatabaseInformation", err.(smithy.InvalidParamsError)) } } if v.SelectSqlQuery == nil { invalidParams.Add(smithy.NewErrParamRequired("SelectSqlQuery")) } if v.DatabaseCredentials == nil { invalidParams.Add(smithy.NewErrParamRequired("DatabaseCredentials")) } else if v.DatabaseCredentials != nil { if err := validateRDSDatabaseCredentials(v.DatabaseCredentials); err != nil { invalidParams.AddNested("DatabaseCredentials", err.(smithy.InvalidParamsError)) } } if v.S3StagingLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("S3StagingLocation")) } if v.ResourceRole == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceRole")) } if v.ServiceRole == nil { invalidParams.Add(smithy.NewErrParamRequired("ServiceRole")) } if v.SubnetId == nil { invalidParams.Add(smithy.NewErrParamRequired("SubnetId")) } if v.SecurityGroupIds == nil { invalidParams.Add(smithy.NewErrParamRequired("SecurityGroupIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRedshiftDatabase(v *types.RedshiftDatabase) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RedshiftDatabase"} if v.DatabaseName == nil { invalidParams.Add(smithy.NewErrParamRequired("DatabaseName")) } if v.ClusterIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterIdentifier")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRedshiftDatabaseCredentials(v *types.RedshiftDatabaseCredentials) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RedshiftDatabaseCredentials"} if v.Username == nil { invalidParams.Add(smithy.NewErrParamRequired("Username")) } if v.Password == nil { invalidParams.Add(smithy.NewErrParamRequired("Password")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateRedshiftDataSpec(v *types.RedshiftDataSpec) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RedshiftDataSpec"} if v.DatabaseInformation == nil { invalidParams.Add(smithy.NewErrParamRequired("DatabaseInformation")) } else if v.DatabaseInformation != nil { if err := validateRedshiftDatabase(v.DatabaseInformation); err != nil { invalidParams.AddNested("DatabaseInformation", err.(smithy.InvalidParamsError)) } } if v.SelectSqlQuery == nil { invalidParams.Add(smithy.NewErrParamRequired("SelectSqlQuery")) } if v.DatabaseCredentials == nil { invalidParams.Add(smithy.NewErrParamRequired("DatabaseCredentials")) } else if v.DatabaseCredentials != nil { if err := validateRedshiftDatabaseCredentials(v.DatabaseCredentials); err != nil { invalidParams.AddNested("DatabaseCredentials", err.(smithy.InvalidParamsError)) } } if v.S3StagingLocation == nil { invalidParams.Add(smithy.NewErrParamRequired("S3StagingLocation")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3DataSpec(v *types.S3DataSpec) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3DataSpec"} if v.DataLocationS3 == nil { invalidParams.Add(smithy.NewErrParamRequired("DataLocationS3")) } 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.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } if v.ResourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) } if len(v.ResourceType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ResourceType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateBatchPredictionInput(v *CreateBatchPredictionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateBatchPredictionInput"} if v.BatchPredictionId == nil { invalidParams.Add(smithy.NewErrParamRequired("BatchPredictionId")) } if v.MLModelId == nil { invalidParams.Add(smithy.NewErrParamRequired("MLModelId")) } if v.BatchPredictionDataSourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("BatchPredictionDataSourceId")) } if v.OutputUri == nil { invalidParams.Add(smithy.NewErrParamRequired("OutputUri")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateDataSourceFromRDSInput(v *CreateDataSourceFromRDSInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateDataSourceFromRDSInput"} if v.DataSourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSourceId")) } if v.RDSData == nil { invalidParams.Add(smithy.NewErrParamRequired("RDSData")) } else if v.RDSData != nil { if err := validateRDSDataSpec(v.RDSData); err != nil { invalidParams.AddNested("RDSData", err.(smithy.InvalidParamsError)) } } if v.RoleARN == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleARN")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateDataSourceFromRedshiftInput(v *CreateDataSourceFromRedshiftInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateDataSourceFromRedshiftInput"} if v.DataSourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSourceId")) } if v.DataSpec == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSpec")) } else if v.DataSpec != nil { if err := validateRedshiftDataSpec(v.DataSpec); err != nil { invalidParams.AddNested("DataSpec", err.(smithy.InvalidParamsError)) } } if v.RoleARN == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleARN")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateDataSourceFromS3Input(v *CreateDataSourceFromS3Input) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateDataSourceFromS3Input"} if v.DataSourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSourceId")) } if v.DataSpec == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSpec")) } else if v.DataSpec != nil { if err := validateS3DataSpec(v.DataSpec); err != nil { invalidParams.AddNested("DataSpec", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateEvaluationInput(v *CreateEvaluationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateEvaluationInput"} if v.EvaluationId == nil { invalidParams.Add(smithy.NewErrParamRequired("EvaluationId")) } if v.MLModelId == nil { invalidParams.Add(smithy.NewErrParamRequired("MLModelId")) } if v.EvaluationDataSourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("EvaluationDataSourceId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateMLModelInput(v *CreateMLModelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateMLModelInput"} if v.MLModelId == nil { invalidParams.Add(smithy.NewErrParamRequired("MLModelId")) } if len(v.MLModelType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("MLModelType")) } if v.TrainingDataSourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("TrainingDataSourceId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateRealtimeEndpointInput(v *CreateRealtimeEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateRealtimeEndpointInput"} if v.MLModelId == nil { invalidParams.Add(smithy.NewErrParamRequired("MLModelId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteBatchPredictionInput(v *DeleteBatchPredictionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteBatchPredictionInput"} if v.BatchPredictionId == nil { invalidParams.Add(smithy.NewErrParamRequired("BatchPredictionId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteDataSourceInput(v *DeleteDataSourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteDataSourceInput"} if v.DataSourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSourceId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteEvaluationInput(v *DeleteEvaluationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteEvaluationInput"} if v.EvaluationId == nil { invalidParams.Add(smithy.NewErrParamRequired("EvaluationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteMLModelInput(v *DeleteMLModelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteMLModelInput"} if v.MLModelId == nil { invalidParams.Add(smithy.NewErrParamRequired("MLModelId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteRealtimeEndpointInput(v *DeleteRealtimeEndpointInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteRealtimeEndpointInput"} if v.MLModelId == nil { invalidParams.Add(smithy.NewErrParamRequired("MLModelId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteTagsInput(v *DeleteTagsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteTagsInput"} if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if v.ResourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) } if len(v.ResourceType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ResourceType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeTagsInput(v *DescribeTagsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeTagsInput"} if v.ResourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) } if len(v.ResourceType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ResourceType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetBatchPredictionInput(v *GetBatchPredictionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetBatchPredictionInput"} if v.BatchPredictionId == nil { invalidParams.Add(smithy.NewErrParamRequired("BatchPredictionId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetDataSourceInput(v *GetDataSourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetDataSourceInput"} if v.DataSourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSourceId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetEvaluationInput(v *GetEvaluationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetEvaluationInput"} if v.EvaluationId == nil { invalidParams.Add(smithy.NewErrParamRequired("EvaluationId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetMLModelInput(v *GetMLModelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetMLModelInput"} if v.MLModelId == nil { invalidParams.Add(smithy.NewErrParamRequired("MLModelId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPredictInput(v *PredictInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PredictInput"} if v.MLModelId == nil { invalidParams.Add(smithy.NewErrParamRequired("MLModelId")) } if v.Record == nil { invalidParams.Add(smithy.NewErrParamRequired("Record")) } if v.PredictEndpoint == nil { invalidParams.Add(smithy.NewErrParamRequired("PredictEndpoint")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateBatchPredictionInput(v *UpdateBatchPredictionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateBatchPredictionInput"} if v.BatchPredictionId == nil { invalidParams.Add(smithy.NewErrParamRequired("BatchPredictionId")) } if v.BatchPredictionName == nil { invalidParams.Add(smithy.NewErrParamRequired("BatchPredictionName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateDataSourceInput(v *UpdateDataSourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateDataSourceInput"} if v.DataSourceId == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSourceId")) } if v.DataSourceName == nil { invalidParams.Add(smithy.NewErrParamRequired("DataSourceName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateEvaluationInput(v *UpdateEvaluationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateEvaluationInput"} if v.EvaluationId == nil { invalidParams.Add(smithy.NewErrParamRequired("EvaluationId")) } if v.EvaluationName == nil { invalidParams.Add(smithy.NewErrParamRequired("EvaluationName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateMLModelInput(v *UpdateMLModelInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateMLModelInput"} if v.MLModelId == nil { invalidParams.Add(smithy.NewErrParamRequired("MLModelId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,189
aws-sdk-go-v2
aws
Go
/* Package customizations provides customizations for the Machine Learning API client. The Machine Learning API client uses one customization to support the PredictEndpoint input parameter. # Predict Endpoint The predict endpoint customization runs after normal endpoint resolution happens. If the user has provided a value for PredictEndpoint then this customization will overwrite the request's endpoint with that value. */ package customizations
14
aws-sdk-go-v2
aws
Go
package customizations import ( "context" "fmt" "net/url" "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // AddPredictEndpointMiddleware adds the middleware required to set the endpoint // based on Predict's PredictEndpoint input member. func AddPredictEndpointMiddleware(stack *middleware.Stack, endpoint func(interface{}) (*string, error)) error { return stack.Serialize.Insert(&predictEndpoint{}, "ResolveEndpoint", middleware.After) } // predictEndpoint rewrites the endpoint with whatever is specified in the // operation input if it is non-nil and non-empty. type predictEndpoint struct { fetchPredictEndpoint func(interface{}) (*string, error) } // ID returns the id for the middleware. func (*predictEndpoint) ID() string { return "MachineLearning:PredictEndpoint" } // HandleSerialize implements the SerializeMiddleware interface. func (m *predictEndpoint) 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, &smithy.SerializationError{ Err: fmt.Errorf("unknown request type %T", in.Request), } } endpoint, err := m.fetchPredictEndpoint(in.Parameters) if err != nil { return out, metadata, &smithy.SerializationError{ Err: fmt.Errorf("failed to fetch PredictEndpoint value, %v", err), } } if endpoint != nil && len(*endpoint) != 0 { uri, err := url.Parse(*endpoint) if err != nil { return out, metadata, &smithy.SerializationError{ Err: fmt.Errorf("unable to parse predict endpoint, %v", err), } } req.URL = uri } return next.HandleSerialize(ctx, in) }
60
aws-sdk-go-v2
aws
Go
package customizations import ( "context" "strings" "testing" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithyhttp "github.com/aws/smithy-go/transport/http" ) func TestPredictEndpointMiddleware(t *testing.T) { cases := map[string]struct { PredictEndpoint *string ExpectedEndpoint string ExpectedErr string }{ "nil endpoint": {}, "empty endpoint": { PredictEndpoint: ptr.String(""), }, "invalid endpoint": { PredictEndpoint: ptr.String("::::::::"), ExpectedErr: "unable to parse", }, "valid endpoint": { PredictEndpoint: ptr.String("https://example.amazonaws.com/"), ExpectedEndpoint: "https://example.amazonaws.com/", }, } for name, c := range cases { t.Run(name, func(t *testing.T) { m := &predictEndpoint{ fetchPredictEndpoint: func(i interface{}) (*string, error) { return c.PredictEndpoint, nil }, } _, _, err := m.HandleSerialize(context.Background(), middleware.SerializeInput{ Request: smithyhttp.NewStackRequest(), }, middleware.SerializeHandlerFunc( func(ctx context.Context, input middleware.SerializeInput) ( output middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { req, ok := input.Request.(*smithyhttp.Request) if !ok || req == nil { t.Fatalf("expect smithy request, got %T", input.Request) } if c.ExpectedEndpoint != req.URL.String() { t.Errorf("expected url to be `%v`, but was `%v`", c.ExpectedEndpoint, req.URL.String()) } return output, metadata, err }), ) if len(c.ExpectedErr) != 0 { if err == nil { t.Fatalf("expect error, got none") } if e, a := c.ExpectedErr, err.Error(); !strings.Contains(a, e) { t.Fatalf("expect error to contain %v, got %v", e, a) } } else { if err != nil { t.Fatalf("expect no error, got %v", err) } } }) } }
77
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 Machine Learning 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: "machinelearning.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "machinelearning-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "machinelearning-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "machinelearning.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "machinelearning.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "machinelearning-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "machinelearning-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "machinelearning.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "machinelearning-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "machinelearning.{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: "machinelearning-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "machinelearning.{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: "machinelearning-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "machinelearning.{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: "machinelearning-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "machinelearning.{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: "machinelearning.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "machinelearning-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "machinelearning-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "machinelearning.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
305
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 Algorithm string // Enum values for Algorithm const ( AlgorithmSgd Algorithm = "sgd" ) // Values returns all known values for Algorithm. 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 (Algorithm) Values() []Algorithm { return []Algorithm{ "sgd", } } type BatchPredictionFilterVariable string // Enum values for BatchPredictionFilterVariable const ( BatchPredictionFilterVariableCreatedAt BatchPredictionFilterVariable = "CreatedAt" BatchPredictionFilterVariableLastUpdatedAt BatchPredictionFilterVariable = "LastUpdatedAt" BatchPredictionFilterVariableStatus BatchPredictionFilterVariable = "Status" BatchPredictionFilterVariableName BatchPredictionFilterVariable = "Name" BatchPredictionFilterVariableIamUser BatchPredictionFilterVariable = "IAMUser" BatchPredictionFilterVariableMlModelId BatchPredictionFilterVariable = "MLModelId" BatchPredictionFilterVariableDatasourceId BatchPredictionFilterVariable = "DataSourceId" BatchPredictionFilterVariableDataUri BatchPredictionFilterVariable = "DataURI" ) // Values returns all known values for BatchPredictionFilterVariable. 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 (BatchPredictionFilterVariable) Values() []BatchPredictionFilterVariable { return []BatchPredictionFilterVariable{ "CreatedAt", "LastUpdatedAt", "Status", "Name", "IAMUser", "MLModelId", "DataSourceId", "DataURI", } } type DataSourceFilterVariable string // Enum values for DataSourceFilterVariable const ( DataSourceFilterVariableCreatedAt DataSourceFilterVariable = "CreatedAt" DataSourceFilterVariableLastUpdatedAt DataSourceFilterVariable = "LastUpdatedAt" DataSourceFilterVariableStatus DataSourceFilterVariable = "Status" DataSourceFilterVariableName DataSourceFilterVariable = "Name" DataSourceFilterVariableDataUri DataSourceFilterVariable = "DataLocationS3" DataSourceFilterVariableIamUser DataSourceFilterVariable = "IAMUser" ) // Values returns all known values for DataSourceFilterVariable. 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 (DataSourceFilterVariable) Values() []DataSourceFilterVariable { return []DataSourceFilterVariable{ "CreatedAt", "LastUpdatedAt", "Status", "Name", "DataLocationS3", "IAMUser", } } type DetailsAttributes string // Enum values for DetailsAttributes const ( DetailsAttributesPredictiveModelType DetailsAttributes = "PredictiveModelType" DetailsAttributesAlgorithm DetailsAttributes = "Algorithm" ) // Values returns all known values for DetailsAttributes. 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 (DetailsAttributes) Values() []DetailsAttributes { return []DetailsAttributes{ "PredictiveModelType", "Algorithm", } } type EntityStatus string // Enum values for EntityStatus const ( EntityStatusPending EntityStatus = "PENDING" EntityStatusInprogress EntityStatus = "INPROGRESS" EntityStatusFailed EntityStatus = "FAILED" EntityStatusCompleted EntityStatus = "COMPLETED" EntityStatusDeleted EntityStatus = "DELETED" ) // Values returns all known values for EntityStatus. 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 (EntityStatus) Values() []EntityStatus { return []EntityStatus{ "PENDING", "INPROGRESS", "FAILED", "COMPLETED", "DELETED", } } type EvaluationFilterVariable string // Enum values for EvaluationFilterVariable const ( EvaluationFilterVariableCreatedAt EvaluationFilterVariable = "CreatedAt" EvaluationFilterVariableLastUpdatedAt EvaluationFilterVariable = "LastUpdatedAt" EvaluationFilterVariableStatus EvaluationFilterVariable = "Status" EvaluationFilterVariableName EvaluationFilterVariable = "Name" EvaluationFilterVariableIamUser EvaluationFilterVariable = "IAMUser" EvaluationFilterVariableMlModelId EvaluationFilterVariable = "MLModelId" EvaluationFilterVariableDatasourceId EvaluationFilterVariable = "DataSourceId" EvaluationFilterVariableDataUri EvaluationFilterVariable = "DataURI" ) // Values returns all known values for EvaluationFilterVariable. 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 (EvaluationFilterVariable) Values() []EvaluationFilterVariable { return []EvaluationFilterVariable{ "CreatedAt", "LastUpdatedAt", "Status", "Name", "IAMUser", "MLModelId", "DataSourceId", "DataURI", } } type MLModelFilterVariable string // Enum values for MLModelFilterVariable const ( MLModelFilterVariableCreatedAt MLModelFilterVariable = "CreatedAt" MLModelFilterVariableLastUpdatedAt MLModelFilterVariable = "LastUpdatedAt" MLModelFilterVariableStatus MLModelFilterVariable = "Status" MLModelFilterVariableName MLModelFilterVariable = "Name" MLModelFilterVariableIamUser MLModelFilterVariable = "IAMUser" MLModelFilterVariableTrainingDatasourceId MLModelFilterVariable = "TrainingDataSourceId" MLModelFilterVariableRealTimeEndpointStatus MLModelFilterVariable = "RealtimeEndpointStatus" MLModelFilterVariableMlModelType MLModelFilterVariable = "MLModelType" MLModelFilterVariableAlgorithm MLModelFilterVariable = "Algorithm" MLModelFilterVariableTrainingDataUri MLModelFilterVariable = "TrainingDataURI" ) // Values returns all known values for MLModelFilterVariable. 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 (MLModelFilterVariable) Values() []MLModelFilterVariable { return []MLModelFilterVariable{ "CreatedAt", "LastUpdatedAt", "Status", "Name", "IAMUser", "TrainingDataSourceId", "RealtimeEndpointStatus", "MLModelType", "Algorithm", "TrainingDataURI", } } type MLModelType string // Enum values for MLModelType const ( MLModelTypeRegression MLModelType = "REGRESSION" MLModelTypeBinary MLModelType = "BINARY" MLModelTypeMulticlass MLModelType = "MULTICLASS" ) // Values returns all known values for MLModelType. 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 (MLModelType) Values() []MLModelType { return []MLModelType{ "REGRESSION", "BINARY", "MULTICLASS", } } type RealtimeEndpointStatus string // Enum values for RealtimeEndpointStatus const ( RealtimeEndpointStatusNone RealtimeEndpointStatus = "NONE" RealtimeEndpointStatusReady RealtimeEndpointStatus = "READY" RealtimeEndpointStatusUpdating RealtimeEndpointStatus = "UPDATING" RealtimeEndpointStatusFailed RealtimeEndpointStatus = "FAILED" ) // Values returns all known values for RealtimeEndpointStatus. 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 (RealtimeEndpointStatus) Values() []RealtimeEndpointStatus { return []RealtimeEndpointStatus{ "NONE", "READY", "UPDATING", "FAILED", } } type SortOrder string // Enum values for SortOrder const ( SortOrderAsc SortOrder = "asc" SortOrderDsc SortOrder = "dsc" ) // Values returns all known values for SortOrder. 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 (SortOrder) Values() []SortOrder { return []SortOrder{ "asc", "dsc", } } type TaggableResourceType string // Enum values for TaggableResourceType const ( TaggableResourceTypeBatchPrediction TaggableResourceType = "BatchPrediction" TaggableResourceTypeDatasource TaggableResourceType = "DataSource" TaggableResourceTypeEvaluation TaggableResourceType = "Evaluation" TaggableResourceTypeMlModel TaggableResourceType = "MLModel" ) // Values returns all known values for TaggableResourceType. 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 (TaggableResourceType) Values() []TaggableResourceType { return []TaggableResourceType{ "BatchPrediction", "DataSource", "Evaluation", "MLModel", } }
265
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" ) // A second request to use or change an object was not allowed. This can result // from retrying a request using a parameter that was not present in the original // request. type IdempotentParameterMismatchException struct { Message *string ErrorCodeOverride *string Code int32 noSmithyDocumentSerde } func (e *IdempotentParameterMismatchException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *IdempotentParameterMismatchException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *IdempotentParameterMismatchException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "IdempotentParameterMismatchException" } return *e.ErrorCodeOverride } func (e *IdempotentParameterMismatchException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An error on the server occurred when trying to process a request. type InternalServerException struct { Message *string ErrorCodeOverride *string Code int32 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 } // An error on the client occurred. Typically, the cause is an invalid input value. type InvalidInputException struct { Message *string ErrorCodeOverride *string Code int32 noSmithyDocumentSerde } func (e *InvalidInputException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidInputException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidInputException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidInputException" } return *e.ErrorCodeOverride } func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } type InvalidTagException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidTagException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidTagException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidTagException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidTagException" } return *e.ErrorCodeOverride } func (e *InvalidTagException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The subscriber exceeded the maximum number of operations. This exception can // occur when listing objects such as DataSource . type LimitExceededException struct { Message *string ErrorCodeOverride *string Code int32 noSmithyDocumentSerde } func (e *LimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *LimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *LimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "LimitExceededException" } return *e.ErrorCodeOverride } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The exception is thrown when a predict request is made to an unmounted MLModel . type PredictorNotMountedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *PredictorNotMountedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *PredictorNotMountedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *PredictorNotMountedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "PredictorNotMountedException" } return *e.ErrorCodeOverride } func (e *PredictorNotMountedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A specified resource cannot be located. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string Code int32 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 } type TagLimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TagLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TagLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TagLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TagLimitExceededException" } return *e.ErrorCodeOverride } func (e *TagLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
230