repo_name stringlengths 1 52 | repo_creator stringclasses 6
values | programming_language stringclasses 4
values | code stringlengths 0 9.68M | num_lines int64 1 234k |
|---|---|---|---|---|
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediapackagevod
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/mediapackagevod/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpConfigureLogs struct {
}
func (*awsRestjson1_serializeOpConfigureLogs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpConfigureLogs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ConfigureLogsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_groups/{Id}/configure_logs")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsConfigureLogsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentConfigureLogsInput(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_serializeOpHttpBindingsConfigureLogsInput(v *ConfigureLogsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("Id").String(*v.Id); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentConfigureLogsInput(v *ConfigureLogsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EgressAccessLogs != nil {
ok := object.Key("egressAccessLogs")
if err := awsRestjson1_serializeDocumentEgressAccessLogs(v.EgressAccessLogs, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateAsset struct {
}
func (*awsRestjson1_serializeOpCreateAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateAssetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateAssetInput(v *CreateAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAssetInput(v *CreateAssetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.PackagingGroupId != nil {
ok := object.Key("packagingGroupId")
ok.String(*v.PackagingGroupId)
}
if v.ResourceId != nil {
ok := object.Key("resourceId")
ok.String(*v.ResourceId)
}
if v.SourceArn != nil {
ok := object.Key("sourceArn")
ok.String(*v.SourceArn)
}
if v.SourceRoleArn != nil {
ok := object.Key("sourceRoleArn")
ok.String(*v.SourceRoleArn)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreatePackagingConfiguration struct {
}
func (*awsRestjson1_serializeOpCreatePackagingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreatePackagingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreatePackagingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_configurations")
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_serializeOpDocumentCreatePackagingConfigurationInput(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_serializeOpHttpBindingsCreatePackagingConfigurationInput(v *CreatePackagingConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreatePackagingConfigurationInput(v *CreatePackagingConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CmafPackage != nil {
ok := object.Key("cmafPackage")
if err := awsRestjson1_serializeDocumentCmafPackage(v.CmafPackage, ok); err != nil {
return err
}
}
if v.DashPackage != nil {
ok := object.Key("dashPackage")
if err := awsRestjson1_serializeDocumentDashPackage(v.DashPackage, ok); err != nil {
return err
}
}
if v.HlsPackage != nil {
ok := object.Key("hlsPackage")
if err := awsRestjson1_serializeDocumentHlsPackage(v.HlsPackage, ok); err != nil {
return err
}
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.MssPackage != nil {
ok := object.Key("mssPackage")
if err := awsRestjson1_serializeDocumentMssPackage(v.MssPackage, ok); err != nil {
return err
}
}
if v.PackagingGroupId != nil {
ok := object.Key("packagingGroupId")
ok.String(*v.PackagingGroupId)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreatePackagingGroup struct {
}
func (*awsRestjson1_serializeOpCreatePackagingGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreatePackagingGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreatePackagingGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_groups")
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_serializeOpDocumentCreatePackagingGroupInput(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_serializeOpHttpBindingsCreatePackagingGroupInput(v *CreatePackagingGroupInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreatePackagingGroupInput(v *CreatePackagingGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Authorization != nil {
ok := object.Key("authorization")
if err := awsRestjson1_serializeDocumentAuthorization(v.Authorization, ok); err != nil {
return err
}
}
if v.EgressAccessLogs != nil {
ok := object.Key("egressAccessLogs")
if err := awsRestjson1_serializeDocumentEgressAccessLogs(v.EgressAccessLogs, ok); err != nil {
return err
}
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteAsset struct {
}
func (*awsRestjson1_serializeOpDeleteAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{Id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteAssetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteAssetInput(v *DeleteAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("Id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeletePackagingConfiguration struct {
}
func (*awsRestjson1_serializeOpDeletePackagingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeletePackagingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeletePackagingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_configurations/{Id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeletePackagingConfigurationInput(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_serializeOpHttpBindingsDeletePackagingConfigurationInput(v *DeletePackagingConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("Id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeletePackagingGroup struct {
}
func (*awsRestjson1_serializeOpDeletePackagingGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeletePackagingGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeletePackagingGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_groups/{Id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeletePackagingGroupInput(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_serializeOpHttpBindingsDeletePackagingGroupInput(v *DeletePackagingGroupInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("Id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeAsset struct {
}
func (*awsRestjson1_serializeOpDescribeAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{Id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeAssetInput(v *DescribeAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("Id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribePackagingConfiguration struct {
}
func (*awsRestjson1_serializeOpDescribePackagingConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribePackagingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribePackagingConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_configurations/{Id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribePackagingConfigurationInput(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_serializeOpHttpBindingsDescribePackagingConfigurationInput(v *DescribePackagingConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("Id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribePackagingGroup struct {
}
func (*awsRestjson1_serializeOpDescribePackagingGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribePackagingGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribePackagingGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_groups/{Id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDescribePackagingGroupInput(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_serializeOpHttpBindingsDescribePackagingGroupInput(v *DescribePackagingGroupInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("Id").String(*v.Id); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListAssets struct {
}
func (*awsRestjson1_serializeOpListAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAssetsInput(v *ListAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != 0 {
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PackagingGroupId != nil {
encoder.SetQuery("packagingGroupId").String(*v.PackagingGroupId)
}
return nil
}
type awsRestjson1_serializeOpListPackagingConfigurations struct {
}
func (*awsRestjson1_serializeOpListPackagingConfigurations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListPackagingConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListPackagingConfigurationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_configurations")
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_serializeOpHttpBindingsListPackagingConfigurationsInput(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_serializeOpHttpBindingsListPackagingConfigurationsInput(v *ListPackagingConfigurationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != 0 {
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PackagingGroupId != nil {
encoder.SetQuery("packagingGroupId").String(*v.PackagingGroupId)
}
return nil
}
type awsRestjson1_serializeOpListPackagingGroups struct {
}
func (*awsRestjson1_serializeOpListPackagingGroups) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListPackagingGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListPackagingGroupsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_groups")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListPackagingGroupsInput(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_serializeOpHttpBindingsListPackagingGroupsInput(v *ListPackagingGroupsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != 0 {
encoder.SetQuery("maxResults").Integer(v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListTagsForResource struct {
}
func (*awsRestjson1_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_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_serializeDocument__mapOf__string(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_serializeOpUpdatePackagingGroup struct {
}
func (*awsRestjson1_serializeOpUpdatePackagingGroup) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdatePackagingGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdatePackagingGroupInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/packaging_groups/{Id}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdatePackagingGroupInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdatePackagingGroupInput(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_serializeOpHttpBindingsUpdatePackagingGroupInput(v *UpdatePackagingGroupInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Id == nil || len(*v.Id) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")}
}
if v.Id != nil {
if err := encoder.SetURI("Id").String(*v.Id); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdatePackagingGroupInput(v *UpdatePackagingGroupInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Authorization != nil {
ok := object.Key("authorization")
if err := awsRestjson1_serializeDocumentAuthorization(v.Authorization, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocument__listOf__PeriodTriggersElement(v []types.PeriodTriggersElement, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocument__listOf__string(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_serializeDocument__listOfDashManifest(v []types.DashManifest, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentDashManifest(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocument__listOfHlsManifest(v []types.HlsManifest, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentHlsManifest(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocument__listOfMssManifest(v []types.MssManifest, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentMssManifest(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocument__mapOf__string(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_serializeDocumentAuthorization(v *types.Authorization, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CdnIdentifierSecret != nil {
ok := object.Key("cdnIdentifierSecret")
ok.String(*v.CdnIdentifierSecret)
}
if v.SecretsRoleArn != nil {
ok := object.Key("secretsRoleArn")
ok.String(*v.SecretsRoleArn)
}
return nil
}
func awsRestjson1_serializeDocumentCmafEncryption(v *types.CmafEncryption, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConstantInitializationVector != nil {
ok := object.Key("constantInitializationVector")
ok.String(*v.ConstantInitializationVector)
}
if v.SpekeKeyProvider != nil {
ok := object.Key("spekeKeyProvider")
if err := awsRestjson1_serializeDocumentSpekeKeyProvider(v.SpekeKeyProvider, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCmafPackage(v *types.CmafPackage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Encryption != nil {
ok := object.Key("encryption")
if err := awsRestjson1_serializeDocumentCmafEncryption(v.Encryption, ok); err != nil {
return err
}
}
if v.HlsManifests != nil {
ok := object.Key("hlsManifests")
if err := awsRestjson1_serializeDocument__listOfHlsManifest(v.HlsManifests, ok); err != nil {
return err
}
}
if v.IncludeEncoderConfigurationInSegments {
ok := object.Key("includeEncoderConfigurationInSegments")
ok.Boolean(v.IncludeEncoderConfigurationInSegments)
}
if v.SegmentDurationSeconds != 0 {
ok := object.Key("segmentDurationSeconds")
ok.Integer(v.SegmentDurationSeconds)
}
return nil
}
func awsRestjson1_serializeDocumentDashEncryption(v *types.DashEncryption, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SpekeKeyProvider != nil {
ok := object.Key("spekeKeyProvider")
if err := awsRestjson1_serializeDocumentSpekeKeyProvider(v.SpekeKeyProvider, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDashManifest(v *types.DashManifest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ManifestLayout) > 0 {
ok := object.Key("manifestLayout")
ok.String(string(v.ManifestLayout))
}
if v.ManifestName != nil {
ok := object.Key("manifestName")
ok.String(*v.ManifestName)
}
if v.MinBufferTimeSeconds != 0 {
ok := object.Key("minBufferTimeSeconds")
ok.Integer(v.MinBufferTimeSeconds)
}
if len(v.Profile) > 0 {
ok := object.Key("profile")
ok.String(string(v.Profile))
}
if len(v.ScteMarkersSource) > 0 {
ok := object.Key("scteMarkersSource")
ok.String(string(v.ScteMarkersSource))
}
if v.StreamSelection != nil {
ok := object.Key("streamSelection")
if err := awsRestjson1_serializeDocumentStreamSelection(v.StreamSelection, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDashPackage(v *types.DashPackage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DashManifests != nil {
ok := object.Key("dashManifests")
if err := awsRestjson1_serializeDocument__listOfDashManifest(v.DashManifests, ok); err != nil {
return err
}
}
if v.Encryption != nil {
ok := object.Key("encryption")
if err := awsRestjson1_serializeDocumentDashEncryption(v.Encryption, ok); err != nil {
return err
}
}
if v.IncludeEncoderConfigurationInSegments {
ok := object.Key("includeEncoderConfigurationInSegments")
ok.Boolean(v.IncludeEncoderConfigurationInSegments)
}
if v.IncludeIframeOnlyStream {
ok := object.Key("includeIframeOnlyStream")
ok.Boolean(v.IncludeIframeOnlyStream)
}
if v.PeriodTriggers != nil {
ok := object.Key("periodTriggers")
if err := awsRestjson1_serializeDocument__listOf__PeriodTriggersElement(v.PeriodTriggers, ok); err != nil {
return err
}
}
if v.SegmentDurationSeconds != 0 {
ok := object.Key("segmentDurationSeconds")
ok.Integer(v.SegmentDurationSeconds)
}
if len(v.SegmentTemplateFormat) > 0 {
ok := object.Key("segmentTemplateFormat")
ok.String(string(v.SegmentTemplateFormat))
}
return nil
}
func awsRestjson1_serializeDocumentEgressAccessLogs(v *types.EgressAccessLogs, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LogGroupName != nil {
ok := object.Key("logGroupName")
ok.String(*v.LogGroupName)
}
return nil
}
func awsRestjson1_serializeDocumentEncryptionContractConfiguration(v *types.EncryptionContractConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.PresetSpeke20Audio) > 0 {
ok := object.Key("presetSpeke20Audio")
ok.String(string(v.PresetSpeke20Audio))
}
if len(v.PresetSpeke20Video) > 0 {
ok := object.Key("presetSpeke20Video")
ok.String(string(v.PresetSpeke20Video))
}
return nil
}
func awsRestjson1_serializeDocumentHlsEncryption(v *types.HlsEncryption, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConstantInitializationVector != nil {
ok := object.Key("constantInitializationVector")
ok.String(*v.ConstantInitializationVector)
}
if len(v.EncryptionMethod) > 0 {
ok := object.Key("encryptionMethod")
ok.String(string(v.EncryptionMethod))
}
if v.SpekeKeyProvider != nil {
ok := object.Key("spekeKeyProvider")
if err := awsRestjson1_serializeDocumentSpekeKeyProvider(v.SpekeKeyProvider, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentHlsManifest(v *types.HlsManifest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AdMarkers) > 0 {
ok := object.Key("adMarkers")
ok.String(string(v.AdMarkers))
}
if v.IncludeIframeOnlyStream {
ok := object.Key("includeIframeOnlyStream")
ok.Boolean(v.IncludeIframeOnlyStream)
}
if v.ManifestName != nil {
ok := object.Key("manifestName")
ok.String(*v.ManifestName)
}
if v.ProgramDateTimeIntervalSeconds != 0 {
ok := object.Key("programDateTimeIntervalSeconds")
ok.Integer(v.ProgramDateTimeIntervalSeconds)
}
if v.RepeatExtXKey {
ok := object.Key("repeatExtXKey")
ok.Boolean(v.RepeatExtXKey)
}
if v.StreamSelection != nil {
ok := object.Key("streamSelection")
if err := awsRestjson1_serializeDocumentStreamSelection(v.StreamSelection, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentHlsPackage(v *types.HlsPackage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Encryption != nil {
ok := object.Key("encryption")
if err := awsRestjson1_serializeDocumentHlsEncryption(v.Encryption, ok); err != nil {
return err
}
}
if v.HlsManifests != nil {
ok := object.Key("hlsManifests")
if err := awsRestjson1_serializeDocument__listOfHlsManifest(v.HlsManifests, ok); err != nil {
return err
}
}
if v.IncludeDvbSubtitles {
ok := object.Key("includeDvbSubtitles")
ok.Boolean(v.IncludeDvbSubtitles)
}
if v.SegmentDurationSeconds != 0 {
ok := object.Key("segmentDurationSeconds")
ok.Integer(v.SegmentDurationSeconds)
}
if v.UseAudioRenditionGroup {
ok := object.Key("useAudioRenditionGroup")
ok.Boolean(v.UseAudioRenditionGroup)
}
return nil
}
func awsRestjson1_serializeDocumentMssEncryption(v *types.MssEncryption, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SpekeKeyProvider != nil {
ok := object.Key("spekeKeyProvider")
if err := awsRestjson1_serializeDocumentSpekeKeyProvider(v.SpekeKeyProvider, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMssManifest(v *types.MssManifest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ManifestName != nil {
ok := object.Key("manifestName")
ok.String(*v.ManifestName)
}
if v.StreamSelection != nil {
ok := object.Key("streamSelection")
if err := awsRestjson1_serializeDocumentStreamSelection(v.StreamSelection, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMssPackage(v *types.MssPackage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Encryption != nil {
ok := object.Key("encryption")
if err := awsRestjson1_serializeDocumentMssEncryption(v.Encryption, ok); err != nil {
return err
}
}
if v.MssManifests != nil {
ok := object.Key("mssManifests")
if err := awsRestjson1_serializeDocument__listOfMssManifest(v.MssManifests, ok); err != nil {
return err
}
}
if v.SegmentDurationSeconds != 0 {
ok := object.Key("segmentDurationSeconds")
ok.Integer(v.SegmentDurationSeconds)
}
return nil
}
func awsRestjson1_serializeDocumentSpekeKeyProvider(v *types.SpekeKeyProvider, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EncryptionContractConfiguration != nil {
ok := object.Key("encryptionContractConfiguration")
if err := awsRestjson1_serializeDocumentEncryptionContractConfiguration(v.EncryptionContractConfiguration, ok); err != nil {
return err
}
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.SystemIds != nil {
ok := object.Key("systemIds")
if err := awsRestjson1_serializeDocument__listOf__string(v.SystemIds, ok); err != nil {
return err
}
}
if v.Url != nil {
ok := object.Key("url")
ok.String(*v.Url)
}
return nil
}
func awsRestjson1_serializeDocumentStreamSelection(v *types.StreamSelection, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxVideoBitsPerSecond != 0 {
ok := object.Key("maxVideoBitsPerSecond")
ok.Integer(v.MaxVideoBitsPerSecond)
}
if v.MinVideoBitsPerSecond != 0 {
ok := object.Key("minVideoBitsPerSecond")
ok.Integer(v.MinVideoBitsPerSecond)
}
if len(v.StreamOrder) > 0 {
ok := object.Key("streamOrder")
ok.String(string(v.StreamOrder))
}
return nil
}
func awsRestjson1_serializeDocumentTags(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
}
| 1,697 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediapackagevod
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/mediapackagevod/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpConfigureLogs struct {
}
func (*validateOpConfigureLogs) ID() string {
return "OperationInputValidation"
}
func (m *validateOpConfigureLogs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ConfigureLogsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpConfigureLogsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAsset struct {
}
func (*validateOpCreateAsset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAsset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAssetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAssetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreatePackagingConfiguration struct {
}
func (*validateOpCreatePackagingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreatePackagingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreatePackagingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreatePackagingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreatePackagingGroup struct {
}
func (*validateOpCreatePackagingGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreatePackagingGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreatePackagingGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreatePackagingGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAsset struct {
}
func (*validateOpDeleteAsset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAsset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAssetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAssetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeletePackagingConfiguration struct {
}
func (*validateOpDeletePackagingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeletePackagingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeletePackagingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeletePackagingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeletePackagingGroup struct {
}
func (*validateOpDeletePackagingGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeletePackagingGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeletePackagingGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeletePackagingGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeAsset struct {
}
func (*validateOpDescribeAsset) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeAsset) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeAssetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeAssetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribePackagingConfiguration struct {
}
func (*validateOpDescribePackagingConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribePackagingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribePackagingConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribePackagingConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribePackagingGroup struct {
}
func (*validateOpDescribePackagingGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribePackagingGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribePackagingGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribePackagingGroupInput(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 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 validateOpUpdatePackagingGroup struct {
}
func (*validateOpUpdatePackagingGroup) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdatePackagingGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdatePackagingGroupInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdatePackagingGroupInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpConfigureLogsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpConfigureLogs{}, middleware.After)
}
func addOpCreateAssetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAsset{}, middleware.After)
}
func addOpCreatePackagingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreatePackagingConfiguration{}, middleware.After)
}
func addOpCreatePackagingGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreatePackagingGroup{}, middleware.After)
}
func addOpDeleteAssetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAsset{}, middleware.After)
}
func addOpDeletePackagingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeletePackagingConfiguration{}, middleware.After)
}
func addOpDeletePackagingGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeletePackagingGroup{}, middleware.After)
}
func addOpDescribeAssetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeAsset{}, middleware.After)
}
func addOpDescribePackagingConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribePackagingConfiguration{}, middleware.After)
}
func addOpDescribePackagingGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribePackagingGroup{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, 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 addOpUpdatePackagingGroupValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdatePackagingGroup{}, middleware.After)
}
func validateAuthorization(v *types.Authorization) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Authorization"}
if v.CdnIdentifierSecret == nil {
invalidParams.Add(smithy.NewErrParamRequired("CdnIdentifierSecret"))
}
if v.SecretsRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("SecretsRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCmafEncryption(v *types.CmafEncryption) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CmafEncryption"}
if v.SpekeKeyProvider == nil {
invalidParams.Add(smithy.NewErrParamRequired("SpekeKeyProvider"))
} else if v.SpekeKeyProvider != nil {
if err := validateSpekeKeyProvider(v.SpekeKeyProvider); err != nil {
invalidParams.AddNested("SpekeKeyProvider", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCmafPackage(v *types.CmafPackage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CmafPackage"}
if v.Encryption != nil {
if err := validateCmafEncryption(v.Encryption); err != nil {
invalidParams.AddNested("Encryption", err.(smithy.InvalidParamsError))
}
}
if v.HlsManifests == nil {
invalidParams.Add(smithy.NewErrParamRequired("HlsManifests"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDashEncryption(v *types.DashEncryption) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DashEncryption"}
if v.SpekeKeyProvider == nil {
invalidParams.Add(smithy.NewErrParamRequired("SpekeKeyProvider"))
} else if v.SpekeKeyProvider != nil {
if err := validateSpekeKeyProvider(v.SpekeKeyProvider); err != nil {
invalidParams.AddNested("SpekeKeyProvider", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDashPackage(v *types.DashPackage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DashPackage"}
if v.DashManifests == nil {
invalidParams.Add(smithy.NewErrParamRequired("DashManifests"))
}
if v.Encryption != nil {
if err := validateDashEncryption(v.Encryption); err != nil {
invalidParams.AddNested("Encryption", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEncryptionContractConfiguration(v *types.EncryptionContractConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EncryptionContractConfiguration"}
if len(v.PresetSpeke20Audio) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("PresetSpeke20Audio"))
}
if len(v.PresetSpeke20Video) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("PresetSpeke20Video"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHlsEncryption(v *types.HlsEncryption) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HlsEncryption"}
if v.SpekeKeyProvider == nil {
invalidParams.Add(smithy.NewErrParamRequired("SpekeKeyProvider"))
} else if v.SpekeKeyProvider != nil {
if err := validateSpekeKeyProvider(v.SpekeKeyProvider); err != nil {
invalidParams.AddNested("SpekeKeyProvider", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHlsPackage(v *types.HlsPackage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HlsPackage"}
if v.Encryption != nil {
if err := validateHlsEncryption(v.Encryption); err != nil {
invalidParams.AddNested("Encryption", err.(smithy.InvalidParamsError))
}
}
if v.HlsManifests == nil {
invalidParams.Add(smithy.NewErrParamRequired("HlsManifests"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMssEncryption(v *types.MssEncryption) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MssEncryption"}
if v.SpekeKeyProvider == nil {
invalidParams.Add(smithy.NewErrParamRequired("SpekeKeyProvider"))
} else if v.SpekeKeyProvider != nil {
if err := validateSpekeKeyProvider(v.SpekeKeyProvider); err != nil {
invalidParams.AddNested("SpekeKeyProvider", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMssPackage(v *types.MssPackage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MssPackage"}
if v.Encryption != nil {
if err := validateMssEncryption(v.Encryption); err != nil {
invalidParams.AddNested("Encryption", err.(smithy.InvalidParamsError))
}
}
if v.MssManifests == nil {
invalidParams.Add(smithy.NewErrParamRequired("MssManifests"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSpekeKeyProvider(v *types.SpekeKeyProvider) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SpekeKeyProvider"}
if v.EncryptionContractConfiguration != nil {
if err := validateEncryptionContractConfiguration(v.EncryptionContractConfiguration); err != nil {
invalidParams.AddNested("EncryptionContractConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if v.SystemIds == nil {
invalidParams.Add(smithy.NewErrParamRequired("SystemIds"))
}
if v.Url == nil {
invalidParams.Add(smithy.NewErrParamRequired("Url"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpConfigureLogsInput(v *ConfigureLogsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConfigureLogsInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAssetInput(v *CreateAssetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAssetInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.PackagingGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PackagingGroupId"))
}
if v.SourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceArn"))
}
if v.SourceRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreatePackagingConfigurationInput(v *CreatePackagingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreatePackagingConfigurationInput"}
if v.CmafPackage != nil {
if err := validateCmafPackage(v.CmafPackage); err != nil {
invalidParams.AddNested("CmafPackage", err.(smithy.InvalidParamsError))
}
}
if v.DashPackage != nil {
if err := validateDashPackage(v.DashPackage); err != nil {
invalidParams.AddNested("DashPackage", err.(smithy.InvalidParamsError))
}
}
if v.HlsPackage != nil {
if err := validateHlsPackage(v.HlsPackage); err != nil {
invalidParams.AddNested("HlsPackage", err.(smithy.InvalidParamsError))
}
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if v.MssPackage != nil {
if err := validateMssPackage(v.MssPackage); err != nil {
invalidParams.AddNested("MssPackage", err.(smithy.InvalidParamsError))
}
}
if v.PackagingGroupId == nil {
invalidParams.Add(smithy.NewErrParamRequired("PackagingGroupId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreatePackagingGroupInput(v *CreatePackagingGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreatePackagingGroupInput"}
if v.Authorization != nil {
if err := validateAuthorization(v.Authorization); err != nil {
invalidParams.AddNested("Authorization", err.(smithy.InvalidParamsError))
}
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAssetInput(v *DeleteAssetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAssetInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeletePackagingConfigurationInput(v *DeletePackagingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeletePackagingConfigurationInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeletePackagingGroupInput(v *DeletePackagingGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeletePackagingGroupInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeAssetInput(v *DescribeAssetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeAssetInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribePackagingConfigurationInput(v *DescribePackagingConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribePackagingConfigurationInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribePackagingGroupInput(v *DescribePackagingGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribePackagingGroupInput"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
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 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 validateOpUpdatePackagingGroupInput(v *UpdatePackagingGroupInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdatePackagingGroupInput"}
if v.Authorization != nil {
if err := validateAuthorization(v.Authorization); err != nil {
invalidParams.AddNested("Authorization", err.(smithy.InvalidParamsError))
}
}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 824 |
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 MediaPackage Vod 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: "mediapackage-vod.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "mediapackage-vod-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "mediapackage-vod-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediapackage-vod.{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: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "mediapackage-vod.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "mediapackage-vod-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "mediapackage-vod-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediapackage-vod.{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: "mediapackage-vod-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediapackage-vod.{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: "mediapackage-vod-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediapackage-vod.{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: "mediapackage-vod-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediapackage-vod.{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: "mediapackage-vod-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediapackage-vod.{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: "mediapackage-vod.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "mediapackage-vod-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "mediapackage-vod-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediapackage-vod.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 344 |
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 PeriodTriggersElement string
// Enum values for PeriodTriggersElement
const (
PeriodTriggersElementAds PeriodTriggersElement = "ADS"
)
// Values returns all known values for PeriodTriggersElement. 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 (PeriodTriggersElement) Values() []PeriodTriggersElement {
return []PeriodTriggersElement{
"ADS",
}
}
type AdMarkers string
// Enum values for AdMarkers
const (
AdMarkersNone AdMarkers = "NONE"
AdMarkersScte35Enhanced AdMarkers = "SCTE35_ENHANCED"
AdMarkersPassthrough AdMarkers = "PASSTHROUGH"
)
// Values returns all known values for AdMarkers. 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 (AdMarkers) Values() []AdMarkers {
return []AdMarkers{
"NONE",
"SCTE35_ENHANCED",
"PASSTHROUGH",
}
}
type EncryptionMethod string
// Enum values for EncryptionMethod
const (
EncryptionMethodAes128 EncryptionMethod = "AES_128"
EncryptionMethodSampleAes EncryptionMethod = "SAMPLE_AES"
)
// Values returns all known values for EncryptionMethod. 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 (EncryptionMethod) Values() []EncryptionMethod {
return []EncryptionMethod{
"AES_128",
"SAMPLE_AES",
}
}
type ManifestLayout string
// Enum values for ManifestLayout
const (
ManifestLayoutFull ManifestLayout = "FULL"
ManifestLayoutCompact ManifestLayout = "COMPACT"
)
// Values returns all known values for ManifestLayout. 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 (ManifestLayout) Values() []ManifestLayout {
return []ManifestLayout{
"FULL",
"COMPACT",
}
}
type PresetSpeke20Audio string
// Enum values for PresetSpeke20Audio
const (
PresetSpeke20AudioPresetAudio1 PresetSpeke20Audio = "PRESET-AUDIO-1"
PresetSpeke20AudioPresetAudio2 PresetSpeke20Audio = "PRESET-AUDIO-2"
PresetSpeke20AudioPresetAudio3 PresetSpeke20Audio = "PRESET-AUDIO-3"
PresetSpeke20AudioShared PresetSpeke20Audio = "SHARED"
PresetSpeke20AudioUnencrypted PresetSpeke20Audio = "UNENCRYPTED"
)
// Values returns all known values for PresetSpeke20Audio. 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 (PresetSpeke20Audio) Values() []PresetSpeke20Audio {
return []PresetSpeke20Audio{
"PRESET-AUDIO-1",
"PRESET-AUDIO-2",
"PRESET-AUDIO-3",
"SHARED",
"UNENCRYPTED",
}
}
type PresetSpeke20Video string
// Enum values for PresetSpeke20Video
const (
PresetSpeke20VideoPresetVideo1 PresetSpeke20Video = "PRESET-VIDEO-1"
PresetSpeke20VideoPresetVideo2 PresetSpeke20Video = "PRESET-VIDEO-2"
PresetSpeke20VideoPresetVideo3 PresetSpeke20Video = "PRESET-VIDEO-3"
PresetSpeke20VideoPresetVideo4 PresetSpeke20Video = "PRESET-VIDEO-4"
PresetSpeke20VideoPresetVideo5 PresetSpeke20Video = "PRESET-VIDEO-5"
PresetSpeke20VideoPresetVideo6 PresetSpeke20Video = "PRESET-VIDEO-6"
PresetSpeke20VideoPresetVideo7 PresetSpeke20Video = "PRESET-VIDEO-7"
PresetSpeke20VideoPresetVideo8 PresetSpeke20Video = "PRESET-VIDEO-8"
PresetSpeke20VideoShared PresetSpeke20Video = "SHARED"
PresetSpeke20VideoUnencrypted PresetSpeke20Video = "UNENCRYPTED"
)
// Values returns all known values for PresetSpeke20Video. 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 (PresetSpeke20Video) Values() []PresetSpeke20Video {
return []PresetSpeke20Video{
"PRESET-VIDEO-1",
"PRESET-VIDEO-2",
"PRESET-VIDEO-3",
"PRESET-VIDEO-4",
"PRESET-VIDEO-5",
"PRESET-VIDEO-6",
"PRESET-VIDEO-7",
"PRESET-VIDEO-8",
"SHARED",
"UNENCRYPTED",
}
}
type Profile string
// Enum values for Profile
const (
ProfileNone Profile = "NONE"
ProfileHbbtv15 Profile = "HBBTV_1_5"
)
// Values returns all known values for Profile. 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 (Profile) Values() []Profile {
return []Profile{
"NONE",
"HBBTV_1_5",
}
}
type ScteMarkersSource string
// Enum values for ScteMarkersSource
const (
ScteMarkersSourceSegments ScteMarkersSource = "SEGMENTS"
ScteMarkersSourceManifest ScteMarkersSource = "MANIFEST"
)
// Values returns all known values for ScteMarkersSource. 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 (ScteMarkersSource) Values() []ScteMarkersSource {
return []ScteMarkersSource{
"SEGMENTS",
"MANIFEST",
}
}
type SegmentTemplateFormat string
// Enum values for SegmentTemplateFormat
const (
SegmentTemplateFormatNumberWithTimeline SegmentTemplateFormat = "NUMBER_WITH_TIMELINE"
SegmentTemplateFormatTimeWithTimeline SegmentTemplateFormat = "TIME_WITH_TIMELINE"
SegmentTemplateFormatNumberWithDuration SegmentTemplateFormat = "NUMBER_WITH_DURATION"
)
// Values returns all known values for SegmentTemplateFormat. 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 (SegmentTemplateFormat) Values() []SegmentTemplateFormat {
return []SegmentTemplateFormat{
"NUMBER_WITH_TIMELINE",
"TIME_WITH_TIMELINE",
"NUMBER_WITH_DURATION",
}
}
type StreamOrder string
// Enum values for StreamOrder
const (
StreamOrderOriginal StreamOrder = "ORIGINAL"
StreamOrderVideoBitrateAscending StreamOrder = "VIDEO_BITRATE_ASCENDING"
StreamOrderVideoBitrateDescending StreamOrder = "VIDEO_BITRATE_DESCENDING"
)
// Values returns all known values for StreamOrder. 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 (StreamOrder) Values() []StreamOrder {
return []StreamOrder{
"ORIGINAL",
"VIDEO_BITRATE_ASCENDING",
"VIDEO_BITRATE_DESCENDING",
}
}
| 210 |
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 client is not authorized to access the requested resource.
type ForbiddenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ForbiddenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ForbiddenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ForbiddenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ForbiddenException"
}
return *e.ErrorCodeOverride
}
func (e *ForbiddenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// An unexpected error occurred.
type InternalServerErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerErrorException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The requested resource does not exist.
type NotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *NotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// An unexpected error occurred.
type ServiceUnavailableException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ServiceUnavailableException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceUnavailableException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceUnavailableException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceUnavailableException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The client has exceeded their resource or throttling limits.
type TooManyRequestsException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *TooManyRequestsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TooManyRequestsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TooManyRequestsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TooManyRequestsException"
}
return *e.ErrorCodeOverride
}
func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The parameters sent in the request are not valid.
type UnprocessableEntityException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *UnprocessableEntityException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnprocessableEntityException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnprocessableEntityException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnprocessableEntityException"
}
return *e.ErrorCodeOverride
}
func (e *UnprocessableEntityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 165 |
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"
)
// A MediaPackage VOD Asset resource.
type AssetShallow struct {
// The ARN of the Asset.
Arn *string
// The time the Asset was initially submitted for Ingest.
CreatedAt *string
// The unique identifier for the Asset.
Id *string
// The ID of the PackagingGroup for the Asset.
PackagingGroupId *string
// The resource ID to include in SPEKE key requests.
ResourceId *string
// ARN of the source object in S3.
SourceArn *string
// The IAM role ARN used to access the source S3 bucket.
SourceRoleArn *string
// A collection of tags associated with a resource
Tags map[string]string
noSmithyDocumentSerde
}
// CDN Authorization credentials
type Authorization struct {
// The Amazon Resource Name (ARN) for the secret in AWS Secrets Manager that is
// used for CDN authorization.
//
// This member is required.
CdnIdentifierSecret *string
// The Amazon Resource Name (ARN) for the IAM role that allows MediaPackage to
// communicate with AWS Secrets Manager.
//
// This member is required.
SecretsRoleArn *string
noSmithyDocumentSerde
}
// A CMAF encryption configuration.
type CmafEncryption struct {
// A configuration for accessing an external Secure Packager and Encoder Key
// Exchange (SPEKE) service that will provide encryption keys.
//
// This member is required.
SpekeKeyProvider *SpekeKeyProvider
// An optional 128-bit, 16-byte hex value represented by a 32-character string,
// used in conjunction with the key for encrypting blocks. If you don't specify a
// value, then MediaPackage creates the constant initialization vector (IV).
ConstantInitializationVector *string
noSmithyDocumentSerde
}
// A CMAF packaging configuration.
type CmafPackage struct {
// A list of HLS manifest configurations.
//
// This member is required.
HlsManifests []HlsManifest
// A CMAF encryption configuration.
Encryption *CmafEncryption
// When includeEncoderConfigurationInSegments is set to true, MediaPackage places
// your encoder's Sequence Parameter Set (SPS), Picture Parameter Set (PPS), and
// Video Parameter Set (VPS) metadata in every video segment instead of in the init
// fragment. This lets you use different SPS/PPS/VPS settings for your assets
// during content playback.
IncludeEncoderConfigurationInSegments bool
// Duration (in seconds) of each fragment. Actual fragments will be rounded to the
// nearest multiple of the source fragment duration.
SegmentDurationSeconds int32
noSmithyDocumentSerde
}
// A Dynamic Adaptive Streaming over HTTP (DASH) encryption configuration.
type DashEncryption struct {
// A configuration for accessing an external Secure Packager and Encoder Key
// Exchange (SPEKE) service that will provide encryption keys.
//
// This member is required.
SpekeKeyProvider *SpekeKeyProvider
noSmithyDocumentSerde
}
// A DASH manifest configuration.
type DashManifest struct {
// Determines the position of some tags in the Media Presentation Description
// (MPD). When set to FULL, elements like SegmentTemplate and ContentProtection are
// included in each Representation. When set to COMPACT, duplicate elements are
// combined and presented at the AdaptationSet level.
ManifestLayout ManifestLayout
// An optional string to include in the name of the manifest.
ManifestName *string
// Minimum duration (in seconds) that a player will buffer media before starting
// the presentation.
MinBufferTimeSeconds int32
// The Dynamic Adaptive Streaming over HTTP (DASH) profile type. When set to
// "HBBTV_1_5", HbbTV 1.5 compliant output is enabled.
Profile Profile
// The source of scte markers used. When set to SEGMENTS, the scte markers are
// sourced from the segments of the ingested content. When set to MANIFEST, the
// scte markers are sourced from the manifest of the ingested content.
ScteMarkersSource ScteMarkersSource
// A StreamSelection configuration.
StreamSelection *StreamSelection
noSmithyDocumentSerde
}
// A Dynamic Adaptive Streaming over HTTP (DASH) packaging configuration.
type DashPackage struct {
// A list of DASH manifest configurations.
//
// This member is required.
DashManifests []DashManifest
// A Dynamic Adaptive Streaming over HTTP (DASH) encryption configuration.
Encryption *DashEncryption
// When includeEncoderConfigurationInSegments is set to true, MediaPackage places
// your encoder's Sequence Parameter Set (SPS), Picture Parameter Set (PPS), and
// Video Parameter Set (VPS) metadata in every video segment instead of in the init
// fragment. This lets you use different SPS/PPS/VPS settings for your assets
// during content playback.
IncludeEncoderConfigurationInSegments bool
// When enabled, an I-Frame only stream will be included in the output.
IncludeIframeOnlyStream bool
// A list of triggers that controls when the outgoing Dynamic Adaptive Streaming
// over HTTP (DASH) Media Presentation Description (MPD) will be partitioned into
// multiple periods. If empty, the content will not be partitioned into more than
// one period. If the list contains "ADS", new periods will be created where the
// Asset contains SCTE-35 ad markers.
PeriodTriggers []PeriodTriggersElement
// Duration (in seconds) of each segment. Actual segments will be rounded to the
// nearest multiple of the source segment duration.
SegmentDurationSeconds int32
// Determines the type of SegmentTemplate included in the Media Presentation
// Description (MPD). When set to NUMBER_WITH_TIMELINE, a full timeline is
// presented in each SegmentTemplate, with $Number$ media URLs. When set to
// TIME_WITH_TIMELINE, a full timeline is presented in each SegmentTemplate, with
// $Time$ media URLs. When set to NUMBER_WITH_DURATION, only a duration is
// included in each SegmentTemplate, with $Number$ media URLs.
SegmentTemplateFormat SegmentTemplateFormat
noSmithyDocumentSerde
}
// Configure egress access logging.
type EgressAccessLogs struct {
// Customize the log group name.
LogGroupName *string
noSmithyDocumentSerde
}
// The endpoint URL used to access an Asset using one PackagingConfiguration.
type EgressEndpoint struct {
// The ID of the PackagingConfiguration being applied to the Asset.
PackagingConfigurationId *string
// The current processing status of the asset used for the packaging
// configuration. The status can be either QUEUED, PROCESSING, PLAYABLE, or FAILED.
// Status information won't be available for most assets ingested before
// 2021-09-30.
Status *string
// The URL of the parent manifest for the repackaged Asset.
Url *string
noSmithyDocumentSerde
}
// Use encryptionContractConfiguration to configure one or more content encryption
// keys for your endpoints that use SPEKE 2.0. The encryption contract defines
// which content keys are used to encrypt the audio and video tracks in your
// stream. To configure the encryption contract, specify which audio and video
// encryption presets to use. Note the following considerations when using
// encryptionContractConfiguration: encryptionContractConfiguration can be used for
// DASH endpoints that use SPEKE 2.0. SPEKE 2.0 relies on the CPIX 2.3
// specification. You must disable key rotation for this endpoint by setting
// keyRotationIntervalSeconds to 0.
type EncryptionContractConfiguration struct {
// A collection of audio encryption presets.
//
// This member is required.
PresetSpeke20Audio PresetSpeke20Audio
// A collection of video encryption presets.
//
// This member is required.
PresetSpeke20Video PresetSpeke20Video
noSmithyDocumentSerde
}
// An HTTP Live Streaming (HLS) encryption configuration.
type HlsEncryption struct {
// A configuration for accessing an external Secure Packager and Encoder Key
// Exchange (SPEKE) service that will provide encryption keys.
//
// This member is required.
SpekeKeyProvider *SpekeKeyProvider
// A constant initialization vector for encryption (optional). When not specified
// the initialization vector will be periodically rotated.
ConstantInitializationVector *string
// The encryption method to use.
EncryptionMethod EncryptionMethod
noSmithyDocumentSerde
}
// An HTTP Live Streaming (HLS) manifest configuration.
type HlsManifest struct {
// This setting controls how ad markers are included in the packaged
// OriginEndpoint. "NONE" will omit all SCTE-35 ad markers from the output.
// "PASSTHROUGH" causes the manifest to contain a copy of the SCTE-35 ad markers
// (comments) taken directly from the input HTTP Live Streaming (HLS) manifest.
// "SCTE35_ENHANCED" generates ad markers and blackout tags based on SCTE-35
// messages in the input source.
AdMarkers AdMarkers
// When enabled, an I-Frame only stream will be included in the output.
IncludeIframeOnlyStream bool
// An optional string to include in the name of the manifest.
ManifestName *string
// The interval (in seconds) between each EXT-X-PROGRAM-DATE-TIME tag inserted
// into manifests. Additionally, when an interval is specified ID3Timed Metadata
// messages will be generated every 5 seconds using the ingest time of the content.
// If the interval is not specified, or set to 0, then no EXT-X-PROGRAM-DATE-TIME
// tags will be inserted into manifests and no ID3Timed Metadata messages will be
// generated. Note that irrespective of this parameter, if any ID3 Timed Metadata
// is found in HTTP Live Streaming (HLS) input, it will be passed through to HLS
// output.
ProgramDateTimeIntervalSeconds int32
// When enabled, the EXT-X-KEY tag will be repeated in output manifests.
RepeatExtXKey bool
// A StreamSelection configuration.
StreamSelection *StreamSelection
noSmithyDocumentSerde
}
// An HTTP Live Streaming (HLS) packaging configuration.
type HlsPackage struct {
// A list of HLS manifest configurations.
//
// This member is required.
HlsManifests []HlsManifest
// An HTTP Live Streaming (HLS) encryption configuration.
Encryption *HlsEncryption
// When enabled, MediaPackage passes through digital video broadcasting (DVB)
// subtitles into the output.
IncludeDvbSubtitles bool
// Duration (in seconds) of each fragment. Actual fragments will be rounded to the
// nearest multiple of the source fragment duration.
SegmentDurationSeconds int32
// When enabled, audio streams will be placed in rendition groups in the output.
UseAudioRenditionGroup bool
noSmithyDocumentSerde
}
// A Microsoft Smooth Streaming (MSS) encryption configuration.
type MssEncryption struct {
// A configuration for accessing an external Secure Packager and Encoder Key
// Exchange (SPEKE) service that will provide encryption keys.
//
// This member is required.
SpekeKeyProvider *SpekeKeyProvider
noSmithyDocumentSerde
}
// A Microsoft Smooth Streaming (MSS) manifest configuration.
type MssManifest struct {
// An optional string to include in the name of the manifest.
ManifestName *string
// A StreamSelection configuration.
StreamSelection *StreamSelection
noSmithyDocumentSerde
}
// A Microsoft Smooth Streaming (MSS) PackagingConfiguration.
type MssPackage struct {
// A list of MSS manifest configurations.
//
// This member is required.
MssManifests []MssManifest
// A Microsoft Smooth Streaming (MSS) encryption configuration.
Encryption *MssEncryption
// The duration (in seconds) of each segment.
SegmentDurationSeconds int32
noSmithyDocumentSerde
}
// A MediaPackage VOD PackagingConfiguration resource.
type PackagingConfiguration struct {
// The ARN of the PackagingConfiguration.
Arn *string
// A CMAF packaging configuration.
CmafPackage *CmafPackage
// The time the PackagingConfiguration was created.
CreatedAt *string
// A Dynamic Adaptive Streaming over HTTP (DASH) packaging configuration.
DashPackage *DashPackage
// An HTTP Live Streaming (HLS) packaging configuration.
HlsPackage *HlsPackage
// The ID of the PackagingConfiguration.
Id *string
// A Microsoft Smooth Streaming (MSS) PackagingConfiguration.
MssPackage *MssPackage
// The ID of a PackagingGroup.
PackagingGroupId *string
// A collection of tags associated with a resource
Tags map[string]string
noSmithyDocumentSerde
}
// A MediaPackage VOD PackagingGroup resource.
type PackagingGroup struct {
// The approximate asset count of the PackagingGroup.
ApproximateAssetCount int32
// The ARN of the PackagingGroup.
Arn *string
// CDN Authorization credentials
Authorization *Authorization
// The time the PackagingGroup was created.
CreatedAt *string
// The fully qualified domain name for Assets in the PackagingGroup.
DomainName *string
// Configure egress access logging.
EgressAccessLogs *EgressAccessLogs
// The ID of the PackagingGroup.
Id *string
// A collection of tags associated with a resource
Tags map[string]string
noSmithyDocumentSerde
}
// A configuration for accessing an external Secure Packager and Encoder Key
// Exchange (SPEKE) service that will provide encryption keys.
type SpekeKeyProvider struct {
// An Amazon Resource Name (ARN) of an IAM role that AWS Elemental MediaPackage
// will assume when accessing the key provider service.
//
// This member is required.
RoleArn *string
// The system IDs to include in key requests.
//
// This member is required.
SystemIds []string
// The URL of the external key provider service.
//
// This member is required.
Url *string
// Use encryptionContractConfiguration to configure one or more content encryption
// keys for your endpoints that use SPEKE 2.0. The encryption contract defines
// which content keys are used to encrypt the audio and video tracks in your
// stream. To configure the encryption contract, specify which audio and video
// encryption presets to use. Note the following considerations when using
// encryptionContractConfiguration: encryptionContractConfiguration can be used for
// DASH endpoints that use SPEKE 2.0. SPEKE 2.0 relies on the CPIX 2.3
// specification. You must disable key rotation for this endpoint by setting
// keyRotationIntervalSeconds to 0.
EncryptionContractConfiguration *EncryptionContractConfiguration
noSmithyDocumentSerde
}
// A StreamSelection configuration.
type StreamSelection struct {
// The maximum video bitrate (bps) to include in output.
MaxVideoBitsPerSecond int32
// The minimum video bitrate (bps) to include in output.
MinVideoBitsPerSecond int32
// A directive that determines the order of streams in the output.
StreamOrder StreamOrder
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 470 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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 = "MediaStore"
const ServiceAPIVersion = "2017-09-01"
// Client provides the API client to make operations call for AWS Elemental
// MediaStore.
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, "mediastore", 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 mediastore
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 mediastore
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/mediastore/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a storage container to hold objects. A container is similar to a bucket
// in the Amazon S3 service.
func (c *Client) CreateContainer(ctx context.Context, params *CreateContainerInput, optFns ...func(*Options)) (*CreateContainerOutput, error) {
if params == nil {
params = &CreateContainerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateContainer", params, optFns, c.addOperationCreateContainerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateContainerOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateContainerInput struct {
// The name for the container. The name must be from 1 to 255 characters.
// Container names must be unique to your AWS account within a specific region. As
// an example, you could create a container named movies in every region, as long
// as you don’t have an existing container with that name.
//
// This member is required.
ContainerName *string
// An array of key:value pairs that you define. These values can be anything that
// you want. Typically, the tag key represents a category (such as "environment")
// and the tag value represents a specific value within that category (such as
// "test," "development," or "production"). You can add up to 50 tags to each
// container. For more information about tagging, including naming and usage
// conventions, see Tagging Resources in MediaStore (https://docs.aws.amazon.com/mediastore/latest/ug/tagging.html)
// .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateContainerOutput struct {
// ContainerARN: The Amazon Resource Name (ARN) of the newly created container.
// The ARN has the following format: arn:aws:::container/. For example:
// arn:aws:mediastore:us-west-2:111122223333:container/movies ContainerName: The
// container name as specified in the request. CreationTime: Unix time stamp.
// Status: The status of container creation or deletion. The status is one of the
// following: CREATING , ACTIVE , or DELETING . While the service is creating the
// container, the status is CREATING . When an endpoint is available, the status
// changes to ACTIVE . The return value does not include the container's endpoint.
// To make downstream requests, you must obtain this value by using
// DescribeContainer or ListContainers .
//
// This member is required.
Container *types.Container
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateContainerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateContainer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateContainer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateContainerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateContainer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateContainer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "CreateContainer",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified container. Before you make a DeleteContainer request,
// delete any objects in the container or in any folders in the container. You can
// delete only empty containers.
func (c *Client) DeleteContainer(ctx context.Context, params *DeleteContainerInput, optFns ...func(*Options)) (*DeleteContainerOutput, error) {
if params == nil {
params = &DeleteContainerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteContainer", params, optFns, c.addOperationDeleteContainerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteContainerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteContainerInput struct {
// The name of the container to delete.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type DeleteContainerOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteContainerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteContainer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteContainer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteContainerValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteContainer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteContainer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "DeleteContainer",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the access policy that is associated with the specified container.
func (c *Client) DeleteContainerPolicy(ctx context.Context, params *DeleteContainerPolicyInput, optFns ...func(*Options)) (*DeleteContainerPolicyOutput, error) {
if params == nil {
params = &DeleteContainerPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteContainerPolicy", params, optFns, c.addOperationDeleteContainerPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteContainerPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteContainerPolicyInput struct {
// The name of the container that holds the policy.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type DeleteContainerPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteContainerPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteContainerPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteContainerPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteContainerPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteContainerPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteContainerPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "DeleteContainerPolicy",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the cross-origin resource sharing (CORS) configuration information that
// is set for the container. To use this operation, you must have permission to
// perform the MediaStore:DeleteCorsPolicy action. The container owner has this
// permission by default and can grant this permission to others.
func (c *Client) DeleteCorsPolicy(ctx context.Context, params *DeleteCorsPolicyInput, optFns ...func(*Options)) (*DeleteCorsPolicyOutput, error) {
if params == nil {
params = &DeleteCorsPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteCorsPolicy", params, optFns, c.addOperationDeleteCorsPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteCorsPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteCorsPolicyInput struct {
// The name of the container to remove the policy from.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type DeleteCorsPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteCorsPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteCorsPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteCorsPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteCorsPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCorsPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteCorsPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "DeleteCorsPolicy",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes an object lifecycle policy from a container. It takes up to 20 minutes
// for the change to take effect.
func (c *Client) DeleteLifecyclePolicy(ctx context.Context, params *DeleteLifecyclePolicyInput, optFns ...func(*Options)) (*DeleteLifecyclePolicyOutput, error) {
if params == nil {
params = &DeleteLifecyclePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLifecyclePolicy", params, optFns, c.addOperationDeleteLifecyclePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLifecyclePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLifecyclePolicyInput struct {
// The name of the container that holds the object lifecycle policy.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type DeleteLifecyclePolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLifecyclePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteLifecyclePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteLifecyclePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteLifecyclePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLifecyclePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteLifecyclePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "DeleteLifecyclePolicy",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the metric policy that is associated with the specified container. If
// there is no metric policy associated with the container, MediaStore doesn't send
// metrics to CloudWatch.
func (c *Client) DeleteMetricPolicy(ctx context.Context, params *DeleteMetricPolicyInput, optFns ...func(*Options)) (*DeleteMetricPolicyOutput, error) {
if params == nil {
params = &DeleteMetricPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteMetricPolicy", params, optFns, c.addOperationDeleteMetricPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteMetricPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteMetricPolicyInput struct {
// The name of the container that is associated with the metric policy that you
// want to delete.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type DeleteMetricPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteMetricPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteMetricPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteMetricPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteMetricPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteMetricPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteMetricPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "DeleteMetricPolicy",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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/mediastore/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the properties of the requested container. This request is commonly
// used to retrieve the endpoint of a container. An endpoint is a value assigned by
// the service when a new container is created. A container's endpoint does not
// change after it has been assigned. The DescribeContainer request returns a
// single Container object based on ContainerName . To return all Container
// objects that are associated with a specified AWS account, use ListContainers .
func (c *Client) DescribeContainer(ctx context.Context, params *DescribeContainerInput, optFns ...func(*Options)) (*DescribeContainerOutput, error) {
if params == nil {
params = &DescribeContainerInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeContainer", params, optFns, c.addOperationDescribeContainerMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeContainerOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeContainerInput struct {
// The name of the container to query.
ContainerName *string
noSmithyDocumentSerde
}
type DescribeContainerOutput struct {
// The name of the queried container.
Container *types.Container
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeContainerMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeContainer{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeContainer{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opDescribeContainer(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeContainer(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "DescribeContainer",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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"
)
// Retrieves the access policy for the specified container. For information about
// the data that is included in an access policy, see the AWS Identity and Access
// Management User Guide (https://aws.amazon.com/documentation/iam/) .
func (c *Client) GetContainerPolicy(ctx context.Context, params *GetContainerPolicyInput, optFns ...func(*Options)) (*GetContainerPolicyOutput, error) {
if params == nil {
params = &GetContainerPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetContainerPolicy", params, optFns, c.addOperationGetContainerPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetContainerPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetContainerPolicyInput struct {
// The name of the container.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type GetContainerPolicyOutput struct {
// The contents of the access policy.
//
// This member is required.
Policy *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetContainerPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetContainerPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetContainerPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetContainerPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContainerPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetContainerPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "GetContainerPolicy",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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/mediastore/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the cross-origin resource sharing (CORS) configuration information that
// is set for the container. To use this operation, you must have permission to
// perform the MediaStore:GetCorsPolicy action. By default, the container owner
// has this permission and can grant it to others.
func (c *Client) GetCorsPolicy(ctx context.Context, params *GetCorsPolicyInput, optFns ...func(*Options)) (*GetCorsPolicyOutput, error) {
if params == nil {
params = &GetCorsPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetCorsPolicy", params, optFns, c.addOperationGetCorsPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetCorsPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetCorsPolicyInput struct {
// The name of the container that the policy is assigned to.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type GetCorsPolicyOutput struct {
// The CORS policy assigned to the container.
//
// This member is required.
CorsPolicy []types.CorsRule
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetCorsPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCorsPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCorsPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetCorsPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCorsPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetCorsPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "GetCorsPolicy",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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"
)
// Retrieves the object lifecycle policy that is assigned to a container.
func (c *Client) GetLifecyclePolicy(ctx context.Context, params *GetLifecyclePolicyInput, optFns ...func(*Options)) (*GetLifecyclePolicyOutput, error) {
if params == nil {
params = &GetLifecyclePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetLifecyclePolicy", params, optFns, c.addOperationGetLifecyclePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetLifecyclePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetLifecyclePolicyInput struct {
// The name of the container that the object lifecycle policy is assigned to.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type GetLifecyclePolicyOutput struct {
// The object lifecycle policy that is assigned to the container.
//
// This member is required.
LifecyclePolicy *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetLifecyclePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetLifecyclePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetLifecyclePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetLifecyclePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLifecyclePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetLifecyclePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "GetLifecyclePolicy",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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/mediastore/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the metric policy for the specified container.
func (c *Client) GetMetricPolicy(ctx context.Context, params *GetMetricPolicyInput, optFns ...func(*Options)) (*GetMetricPolicyOutput, error) {
if params == nil {
params = &GetMetricPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetMetricPolicy", params, optFns, c.addOperationGetMetricPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetMetricPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetMetricPolicyInput struct {
// The name of the container that is associated with the metric policy.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type GetMetricPolicyOutput struct {
// The metric policy that is associated with the specific container.
//
// This member is required.
MetricPolicy *types.MetricPolicy
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetMetricPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetMetricPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetMetricPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetMetricPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMetricPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetMetricPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "GetMetricPolicy",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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/mediastore/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the properties of all containers in AWS Elemental MediaStore. You can
// query to receive all the containers in one response. Or you can include the
// MaxResults parameter to receive a limited number of containers in each response.
// In this case, the response includes a token. To get the next set of containers,
// send the command again, this time with the NextToken parameter (with the
// returned token as its value). The next set of responses appears, with a token if
// there are still more containers to receive. See also DescribeContainer , which
// gets the properties of one container.
func (c *Client) ListContainers(ctx context.Context, params *ListContainersInput, optFns ...func(*Options)) (*ListContainersOutput, error) {
if params == nil {
params = &ListContainersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListContainers", params, optFns, c.addOperationListContainersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListContainersOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListContainersInput struct {
// Enter the maximum number of containers in the response. Use from 1 to 255
// characters.
MaxResults *int32
// Only if you used MaxResults in the first command, enter the token (which was
// included in the previous response) to obtain the next set of containers. This
// token is included in a response only if there actually are more containers to
// list.
NextToken *string
noSmithyDocumentSerde
}
type ListContainersOutput struct {
// The names of the containers.
//
// This member is required.
Containers []types.Container
// NextToken is the token to use in the next call to ListContainers . This token is
// returned only if you included the MaxResults tag in the original command, and
// only if there are still containers to return.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListContainersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListContainers{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListContainers{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListContainers(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListContainersAPIClient is a client that implements the ListContainers
// operation.
type ListContainersAPIClient interface {
ListContainers(context.Context, *ListContainersInput, ...func(*Options)) (*ListContainersOutput, error)
}
var _ ListContainersAPIClient = (*Client)(nil)
// ListContainersPaginatorOptions is the paginator options for ListContainers
type ListContainersPaginatorOptions struct {
// Enter the maximum number of containers in the response. Use from 1 to 255
// characters.
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
}
// ListContainersPaginator is a paginator for ListContainers
type ListContainersPaginator struct {
options ListContainersPaginatorOptions
client ListContainersAPIClient
params *ListContainersInput
nextToken *string
firstPage bool
}
// NewListContainersPaginator returns a new ListContainersPaginator
func NewListContainersPaginator(client ListContainersAPIClient, params *ListContainersInput, optFns ...func(*ListContainersPaginatorOptions)) *ListContainersPaginator {
if params == nil {
params = &ListContainersInput{}
}
options := ListContainersPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListContainersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListContainersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListContainers page.
func (p *ListContainersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContainersOutput, 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.ListContainers(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListContainers(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "ListContainers",
}
}
| 233 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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/mediastore/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of the tags assigned to the specified container.
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) for the container.
//
// This member is required.
Resource *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// An array of key:value pairs that are assigned to the container.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "ListTagsForResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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 an access policy for the specified container to restrict the users and
// clients that can access it. For information about the data that is included in
// an access policy, see the AWS Identity and Access Management User Guide (https://aws.amazon.com/documentation/iam/)
// . For this release of the REST API, you can create only one policy for a
// container. If you enter PutContainerPolicy twice, the second command modifies
// the existing policy.
func (c *Client) PutContainerPolicy(ctx context.Context, params *PutContainerPolicyInput, optFns ...func(*Options)) (*PutContainerPolicyOutput, error) {
if params == nil {
params = &PutContainerPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutContainerPolicy", params, optFns, c.addOperationPutContainerPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutContainerPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutContainerPolicyInput struct {
// The name of the container.
//
// This member is required.
ContainerName *string
// The contents of the policy, which includes the following:
// - One Version tag
// - One Statement tag that contains the standard tags for the policy.
//
// This member is required.
Policy *string
noSmithyDocumentSerde
}
type PutContainerPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutContainerPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutContainerPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutContainerPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutContainerPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutContainerPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutContainerPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "PutContainerPolicy",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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/mediastore/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets the cross-origin resource sharing (CORS) configuration on a container so
// that the container can service cross-origin requests. For example, you might
// want to enable a request whose origin is http://www.example.com to access your
// AWS Elemental MediaStore container at my.example.container.com by using the
// browser's XMLHttpRequest capability. To enable CORS on a container, you attach a
// CORS policy to the container. In the CORS policy, you configure rules that
// identify origins and the HTTP methods that can be executed on your container.
// The policy can contain up to 398,000 characters. You can add up to 100 rules to
// a CORS policy. If more than one rule applies, the service uses the first
// applicable rule listed. To learn more about CORS, see Cross-Origin Resource
// Sharing (CORS) in AWS Elemental MediaStore (https://docs.aws.amazon.com/mediastore/latest/ug/cors-policy.html)
// .
func (c *Client) PutCorsPolicy(ctx context.Context, params *PutCorsPolicyInput, optFns ...func(*Options)) (*PutCorsPolicyOutput, error) {
if params == nil {
params = &PutCorsPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutCorsPolicy", params, optFns, c.addOperationPutCorsPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutCorsPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutCorsPolicyInput struct {
// The name of the container that you want to assign the CORS policy to.
//
// This member is required.
ContainerName *string
// The CORS policy to apply to the container.
//
// This member is required.
CorsPolicy []types.CorsRule
noSmithyDocumentSerde
}
type PutCorsPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutCorsPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutCorsPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutCorsPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutCorsPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutCorsPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutCorsPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "PutCorsPolicy",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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"
)
// Writes an object lifecycle policy to a container. If the container already has
// an object lifecycle policy, the service replaces the existing policy with the
// new policy. It takes up to 20 minutes for the change to take effect. For
// information about how to construct an object lifecycle policy, see Components
// of an Object Lifecycle Policy (https://docs.aws.amazon.com/mediastore/latest/ug/policies-object-lifecycle-components.html)
// .
func (c *Client) PutLifecyclePolicy(ctx context.Context, params *PutLifecyclePolicyInput, optFns ...func(*Options)) (*PutLifecyclePolicyOutput, error) {
if params == nil {
params = &PutLifecyclePolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutLifecyclePolicy", params, optFns, c.addOperationPutLifecyclePolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutLifecyclePolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutLifecyclePolicyInput struct {
// The name of the container that you want to assign the object lifecycle policy
// to.
//
// This member is required.
ContainerName *string
// The object lifecycle policy to apply to the container.
//
// This member is required.
LifecyclePolicy *string
noSmithyDocumentSerde
}
type PutLifecyclePolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutLifecyclePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutLifecyclePolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutLifecyclePolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutLifecyclePolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutLifecyclePolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutLifecyclePolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "PutLifecyclePolicy",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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/mediastore/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The metric policy that you want to add to the container. A metric policy allows
// AWS Elemental MediaStore to send metrics to Amazon CloudWatch. It takes up to 20
// minutes for the new policy to take effect.
func (c *Client) PutMetricPolicy(ctx context.Context, params *PutMetricPolicyInput, optFns ...func(*Options)) (*PutMetricPolicyOutput, error) {
if params == nil {
params = &PutMetricPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutMetricPolicy", params, optFns, c.addOperationPutMetricPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutMetricPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutMetricPolicyInput struct {
// The name of the container that you want to add the metric policy to.
//
// This member is required.
ContainerName *string
// The metric policy that you want to associate with the container. In the policy,
// you must indicate whether you want MediaStore to send container-level metrics.
// You can also include up to five rules to define groups of objects that you want
// MediaStore to send object-level metrics for. If you include rules in the policy,
// construct each rule with both of the following:
// - An object group that defines which objects to include in the group. The
// definition can be a path or a file name, but it can't have more than 900
// characters. Valid characters are: a-z, A-Z, 0-9, _ (underscore), = (equal), :
// (colon), . (period), - (hyphen), ~ (tilde), / (forward slash), and * (asterisk).
// Wildcards (*) are acceptable.
// - An object group name that allows you to refer to the object group. The name
// can't have more than 30 characters. Valid characters are: a-z, A-Z, 0-9, and _
// (underscore).
//
// This member is required.
MetricPolicy *types.MetricPolicy
noSmithyDocumentSerde
}
type PutMetricPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutMetricPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutMetricPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutMetricPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutMetricPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutMetricPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutMetricPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "PutMetricPolicy",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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 access logging on the specified container. When you enable access
// logging on a container, MediaStore delivers access logs for objects stored in
// that container to Amazon CloudWatch Logs.
func (c *Client) StartAccessLogging(ctx context.Context, params *StartAccessLoggingInput, optFns ...func(*Options)) (*StartAccessLoggingOutput, error) {
if params == nil {
params = &StartAccessLoggingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartAccessLogging", params, optFns, c.addOperationStartAccessLoggingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartAccessLoggingOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartAccessLoggingInput struct {
// The name of the container that you want to start access logging on.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type StartAccessLoggingOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartAccessLoggingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartAccessLogging{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartAccessLogging{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartAccessLoggingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartAccessLogging(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStartAccessLogging(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "StartAccessLogging",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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 access logging on the specified container. When you stop access logging
// on a container, MediaStore stops sending access logs to Amazon CloudWatch Logs.
// These access logs are not saved and are not retrievable.
func (c *Client) StopAccessLogging(ctx context.Context, params *StopAccessLoggingInput, optFns ...func(*Options)) (*StopAccessLoggingOutput, error) {
if params == nil {
params = &StopAccessLoggingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopAccessLogging", params, optFns, c.addOperationStopAccessLoggingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopAccessLoggingOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopAccessLoggingInput struct {
// The name of the container that you want to stop access logging on.
//
// This member is required.
ContainerName *string
noSmithyDocumentSerde
}
type StopAccessLoggingOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopAccessLoggingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopAccessLogging{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopAccessLogging{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopAccessLoggingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopAccessLogging(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStopAccessLogging(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "StopAccessLogging",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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/mediastore/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds tags to the specified AWS Elemental MediaStore container. Tags are
// key:value pairs that you can associate with AWS resources. For example, the tag
// key might be "customer" and the tag value might be "companyA." You can specify
// one or more tags to add to each container. You can add up to 50 tags to each
// container. For more information about tagging, including naming and usage
// conventions, see Tagging Resources in MediaStore (https://docs.aws.amazon.com/mediastore/latest/ug/tagging.html)
// .
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) for the container.
//
// This member is required.
Resource *string
// An array of key:value pairs that you want to add to the container. You need to
// specify only the tags that you want to add or update. For example, suppose a
// container already has two tags (customer:CompanyA and priority:High). You want
// to change the priority tag and also add a third tag (type:Contract). For
// TagResource, you specify the following tags: priority:Medium, type:Contract. The
// result is that your container has three tags: customer:CompanyA,
// priority:Medium, and type:Contract.
//
// This member is required.
Tags []types.Tag
noSmithyDocumentSerde
}
type TagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpTagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "TagResource",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes tags from the specified container. You can specify one or more tags to
// remove.
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) for the container.
//
// This member is required.
Resource *string
// A comma-separated list of keys for tags that you want to remove from the
// container. For example, if your container has two tags (customer:CompanyA and
// priority:High) and you want to remove one of the tags (priority:High), you
// specify the key for the tag that you want to remove (priority).
//
// This member is required.
TagKeys []string
noSmithyDocumentSerde
}
type UntagResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUntagResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "UntagResource",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/mediastore/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strings"
)
type awsAwsjson11_deserializeOpCreateContainer struct {
}
func (*awsAwsjson11_deserializeOpCreateContainer) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpCreateContainer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorCreateContainer(response, &metadata)
}
output := &CreateContainerOutput{}
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_deserializeOpDocumentCreateContainerOutput(&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_deserializeOpErrorCreateContainer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteContainer struct {
}
func (*awsAwsjson11_deserializeOpDeleteContainer) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteContainer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteContainer(response, &metadata)
}
output := &DeleteContainerOutput{}
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_deserializeOpDocumentDeleteContainerOutput(&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_deserializeOpErrorDeleteContainer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteContainerPolicy struct {
}
func (*awsAwsjson11_deserializeOpDeleteContainerPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteContainerPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteContainerPolicy(response, &metadata)
}
output := &DeleteContainerPolicyOutput{}
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_deserializeOpDocumentDeleteContainerPolicyOutput(&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_deserializeOpErrorDeleteContainerPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("PolicyNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteCorsPolicy struct {
}
func (*awsAwsjson11_deserializeOpDeleteCorsPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteCorsPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteCorsPolicy(response, &metadata)
}
output := &DeleteCorsPolicyOutput{}
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_deserializeOpDocumentDeleteCorsPolicyOutput(&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_deserializeOpErrorDeleteCorsPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("CorsPolicyNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorCorsPolicyNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteLifecyclePolicy struct {
}
func (*awsAwsjson11_deserializeOpDeleteLifecyclePolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteLifecyclePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteLifecyclePolicy(response, &metadata)
}
output := &DeleteLifecyclePolicyOutput{}
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_deserializeOpDocumentDeleteLifecyclePolicyOutput(&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_deserializeOpErrorDeleteLifecyclePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("PolicyNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDeleteMetricPolicy struct {
}
func (*awsAwsjson11_deserializeOpDeleteMetricPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDeleteMetricPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteMetricPolicy(response, &metadata)
}
output := &DeleteMetricPolicyOutput{}
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_deserializeOpDocumentDeleteMetricPolicyOutput(&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_deserializeOpErrorDeleteMetricPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("PolicyNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpDescribeContainer struct {
}
func (*awsAwsjson11_deserializeOpDescribeContainer) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpDescribeContainer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeContainer(response, &metadata)
}
output := &DescribeContainerOutput{}
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_deserializeOpDocumentDescribeContainerOutput(&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_deserializeOpErrorDescribeContainer(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetContainerPolicy struct {
}
func (*awsAwsjson11_deserializeOpGetContainerPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetContainerPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetContainerPolicy(response, &metadata)
}
output := &GetContainerPolicyOutput{}
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_deserializeOpDocumentGetContainerPolicyOutput(&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_deserializeOpErrorGetContainerPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("PolicyNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetCorsPolicy struct {
}
func (*awsAwsjson11_deserializeOpGetCorsPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetCorsPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetCorsPolicy(response, &metadata)
}
output := &GetCorsPolicyOutput{}
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_deserializeOpDocumentGetCorsPolicyOutput(&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_deserializeOpErrorGetCorsPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("CorsPolicyNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorCorsPolicyNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetLifecyclePolicy struct {
}
func (*awsAwsjson11_deserializeOpGetLifecyclePolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetLifecyclePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetLifecyclePolicy(response, &metadata)
}
output := &GetLifecyclePolicyOutput{}
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_deserializeOpDocumentGetLifecyclePolicyOutput(&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_deserializeOpErrorGetLifecyclePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("PolicyNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpGetMetricPolicy struct {
}
func (*awsAwsjson11_deserializeOpGetMetricPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpGetMetricPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetMetricPolicy(response, &metadata)
}
output := &GetMetricPolicyOutput{}
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_deserializeOpDocumentGetMetricPolicyOutput(&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_deserializeOpErrorGetMetricPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("PolicyNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListContainers struct {
}
func (*awsAwsjson11_deserializeOpListContainers) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListContainers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListContainers(response, &metadata)
}
output := &ListContainersOutput{}
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_deserializeOpDocumentListContainersOutput(&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_deserializeOpErrorListContainers(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpListTagsForResource struct {
}
func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata)
}
output := &ListTagsForResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutContainerPolicy struct {
}
func (*awsAwsjson11_deserializeOpPutContainerPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutContainerPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutContainerPolicy(response, &metadata)
}
output := &PutContainerPolicyOutput{}
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_deserializeOpDocumentPutContainerPolicyOutput(&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_deserializeOpErrorPutContainerPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutCorsPolicy struct {
}
func (*awsAwsjson11_deserializeOpPutCorsPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutCorsPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutCorsPolicy(response, &metadata)
}
output := &PutCorsPolicyOutput{}
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_deserializeOpDocumentPutCorsPolicyOutput(&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_deserializeOpErrorPutCorsPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutLifecyclePolicy struct {
}
func (*awsAwsjson11_deserializeOpPutLifecyclePolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutLifecyclePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutLifecyclePolicy(response, &metadata)
}
output := &PutLifecyclePolicyOutput{}
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_deserializeOpDocumentPutLifecyclePolicyOutput(&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_deserializeOpErrorPutLifecyclePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpPutMetricPolicy struct {
}
func (*awsAwsjson11_deserializeOpPutMetricPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpPutMetricPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutMetricPolicy(response, &metadata)
}
output := &PutMetricPolicyOutput{}
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_deserializeOpDocumentPutMetricPolicyOutput(&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_deserializeOpErrorPutMetricPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStartAccessLogging struct {
}
func (*awsAwsjson11_deserializeOpStartAccessLogging) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStartAccessLogging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorStartAccessLogging(response, &metadata)
}
output := &StartAccessLoggingOutput{}
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_deserializeOpDocumentStartAccessLoggingOutput(&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_deserializeOpErrorStartAccessLogging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpStopAccessLogging struct {
}
func (*awsAwsjson11_deserializeOpStopAccessLogging) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpStopAccessLogging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorStopAccessLogging(response, &metadata)
}
output := &StopAccessLoggingOutput{}
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_deserializeOpDocumentStopAccessLoggingOutput(&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_deserializeOpErrorStopAccessLogging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpTagResource struct {
}
func (*awsAwsjson11_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsAwsjson11_deserializeOpUntagResource struct {
}
func (*awsAwsjson11_deserializeOpUntagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata)
}
output := &UntagResourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
return out, metadata, err
}
func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerInUseException", errorCode):
return awsAwsjson11_deserializeErrorContainerInUseException(response, errorBody)
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsAwsjson11_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsAwsjson11_deserializeErrorContainerInUseException(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.ContainerInUseException{}
err := awsAwsjson11_deserializeDocumentContainerInUseException(&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_deserializeErrorContainerNotFoundException(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.ContainerNotFoundException{}
err := awsAwsjson11_deserializeDocumentContainerNotFoundException(&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_deserializeErrorCorsPolicyNotFoundException(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.CorsPolicyNotFoundException{}
err := awsAwsjson11_deserializeDocumentCorsPolicyNotFoundException(&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_deserializeErrorInternalServerError(response *smithyhttp.Response, errorBody *bytes.Reader) error {
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
output := &types.InternalServerError{}
err := awsAwsjson11_deserializeDocumentInternalServerError(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsAwsjson11_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_deserializeErrorPolicyNotFoundException(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.PolicyNotFoundException{}
err := awsAwsjson11_deserializeDocumentPolicyNotFoundException(&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_deserializeDocumentAllowedHeaders(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 Header to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAllowedMethods(v *[]types.MethodName, 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.MethodName
if *v == nil {
cv = []types.MethodName{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MethodName
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MethodName to be of type string, got %T instead", value)
}
col = types.MethodName(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentAllowedOrigins(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 Origin to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentContainer(v **types.Container, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Container
if *v == nil {
sv = &types.Container{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AccessLoggingEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected ContainerAccessLoggingEnabled to be of type *bool, got %T instead", value)
}
sv.AccessLoggingEnabled = ptr.Bool(jtv)
}
case "ARN":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerARN to be of type string, got %T instead", value)
}
sv.ARN = 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 "Endpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Endpoint to be of type string, got %T instead", value)
}
sv.Endpoint = ptr.String(jtv)
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerName 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 ContainerStatus to be of type string, got %T instead", value)
}
sv.Status = types.ContainerStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentContainerInUseException(v **types.ContainerInUseException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ContainerInUseException
if *v == nil {
sv = &types.ContainerInUseException{}
} 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_deserializeDocumentContainerList(v *[]types.Container, 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.Container
if *v == nil {
cv = []types.Container{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Container
destAddr := &col
if err := awsAwsjson11_deserializeDocumentContainer(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentContainerNotFoundException(v **types.ContainerNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ContainerNotFoundException
if *v == nil {
sv = &types.ContainerNotFoundException{}
} 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_deserializeDocumentCorsPolicy(v *[]types.CorsRule, 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.CorsRule
if *v == nil {
cv = []types.CorsRule{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CorsRule
destAddr := &col
if err := awsAwsjson11_deserializeDocumentCorsRule(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentCorsPolicyNotFoundException(v **types.CorsPolicyNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CorsPolicyNotFoundException
if *v == nil {
sv = &types.CorsPolicyNotFoundException{}
} 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_deserializeDocumentCorsRule(v **types.CorsRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CorsRule
if *v == nil {
sv = &types.CorsRule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AllowedHeaders":
if err := awsAwsjson11_deserializeDocumentAllowedHeaders(&sv.AllowedHeaders, value); err != nil {
return err
}
case "AllowedMethods":
if err := awsAwsjson11_deserializeDocumentAllowedMethods(&sv.AllowedMethods, value); err != nil {
return err
}
case "AllowedOrigins":
if err := awsAwsjson11_deserializeDocumentAllowedOrigins(&sv.AllowedOrigins, value); err != nil {
return err
}
case "ExposeHeaders":
if err := awsAwsjson11_deserializeDocumentExposeHeaders(&sv.ExposeHeaders, value); err != nil {
return err
}
case "MaxAgeSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected MaxAgeSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxAgeSeconds = int32(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentExposeHeaders(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 Header to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentInternalServerError(v **types.InternalServerError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerError
if *v == nil {
sv = &types.InternalServerError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LimitExceededException
if *v == nil {
sv = &types.LimitExceededException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMetricPolicy(v **types.MetricPolicy, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MetricPolicy
if *v == nil {
sv = &types.MetricPolicy{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContainerLevelMetrics":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerLevelMetrics to be of type string, got %T instead", value)
}
sv.ContainerLevelMetrics = types.ContainerLevelMetrics(jtv)
}
case "MetricPolicyRules":
if err := awsAwsjson11_deserializeDocumentMetricPolicyRules(&sv.MetricPolicyRules, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMetricPolicyRule(v **types.MetricPolicyRule, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.MetricPolicyRule
if *v == nil {
sv = &types.MetricPolicyRule{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ObjectGroup":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ObjectGroup to be of type string, got %T instead", value)
}
sv.ObjectGroup = ptr.String(jtv)
}
case "ObjectGroupName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ObjectGroupName to be of type string, got %T instead", value)
}
sv.ObjectGroupName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentMetricPolicyRules(v *[]types.MetricPolicyRule, 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.MetricPolicyRule
if *v == nil {
cv = []types.MetricPolicyRule{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MetricPolicyRule
destAddr := &col
if err := awsAwsjson11_deserializeDocumentMetricPolicyRule(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeDocumentPolicyNotFoundException(v **types.PolicyNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.PolicyNotFoundException
if *v == nil {
sv = &types.PolicyNotFoundException{}
} 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_deserializeDocumentTag(v **types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "Value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsAwsjson11_deserializeOpDocumentCreateContainerOutput(v **CreateContainerOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateContainerOutput
if *v == nil {
sv = &CreateContainerOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Container":
if err := awsAwsjson11_deserializeDocumentContainer(&sv.Container, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteContainerOutput(v **DeleteContainerOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteContainerOutput
if *v == nil {
sv = &DeleteContainerOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteContainerPolicyOutput(v **DeleteContainerPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteContainerPolicyOutput
if *v == nil {
sv = &DeleteContainerPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteCorsPolicyOutput(v **DeleteCorsPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteCorsPolicyOutput
if *v == nil {
sv = &DeleteCorsPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteLifecyclePolicyOutput(v **DeleteLifecyclePolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteLifecyclePolicyOutput
if *v == nil {
sv = &DeleteLifecyclePolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDeleteMetricPolicyOutput(v **DeleteMetricPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteMetricPolicyOutput
if *v == nil {
sv = &DeleteMetricPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentDescribeContainerOutput(v **DescribeContainerOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DescribeContainerOutput
if *v == nil {
sv = &DescribeContainerOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Container":
if err := awsAwsjson11_deserializeDocumentContainer(&sv.Container, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetContainerPolicyOutput(v **GetContainerPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetContainerPolicyOutput
if *v == nil {
sv = &GetContainerPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Policy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContainerPolicy to be of type string, got %T instead", value)
}
sv.Policy = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetCorsPolicyOutput(v **GetCorsPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetCorsPolicyOutput
if *v == nil {
sv = &GetCorsPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CorsPolicy":
if err := awsAwsjson11_deserializeDocumentCorsPolicy(&sv.CorsPolicy, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetLifecyclePolicyOutput(v **GetLifecyclePolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetLifecyclePolicyOutput
if *v == nil {
sv = &GetLifecyclePolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LifecyclePolicy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LifecyclePolicy to be of type string, got %T instead", value)
}
sv.LifecyclePolicy = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentGetMetricPolicyOutput(v **GetMetricPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetMetricPolicyOutput
if *v == nil {
sv = &GetMetricPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MetricPolicy":
if err := awsAwsjson11_deserializeDocumentMetricPolicy(&sv.MetricPolicy, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListContainersOutput(v **ListContainersOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListContainersOutput
if *v == nil {
sv = &ListContainersOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Containers":
if err := awsAwsjson11_deserializeDocumentContainerList(&sv.Containers, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListTagsForResourceOutput
if *v == nil {
sv = &ListTagsForResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Tags":
if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutContainerPolicyOutput(v **PutContainerPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutContainerPolicyOutput
if *v == nil {
sv = &PutContainerPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutCorsPolicyOutput(v **PutCorsPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutCorsPolicyOutput
if *v == nil {
sv = &PutCorsPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutLifecyclePolicyOutput(v **PutLifecyclePolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutLifecyclePolicyOutput
if *v == nil {
sv = &PutLifecyclePolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentPutMetricPolicyOutput(v **PutMetricPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutMetricPolicyOutput
if *v == nil {
sv = &PutMetricPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStartAccessLoggingOutput(v **StartAccessLoggingOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StartAccessLoggingOutput
if *v == nil {
sv = &StartAccessLoggingOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentStopAccessLoggingOutput(v **StopAccessLoggingOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *StopAccessLoggingOutput
if *v == nil {
sv = &StopAccessLoggingOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TagResourceOutput
if *v == nil {
sv = &TagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UntagResourceOutput
if *v == nil {
sv = &UntagResourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 4,230 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package mediastore provides the API client, operations, and parameter types for
// AWS Elemental MediaStore.
//
// An AWS Elemental MediaStore container is a namespace that holds folders and
// objects. You use a container endpoint to create, read, and delete objects.
package mediastore
| 9 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
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/mediastore/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 = "mediastore"
}
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 mediastore
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.13.12"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/mediastore/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"
"path"
)
type awsAwsjson11_serializeOpCreateContainer struct {
}
func (*awsAwsjson11_serializeOpCreateContainer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpCreateContainer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateContainerInput)
_ = 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("MediaStore_20170901.CreateContainer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentCreateContainerInput(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_serializeOpDeleteContainer struct {
}
func (*awsAwsjson11_serializeOpDeleteContainer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteContainer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteContainerInput)
_ = 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("MediaStore_20170901.DeleteContainer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteContainerInput(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_serializeOpDeleteContainerPolicy struct {
}
func (*awsAwsjson11_serializeOpDeleteContainerPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteContainerPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteContainerPolicyInput)
_ = 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("MediaStore_20170901.DeleteContainerPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteContainerPolicyInput(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_serializeOpDeleteCorsPolicy struct {
}
func (*awsAwsjson11_serializeOpDeleteCorsPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteCorsPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteCorsPolicyInput)
_ = 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("MediaStore_20170901.DeleteCorsPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteCorsPolicyInput(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_serializeOpDeleteLifecyclePolicy struct {
}
func (*awsAwsjson11_serializeOpDeleteLifecyclePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteLifecyclePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteLifecyclePolicyInput)
_ = 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("MediaStore_20170901.DeleteLifecyclePolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteLifecyclePolicyInput(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_serializeOpDeleteMetricPolicy struct {
}
func (*awsAwsjson11_serializeOpDeleteMetricPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDeleteMetricPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteMetricPolicyInput)
_ = 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("MediaStore_20170901.DeleteMetricPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDeleteMetricPolicyInput(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_serializeOpDescribeContainer struct {
}
func (*awsAwsjson11_serializeOpDescribeContainer) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpDescribeContainer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeContainerInput)
_ = 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("MediaStore_20170901.DescribeContainer")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentDescribeContainerInput(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_serializeOpGetContainerPolicy struct {
}
func (*awsAwsjson11_serializeOpGetContainerPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetContainerPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetContainerPolicyInput)
_ = 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("MediaStore_20170901.GetContainerPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetContainerPolicyInput(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_serializeOpGetCorsPolicy struct {
}
func (*awsAwsjson11_serializeOpGetCorsPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetCorsPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetCorsPolicyInput)
_ = 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("MediaStore_20170901.GetCorsPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetCorsPolicyInput(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_serializeOpGetLifecyclePolicy struct {
}
func (*awsAwsjson11_serializeOpGetLifecyclePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetLifecyclePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetLifecyclePolicyInput)
_ = 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("MediaStore_20170901.GetLifecyclePolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetLifecyclePolicyInput(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_serializeOpGetMetricPolicy struct {
}
func (*awsAwsjson11_serializeOpGetMetricPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpGetMetricPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetMetricPolicyInput)
_ = 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("MediaStore_20170901.GetMetricPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentGetMetricPolicyInput(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_serializeOpListContainers struct {
}
func (*awsAwsjson11_serializeOpListContainers) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListContainers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListContainersInput)
_ = 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("MediaStore_20170901.ListContainers")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListContainersInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpListTagsForResource struct {
}
func (*awsAwsjson11_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("MediaStore_20170901.ListTagsForResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpPutContainerPolicy struct {
}
func (*awsAwsjson11_serializeOpPutContainerPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutContainerPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutContainerPolicyInput)
_ = 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("MediaStore_20170901.PutContainerPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutContainerPolicyInput(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_serializeOpPutCorsPolicy struct {
}
func (*awsAwsjson11_serializeOpPutCorsPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutCorsPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutCorsPolicyInput)
_ = 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("MediaStore_20170901.PutCorsPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutCorsPolicyInput(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_serializeOpPutLifecyclePolicy struct {
}
func (*awsAwsjson11_serializeOpPutLifecyclePolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutLifecyclePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutLifecyclePolicyInput)
_ = 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("MediaStore_20170901.PutLifecyclePolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutLifecyclePolicyInput(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_serializeOpPutMetricPolicy struct {
}
func (*awsAwsjson11_serializeOpPutMetricPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpPutMetricPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutMetricPolicyInput)
_ = 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("MediaStore_20170901.PutMetricPolicy")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentPutMetricPolicyInput(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_serializeOpStartAccessLogging struct {
}
func (*awsAwsjson11_serializeOpStartAccessLogging) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStartAccessLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StartAccessLoggingInput)
_ = 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("MediaStore_20170901.StartAccessLogging")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStartAccessLoggingInput(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_serializeOpStopAccessLogging struct {
}
func (*awsAwsjson11_serializeOpStopAccessLogging) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpStopAccessLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*StopAccessLoggingInput)
_ = 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("MediaStore_20170901.StopAccessLogging")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentStopAccessLoggingInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpTagResource struct {
}
func (*awsAwsjson11_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("MediaStore_20170901.TagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
type awsAwsjson11_serializeOpUntagResource struct {
}
func (*awsAwsjson11_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
operationPath := "/"
if len(request.Request.URL.Path) == 0 {
request.Request.URL.Path = operationPath
} else {
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
request.Request.URL.Path += "/"
}
}
request.Request.Method = "POST"
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1")
httpBindingEncoder.SetHeader("X-Amz-Target").String("MediaStore_20170901.UntagResource")
jsonEncoder := smithyjson.NewEncoder()
if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsAwsjson11_serializeDocumentAllowedHeaders(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_serializeDocumentAllowedMethods(v []types.MethodName, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsAwsjson11_serializeDocumentAllowedOrigins(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_serializeDocumentCorsPolicy(v []types.CorsRule, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentCorsRule(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentCorsRule(v *types.CorsRule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowedHeaders != nil {
ok := object.Key("AllowedHeaders")
if err := awsAwsjson11_serializeDocumentAllowedHeaders(v.AllowedHeaders, ok); err != nil {
return err
}
}
if v.AllowedMethods != nil {
ok := object.Key("AllowedMethods")
if err := awsAwsjson11_serializeDocumentAllowedMethods(v.AllowedMethods, ok); err != nil {
return err
}
}
if v.AllowedOrigins != nil {
ok := object.Key("AllowedOrigins")
if err := awsAwsjson11_serializeDocumentAllowedOrigins(v.AllowedOrigins, ok); err != nil {
return err
}
}
if v.ExposeHeaders != nil {
ok := object.Key("ExposeHeaders")
if err := awsAwsjson11_serializeDocumentExposeHeaders(v.ExposeHeaders, ok); err != nil {
return err
}
}
if v.MaxAgeSeconds != 0 {
ok := object.Key("MaxAgeSeconds")
ok.Integer(v.MaxAgeSeconds)
}
return nil
}
func awsAwsjson11_serializeDocumentExposeHeaders(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_serializeDocumentMetricPolicy(v *types.MetricPolicy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ContainerLevelMetrics) > 0 {
ok := object.Key("ContainerLevelMetrics")
ok.String(string(v.ContainerLevelMetrics))
}
if v.MetricPolicyRules != nil {
ok := object.Key("MetricPolicyRules")
if err := awsAwsjson11_serializeDocumentMetricPolicyRules(v.MetricPolicyRules, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentMetricPolicyRule(v *types.MetricPolicyRule, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ObjectGroup != nil {
ok := object.Key("ObjectGroup")
ok.String(*v.ObjectGroup)
}
if v.ObjectGroupName != nil {
ok := object.Key("ObjectGroupName")
ok.String(*v.ObjectGroupName)
}
return nil
}
func awsAwsjson11_serializeDocumentMetricPolicyRules(v []types.MetricPolicyRule, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsAwsjson11_serializeDocumentMetricPolicyRule(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("Key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsAwsjson11_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_serializeOpDocumentCreateContainerInput(v *CreateContainerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteContainerInput(v *DeleteContainerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteContainerPolicyInput(v *DeleteContainerPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteCorsPolicyInput(v *DeleteCorsPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteLifecyclePolicyInput(v *DeleteLifecyclePolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDeleteMetricPolicyInput(v *DeleteMetricPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentDescribeContainerInput(v *DescribeContainerInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetContainerPolicyInput(v *GetContainerPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetCorsPolicyInput(v *GetCorsPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetLifecyclePolicyInput(v *GetLifecyclePolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentGetMetricPolicyInput(v *GetMetricPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListContainersInput(v *ListContainersInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("MaxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
return nil
}
func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Resource != nil {
ok := object.Key("Resource")
ok.String(*v.Resource)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutContainerPolicyInput(v *PutContainerPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
if v.Policy != nil {
ok := object.Key("Policy")
ok.String(*v.Policy)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutCorsPolicyInput(v *PutCorsPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
if v.CorsPolicy != nil {
ok := object.Key("CorsPolicy")
if err := awsAwsjson11_serializeDocumentCorsPolicy(v.CorsPolicy, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutLifecyclePolicyInput(v *PutLifecyclePolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
if v.LifecyclePolicy != nil {
ok := object.Key("LifecyclePolicy")
ok.String(*v.LifecyclePolicy)
}
return nil
}
func awsAwsjson11_serializeOpDocumentPutMetricPolicyInput(v *PutMetricPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
if v.MetricPolicy != nil {
ok := object.Key("MetricPolicy")
if err := awsAwsjson11_serializeDocumentMetricPolicy(v.MetricPolicy, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentStartAccessLoggingInput(v *StartAccessLoggingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentStopAccessLoggingInput(v *StopAccessLoggingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContainerName != nil {
ok := object.Key("ContainerName")
ok.String(*v.ContainerName)
}
return nil
}
func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Resource != nil {
ok := object.Key("Resource")
ok.String(*v.Resource)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Resource != nil {
ok := object.Key("Resource")
ok.String(*v.Resource)
}
if v.TagKeys != nil {
ok := object.Key("TagKeys")
if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil {
return err
}
}
return nil
}
| 1,660 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastore
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/mediastore/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateContainer struct {
}
func (*validateOpCreateContainer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateContainer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateContainerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateContainerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteContainer struct {
}
func (*validateOpDeleteContainer) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteContainer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteContainerInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteContainerInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteContainerPolicy struct {
}
func (*validateOpDeleteContainerPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteContainerPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteContainerPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteContainerPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteCorsPolicy struct {
}
func (*validateOpDeleteCorsPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteCorsPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteCorsPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteCorsPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLifecyclePolicy struct {
}
func (*validateOpDeleteLifecyclePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLifecyclePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLifecyclePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLifecyclePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteMetricPolicy struct {
}
func (*validateOpDeleteMetricPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteMetricPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteMetricPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteMetricPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContainerPolicy struct {
}
func (*validateOpGetContainerPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContainerPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContainerPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContainerPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetCorsPolicy struct {
}
func (*validateOpGetCorsPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetCorsPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetCorsPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetCorsPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLifecyclePolicy struct {
}
func (*validateOpGetLifecyclePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLifecyclePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLifecyclePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLifecyclePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMetricPolicy struct {
}
func (*validateOpGetMetricPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMetricPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMetricPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMetricPolicyInput(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 validateOpPutContainerPolicy struct {
}
func (*validateOpPutContainerPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutContainerPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutContainerPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutContainerPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutCorsPolicy struct {
}
func (*validateOpPutCorsPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutCorsPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutCorsPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutCorsPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutLifecyclePolicy struct {
}
func (*validateOpPutLifecyclePolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutLifecyclePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutLifecyclePolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutLifecyclePolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutMetricPolicy struct {
}
func (*validateOpPutMetricPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutMetricPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutMetricPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutMetricPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartAccessLogging struct {
}
func (*validateOpStartAccessLogging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartAccessLogging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartAccessLoggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartAccessLoggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStopAccessLogging struct {
}
func (*validateOpStopAccessLogging) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStopAccessLogging) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StopAccessLoggingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStopAccessLoggingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpTagResource struct {
}
func (*validateOpTagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUntagResource struct {
}
func (*validateOpUntagResource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UntagResourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUntagResourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateContainerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateContainer{}, middleware.After)
}
func addOpDeleteContainerValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteContainer{}, middleware.After)
}
func addOpDeleteContainerPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteContainerPolicy{}, middleware.After)
}
func addOpDeleteCorsPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteCorsPolicy{}, middleware.After)
}
func addOpDeleteLifecyclePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLifecyclePolicy{}, middleware.After)
}
func addOpDeleteMetricPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteMetricPolicy{}, middleware.After)
}
func addOpGetContainerPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContainerPolicy{}, middleware.After)
}
func addOpGetCorsPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetCorsPolicy{}, middleware.After)
}
func addOpGetLifecyclePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLifecyclePolicy{}, middleware.After)
}
func addOpGetMetricPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMetricPolicy{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpPutContainerPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutContainerPolicy{}, middleware.After)
}
func addOpPutCorsPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutCorsPolicy{}, middleware.After)
}
func addOpPutLifecyclePolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutLifecyclePolicy{}, middleware.After)
}
func addOpPutMetricPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutMetricPolicy{}, middleware.After)
}
func addOpStartAccessLoggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartAccessLogging{}, middleware.After)
}
func addOpStopAccessLoggingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStopAccessLogging{}, 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 validateCorsPolicy(v []types.CorsRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CorsPolicy"}
for i := range v {
if err := validateCorsRule(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCorsRule(v *types.CorsRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CorsRule"}
if v.AllowedOrigins == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowedOrigins"))
}
if v.AllowedHeaders == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowedHeaders"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMetricPolicy(v *types.MetricPolicy) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MetricPolicy"}
if len(v.ContainerLevelMetrics) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ContainerLevelMetrics"))
}
if v.MetricPolicyRules != nil {
if err := validateMetricPolicyRules(v.MetricPolicyRules); err != nil {
invalidParams.AddNested("MetricPolicyRules", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMetricPolicyRule(v *types.MetricPolicyRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MetricPolicyRule"}
if v.ObjectGroup == nil {
invalidParams.Add(smithy.NewErrParamRequired("ObjectGroup"))
}
if v.ObjectGroupName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ObjectGroupName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMetricPolicyRules(v []types.MetricPolicyRule) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MetricPolicyRules"}
for i := range v {
if err := validateMetricPolicyRule(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if 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 validateOpCreateContainerInput(v *CreateContainerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateContainerInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
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 validateOpDeleteContainerInput(v *DeleteContainerInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteContainerInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteContainerPolicyInput(v *DeleteContainerPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteContainerPolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteCorsPolicyInput(v *DeleteCorsPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCorsPolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLifecyclePolicyInput(v *DeleteLifecyclePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLifecyclePolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteMetricPolicyInput(v *DeleteMetricPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteMetricPolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContainerPolicyInput(v *GetContainerPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContainerPolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetCorsPolicyInput(v *GetCorsPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetCorsPolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLifecyclePolicyInput(v *GetLifecyclePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLifecyclePolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMetricPolicyInput(v *GetMetricPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMetricPolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
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.Resource == nil {
invalidParams.Add(smithy.NewErrParamRequired("Resource"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutContainerPolicyInput(v *PutContainerPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutContainerPolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutCorsPolicyInput(v *PutCorsPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutCorsPolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if v.CorsPolicy == nil {
invalidParams.Add(smithy.NewErrParamRequired("CorsPolicy"))
} else if v.CorsPolicy != nil {
if err := validateCorsPolicy(v.CorsPolicy); err != nil {
invalidParams.AddNested("CorsPolicy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutLifecyclePolicyInput(v *PutLifecyclePolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutLifecyclePolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if v.LifecyclePolicy == nil {
invalidParams.Add(smithy.NewErrParamRequired("LifecyclePolicy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutMetricPolicyInput(v *PutMetricPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutMetricPolicyInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if v.MetricPolicy == nil {
invalidParams.Add(smithy.NewErrParamRequired("MetricPolicy"))
} else if v.MetricPolicy != nil {
if err := validateMetricPolicy(v.MetricPolicy); err != nil {
invalidParams.AddNested("MetricPolicy", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartAccessLoggingInput(v *StartAccessLoggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartAccessLoggingInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStopAccessLoggingInput(v *StopAccessLoggingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StopAccessLoggingInput"}
if v.ContainerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContainerName"))
}
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.Resource == nil {
invalidParams.Add(smithy.NewErrParamRequired("Resource"))
}
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.Resource == nil {
invalidParams.Add(smithy.NewErrParamRequired("Resource"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 910 |
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 MediaStore 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: "mediastore.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "mediastore-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "mediastore-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediastore.{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-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "mediastore.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "mediastore-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "mediastore-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediastore.{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: "mediastore-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediastore.{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: "mediastore-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediastore.{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: "mediastore-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediastore.{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: "mediastore-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediastore.{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: "mediastore.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "mediastore-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "mediastore-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "mediastore.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 326 |
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 ContainerLevelMetrics string
// Enum values for ContainerLevelMetrics
const (
ContainerLevelMetricsEnabled ContainerLevelMetrics = "ENABLED"
ContainerLevelMetricsDisabled ContainerLevelMetrics = "DISABLED"
)
// Values returns all known values for ContainerLevelMetrics. 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 (ContainerLevelMetrics) Values() []ContainerLevelMetrics {
return []ContainerLevelMetrics{
"ENABLED",
"DISABLED",
}
}
type ContainerStatus string
// Enum values for ContainerStatus
const (
ContainerStatusActive ContainerStatus = "ACTIVE"
ContainerStatusCreating ContainerStatus = "CREATING"
ContainerStatusDeleting ContainerStatus = "DELETING"
)
// Values returns all known values for ContainerStatus. 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 (ContainerStatus) Values() []ContainerStatus {
return []ContainerStatus{
"ACTIVE",
"CREATING",
"DELETING",
}
}
type MethodName string
// Enum values for MethodName
const (
MethodNamePut MethodName = "PUT"
MethodNameGet MethodName = "GET"
MethodNameDelete MethodName = "DELETE"
MethodNameHead MethodName = "HEAD"
)
// Values returns all known values for MethodName. 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 (MethodName) Values() []MethodName {
return []MethodName{
"PUT",
"GET",
"DELETE",
"HEAD",
}
}
| 64 |
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 container that you specified in the request already exists or is being
// updated.
type ContainerInUseException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ContainerInUseException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ContainerInUseException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ContainerInUseException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ContainerInUseException"
}
return *e.ErrorCodeOverride
}
func (e *ContainerInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The container that you specified in the request does not exist.
type ContainerNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ContainerNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ContainerNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ContainerNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ContainerNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ContainerNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The CORS policy that you specified in the request does not exist.
type CorsPolicyNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *CorsPolicyNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *CorsPolicyNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *CorsPolicyNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "CorsPolicyNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *CorsPolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The service is temporarily unavailable.
type InternalServerError struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerError) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerError) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerError) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerError"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// A service limit has been exceeded.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *LimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The policy that you specified in the request does not exist.
type PolicyNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *PolicyNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *PolicyNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *PolicyNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "PolicyNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *PolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 166 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// This section describes operations that you can perform on an AWS Elemental
// MediaStore container.
type Container struct {
// The Amazon Resource Name (ARN) of the container. The ARN has the following
// format: arn:aws:::container/ For example:
// arn:aws:mediastore:us-west-2:111122223333:container/movies
ARN *string
// The state of access logging on the container. This value is false by default,
// indicating that AWS Elemental MediaStore does not send access logs to Amazon
// CloudWatch Logs. When you enable access logging on the container, MediaStore
// changes this value to true , indicating that the service delivers access logs
// for objects stored in that container to CloudWatch Logs.
AccessLoggingEnabled *bool
// Unix timestamp.
CreationTime *time.Time
// The DNS endpoint of the container. Use the endpoint to identify the specific
// container when sending requests to the data plane. The service assigns this
// value when the container is created. Once the value has been assigned, it does
// not change.
Endpoint *string
// The name of the container.
Name *string
// The status of container creation or deletion. The status is one of the
// following: CREATING , ACTIVE , or DELETING . While the service is creating the
// container, the status is CREATING . When the endpoint is available, the status
// changes to ACTIVE .
Status ContainerStatus
noSmithyDocumentSerde
}
// A rule for a CORS policy. You can add up to 100 rules to a CORS policy. If more
// than one rule applies, the service uses the first applicable rule listed.
type CorsRule struct {
// Specifies which headers are allowed in a preflight OPTIONS request through the
// Access-Control-Request-Headers header. Each header name that is specified in
// Access-Control-Request-Headers must have a corresponding entry in the rule. Only
// the headers that were requested are sent back. This element can contain only one
// wildcard character (*).
//
// This member is required.
AllowedHeaders []string
// One or more response headers that you want users to be able to access from
// their applications (for example, from a JavaScript XMLHttpRequest object). Each
// CORS rule must have at least one AllowedOrigins element. The string value can
// include only one wildcard character (*), for example, http://*.example.com.
// Additionally, you can specify only one wildcard character to allow cross-origin
// access for all origins.
//
// This member is required.
AllowedOrigins []string
// Identifies an HTTP method that the origin that is specified in the rule is
// allowed to execute. Each CORS rule must contain at least one AllowedMethods and
// one AllowedOrigins element.
AllowedMethods []MethodName
// One or more headers in the response that you want users to be able to access
// from their applications (for example, from a JavaScript XMLHttpRequest object).
// This element is optional for each rule.
ExposeHeaders []string
// The time in seconds that your browser caches the preflight response for the
// specified resource. A CORS rule can have only one MaxAgeSeconds element.
MaxAgeSeconds int32
noSmithyDocumentSerde
}
// The metric policy that is associated with the container. A metric policy allows
// AWS Elemental MediaStore to send metrics to Amazon CloudWatch. In the policy,
// you must indicate whether you want MediaStore to send container-level metrics.
// You can also include rules to define groups of objects that you want MediaStore
// to send object-level metrics for. To view examples of how to construct a metric
// policy for your use case, see Example Metric Policies (https://docs.aws.amazon.com/mediastore/latest/ug/policies-metric-examples.html)
// .
type MetricPolicy struct {
// A setting to enable or disable metrics at the container level.
//
// This member is required.
ContainerLevelMetrics ContainerLevelMetrics
// A parameter that holds an array of rules that enable metrics at the object
// level. This parameter is optional, but if you choose to include it, you must
// also include at least one rule. By default, you can include up to five rules.
// You can also request a quota increase (https://console.aws.amazon.com/servicequotas/home?region=us-east-1#!/services/mediastore/quotas)
// to allow up to 300 rules per policy.
MetricPolicyRules []MetricPolicyRule
noSmithyDocumentSerde
}
// A setting that enables metrics at the object level. Each rule contains an
// object group and an object group name. If the policy includes the
// MetricPolicyRules parameter, you must include at least one rule. Each metric
// policy can include up to five rules by default. You can also request a quota
// increase (https://console.aws.amazon.com/servicequotas/home?region=us-east-1#!/services/mediastore/quotas)
// to allow up to 300 rules per policy.
type MetricPolicyRule struct {
// A path or file name that defines which objects to include in the group.
// Wildcards (*) are acceptable.
//
// This member is required.
ObjectGroup *string
// A name that allows you to refer to the object group.
//
// This member is required.
ObjectGroupName *string
noSmithyDocumentSerde
}
// A collection of tags associated with a container. Each tag consists of a
// key:value pair, which can be anything you define. Typically, the tag key
// represents a category (such as "environment") and the tag value represents a
// specific value within that category (such as "test," "development," or
// "production"). You can add up to 50 tags to each container. For more information
// about tagging, including naming and usage conventions, see Tagging Resources in
// MediaStore (https://docs.aws.amazon.com/mediastore/latest/ug/tagging.html) .
type Tag struct {
// Part of the key:value pair that defines a tag. You can use a tag key to
// describe a category of information, such as "customer." Tag keys are
// case-sensitive.
//
// This member is required.
Key *string
// Part of the key:value pair that defines a tag. You can use a tag value to
// describe a specific value within a category, such as "companyA" or "companyB."
// Tag values are case-sensitive.
Value *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 158 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastoredata
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 = "MediaStore Data"
const ServiceAPIVersion = "2017-09-01"
// Client provides the API client to make operations call for AWS Elemental
// MediaStore Data Plane.
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, "mediastoredata", 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 mediastoredata
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 mediastoredata
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes an object at the specified path.
func (c *Client) DeleteObject(ctx context.Context, params *DeleteObjectInput, optFns ...func(*Options)) (*DeleteObjectOutput, error) {
if params == nil {
params = &DeleteObjectInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteObject", params, optFns, c.addOperationDeleteObjectMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteObjectOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteObjectInput struct {
// The path (including the file name) where the object is stored in the container.
// Format: //
//
// This member is required.
Path *string
noSmithyDocumentSerde
}
type DeleteObjectOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteObjectMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteObject{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteObject{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteObjectValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteObject(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteObject(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "DeleteObject",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastoredata
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets the headers for an object at the specified path.
func (c *Client) DescribeObject(ctx context.Context, params *DescribeObjectInput, optFns ...func(*Options)) (*DescribeObjectOutput, error) {
if params == nil {
params = &DescribeObjectInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeObject", params, optFns, c.addOperationDescribeObjectMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeObjectOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeObjectInput struct {
// The path (including the file name) where the object is stored in the container.
// Format: //
//
// This member is required.
Path *string
noSmithyDocumentSerde
}
type DescribeObjectOutput struct {
// An optional CacheControl header that allows the caller to control the object's
// cache behavior. Headers can be passed in as specified in the HTTP at
// https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 (https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9)
// . Headers with a custom user-defined value are also accepted.
CacheControl *string
// The length of the object in bytes.
ContentLength *int64
// The content type of the object.
ContentType *string
// The ETag that represents a unique instance of the object.
ETag *string
// The date and time that the object was last modified.
LastModified *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeObjectMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeObject{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeObject{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeObjectValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeObject(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeObject(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "DescribeObject",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastoredata
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"
"io"
"time"
)
// Downloads the object at the specified path. If the object’s upload availability
// is set to streaming , AWS Elemental MediaStore downloads the object even if it’s
// still uploading the object.
func (c *Client) GetObject(ctx context.Context, params *GetObjectInput, optFns ...func(*Options)) (*GetObjectOutput, error) {
if params == nil {
params = &GetObjectInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetObject", params, optFns, c.addOperationGetObjectMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetObjectOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetObjectInput struct {
// The path (including the file name) where the object is stored in the container.
// Format: // For example, to upload the file mlaw.avi to the folder path
// premium\canada in the container movies , enter the path premium/canada/mlaw.avi
// . Do not include the container name in this path. If the path includes any
// folders that don't exist yet, the service creates them. For example, suppose you
// have an existing premium/usa subfolder. If you specify premium/canada , the
// service creates a canada subfolder in the premium folder. You then have two
// subfolders, usa and canada , in the premium folder. There is no correlation
// between the path to the source and the path (folders) in the container in AWS
// Elemental MediaStore. For more information about folders and how they exist in a
// container, see the AWS Elemental MediaStore User Guide (http://docs.aws.amazon.com/mediastore/latest/ug/)
// . The file name is the name that is assigned to the file that you upload. The
// file can have the same name inside and outside of AWS Elemental MediaStore, or
// it can have the same name. The file name can include or omit an extension.
//
// This member is required.
Path *string
// The range bytes of an object to retrieve. For more information about the Range
// header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35)
// . AWS Elemental MediaStore ignores this header for partially uploaded objects
// that have streaming upload availability.
Range *string
noSmithyDocumentSerde
}
type GetObjectOutput struct {
// The HTML status code of the request. Status codes ranging from 200 to 299
// indicate success. All other status codes indicate the type of error that
// occurred.
//
// This member is required.
StatusCode int32
// The bytes of the object.
Body io.ReadCloser
// An optional CacheControl header that allows the caller to control the object's
// cache behavior. Headers can be passed in as specified in the HTTP spec at
// https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 (https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9)
// . Headers with a custom user-defined value are also accepted.
CacheControl *string
// The length of the object in bytes.
ContentLength *int64
// The range of bytes to retrieve.
ContentRange *string
// The content type of the object.
ContentType *string
// The ETag that represents a unique instance of the object.
ETag *string
// The date and time that the object was last modified.
LastModified *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetObjectMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetObject{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetObject{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetObjectValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetObject(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetObject(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "GetObject",
}
}
| 172 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastoredata
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/mediastoredata/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides a list of metadata entries about folders and objects in the specified
// folder.
func (c *Client) ListItems(ctx context.Context, params *ListItemsInput, optFns ...func(*Options)) (*ListItemsOutput, error) {
if params == nil {
params = &ListItemsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListItems", params, optFns, c.addOperationListItemsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListItemsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListItemsInput struct {
// The maximum number of results to return per API request. For example, you
// submit a ListItems request with MaxResults set at 500. Although 2,000 items
// match your request, the service returns no more than the first 500 items. (The
// service also returns a NextToken value that you can use to fetch the next batch
// of results.) The service might return fewer results than the MaxResults value.
// If MaxResults is not included in the request, the service defaults to
// pagination with a maximum of 1,000 results per page.
MaxResults *int32
// The token that identifies which batch of results that you want to see. For
// example, you submit a ListItems request with MaxResults set at 500. The service
// returns the first batch of results (up to 500) and a NextToken value. To see
// the next batch of results, you can submit the ListItems request a second time
// and specify the NextToken value. Tokens expire after 15 minutes.
NextToken *string
// The path in the container from which to retrieve items. Format: //
Path *string
noSmithyDocumentSerde
}
type ListItemsOutput struct {
// The metadata entries for the folders and objects at the requested path.
Items []types.Item
// The token that can be used in a request to view the next set of results. For
// example, you submit a ListItems request that matches 2,000 items with MaxResults
// set at 500. The service returns the first batch of results (up to 500) and a
// NextToken value that can be used to fetch the next batch of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListItemsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListItems{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListItems{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListItems(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListItemsAPIClient is a client that implements the ListItems operation.
type ListItemsAPIClient interface {
ListItems(context.Context, *ListItemsInput, ...func(*Options)) (*ListItemsOutput, error)
}
var _ ListItemsAPIClient = (*Client)(nil)
// ListItemsPaginatorOptions is the paginator options for ListItems
type ListItemsPaginatorOptions struct {
// The maximum number of results to return per API request. For example, you
// submit a ListItems request with MaxResults set at 500. Although 2,000 items
// match your request, the service returns no more than the first 500 items. (The
// service also returns a NextToken value that you can use to fetch the next batch
// of results.) The service might return fewer results than the MaxResults value.
// If MaxResults is not included in the request, the service defaults to
// pagination with a maximum of 1,000 results per page.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListItemsPaginator is a paginator for ListItems
type ListItemsPaginator struct {
options ListItemsPaginatorOptions
client ListItemsAPIClient
params *ListItemsInput
nextToken *string
firstPage bool
}
// NewListItemsPaginator returns a new ListItemsPaginator
func NewListItemsPaginator(client ListItemsAPIClient, params *ListItemsInput, optFns ...func(*ListItemsPaginatorOptions)) *ListItemsPaginator {
if params == nil {
params = &ListItemsInput{}
}
options := ListItemsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListItemsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListItemsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListItems page.
func (p *ListItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListItemsOutput, 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.ListItems(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListItems(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediastore",
OperationName: "ListItems",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastoredata
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/mediastoredata/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_deserializeOpDeleteObject struct {
}
func (*awsRestjson1_deserializeOpDeleteObject) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDeleteObject(response, &metadata)
}
output := &DeleteObjectOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsRestjson1_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsRestjson1_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("ObjectNotFoundException", errorCode):
return awsRestjson1_deserializeErrorObjectNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDescribeObject struct {
}
func (*awsRestjson1_deserializeOpDescribeObject) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDescribeObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorDescribeObject(response, &metadata)
}
output := &DescribeObjectOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsDescribeObjectOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDescribeObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsRestjson1_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsRestjson1_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("ObjectNotFoundException", errorCode):
return awsRestjson1_deserializeErrorObjectNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsDescribeObjectOutput(v *DescribeObjectOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.CacheControl = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Content-Length"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseInt(headerValues[0], 0, 64)
if err != nil {
return err
}
v.ContentLength = ptr.Int64(vv)
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ETag = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
t, err := smithytime.ParseHTTPDate(headerValues[0])
if err != nil {
return err
}
v.LastModified = ptr.Time(t)
}
return nil
}
type awsRestjson1_deserializeOpGetObject struct {
}
func (*awsRestjson1_deserializeOpGetObject) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorGetObject(response, &metadata)
}
output := &GetObjectOutput{}
out.Result = output
err = awsRestjson1_deserializeOpHttpBindingsGetObjectOutput(output, response)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
}
err = awsRestjson1_deserializeOpDocumentGetObjectOutput(output, response.Body)
if err != nil {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsRestjson1_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsRestjson1_deserializeErrorInternalServerError(response, errorBody)
case strings.EqualFold("ObjectNotFoundException", errorCode):
return awsRestjson1_deserializeErrorObjectNotFoundException(response, errorBody)
case strings.EqualFold("RequestedRangeNotSatisfiableException", errorCode):
return awsRestjson1_deserializeErrorRequestedRangeNotSatisfiableException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.CacheControl = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Content-Length"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseInt(headerValues[0], 0, 64)
if err != nil {
return err
}
v.ContentLength = ptr.Int64(vv)
}
if headerValues := response.Header.Values("Content-Range"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentRange = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ContentType = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.ETag = ptr.String(headerValues[0])
}
if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
t, err := smithytime.ParseHTTPDate(headerValues[0])
if err != nil {
return err
}
v.LastModified = ptr.Time(t)
}
v.StatusCode = int32(response.StatusCode)
return nil
}
func awsRestjson1_deserializeOpDocumentGetObjectOutput(v *GetObjectOutput, body io.ReadCloser) error {
if v == nil {
return fmt.Errorf("unsupported deserialization of nil %T", v)
}
v.Body = body
return nil
}
type awsRestjson1_deserializeOpListItems struct {
}
func (*awsRestjson1_deserializeOpListItems) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorListItems(response, &metadata)
}
output := &ListItemsOutput{}
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_deserializeOpDocumentListItemsOutput(&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_deserializeOpErrorListItems(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsRestjson1_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsRestjson1_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListItemsOutput(v **ListItemsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListItemsOutput
if *v == nil {
sv = &ListItemsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Items":
if err := awsRestjson1_deserializeDocumentItemList(&sv.Items, value); err != nil {
return err
}
case "NextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutObject struct {
}
func (*awsRestjson1_deserializeOpPutObject) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
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_deserializeOpErrorPutObject(response, &metadata)
}
output := &PutObjectOutput{}
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_deserializeOpDocumentPutObjectOutput(&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_deserializeOpErrorPutObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("ContainerNotFoundException", errorCode):
return awsRestjson1_deserializeErrorContainerNotFoundException(response, errorBody)
case strings.EqualFold("InternalServerError", errorCode):
return awsRestjson1_deserializeErrorInternalServerError(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutObjectOutput(v **PutObjectOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutObjectOutput
if *v == nil {
sv = &PutObjectOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContentSHA256":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SHA256Hash to be of type string, got %T instead", value)
}
sv.ContentSHA256 = ptr.String(jtv)
}
case "ETag":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ETag to be of type string, got %T instead", value)
}
sv.ETag = ptr.String(jtv)
}
case "StorageClass":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected StorageClass to be of type string, got %T instead", value)
}
sv.StorageClass = types.StorageClass(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeErrorContainerNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ContainerNotFoundException{}
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_deserializeDocumentContainerNotFoundException(&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_deserializeErrorInternalServerError(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServerError{}
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_deserializeDocumentInternalServerError(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorObjectNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ObjectNotFoundException{}
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_deserializeDocumentObjectNotFoundException(&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_deserializeErrorRequestedRangeNotSatisfiableException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.RequestedRangeNotSatisfiableException{}
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_deserializeDocumentRequestedRangeNotSatisfiableException(&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_deserializeDocumentContainerNotFoundException(v **types.ContainerNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ContainerNotFoundException
if *v == nil {
sv = &types.ContainerNotFoundException{}
} 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 awsRestjson1_deserializeDocumentInternalServerError(v **types.InternalServerError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerError
if *v == nil {
sv = &types.InternalServerError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
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 awsRestjson1_deserializeDocumentItem(v **types.Item, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Item
if *v == nil {
sv = &types.Item{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContentLength":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected NonNegativeLong to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ContentLength = ptr.Int64(i64)
}
case "ContentType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContentType to be of type string, got %T instead", value)
}
sv.ContentType = ptr.String(jtv)
}
case "ETag":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ETag to be of type string, got %T instead", value)
}
sv.ETag = ptr.String(jtv)
}
case "LastModified":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastModified = 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 ItemName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ItemType to be of type string, got %T instead", value)
}
sv.Type = types.ItemType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentItemList(v *[]types.Item, 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.Item
if *v == nil {
cv = []types.Item{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Item
destAddr := &col
if err := awsRestjson1_deserializeDocumentItem(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentObjectNotFoundException(v **types.ObjectNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ObjectNotFoundException
if *v == nil {
sv = &types.ObjectNotFoundException{}
} 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 awsRestjson1_deserializeDocumentRequestedRangeNotSatisfiableException(v **types.RequestedRangeNotSatisfiableException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.RequestedRangeNotSatisfiableException
if *v == nil {
sv = &types.RequestedRangeNotSatisfiableException{}
} 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
}
| 1,169 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package mediastoredata provides the API client, operations, and parameter types
// for AWS Elemental MediaStore Data Plane.
//
// An AWS Elemental MediaStore asset is an object, similar to an object in the
// Amazon S3 service. Objects are the fundamental entities that are stored in AWS
// Elemental MediaStore.
package mediastoredata
| 10 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastoredata
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/mediastoredata/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 = "mediastore"
}
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 mediastoredata
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.13.12"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastoredata
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastoredata
import (
"context"
"fmt"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpDeleteObject struct {
}
func (*awsRestjson1_serializeOpDeleteObject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteObjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/{Path+}")
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_serializeOpHttpBindingsDeleteObjectInput(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_serializeOpHttpBindingsDeleteObjectInput(v *DeleteObjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Path == nil || len(*v.Path) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Path must not be empty")}
}
if v.Path != nil {
if err := encoder.SetURI("Path").String(*v.Path); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeObject struct {
}
func (*awsRestjson1_serializeOpDescribeObject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DescribeObjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/{Path+}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "HEAD"
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_serializeOpHttpBindingsDescribeObjectInput(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_serializeOpHttpBindingsDescribeObjectInput(v *DescribeObjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Path == nil || len(*v.Path) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Path must not be empty")}
}
if v.Path != nil {
if err := encoder.SetURI("Path").String(*v.Path); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetObject struct {
}
func (*awsRestjson1_serializeOpGetObject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetObjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/{Path+}")
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_serializeOpHttpBindingsGetObjectInput(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_serializeOpHttpBindingsGetObjectInput(v *GetObjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Path == nil || len(*v.Path) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Path must not be empty")}
}
if v.Path != nil {
if err := encoder.SetURI("Path").String(*v.Path); err != nil {
return err
}
}
if v.Range != nil && len(*v.Range) > 0 {
locationName := "Range"
encoder.SetHeader(locationName).String(*v.Range)
}
return nil
}
type awsRestjson1_serializeOpListItems struct {
}
func (*awsRestjson1_serializeOpListItems) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListItems) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListItemsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/")
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_serializeOpHttpBindingsListItemsInput(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_serializeOpHttpBindingsListItemsInput(v *ListItemsInput, 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.Path != nil {
encoder.SetQuery("Path").String(*v.Path)
}
return nil
}
type awsRestjson1_serializeOpPutObject struct {
}
func (*awsRestjson1_serializeOpPutObject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutObjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/{Path+}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsPutObjectInput(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_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CacheControl != nil && len(*v.CacheControl) > 0 {
locationName := "Cache-Control"
encoder.SetHeader(locationName).String(*v.CacheControl)
}
if v.ContentType != nil && len(*v.ContentType) > 0 {
locationName := "Content-Type"
encoder.SetHeader(locationName).String(*v.ContentType)
}
if v.Path == nil || len(*v.Path) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Path must not be empty")}
}
if v.Path != nil {
if err := encoder.SetURI("Path").String(*v.Path); err != nil {
return err
}
}
if len(v.StorageClass) > 0 {
locationName := "X-Amz-Storage-Class"
encoder.SetHeader(locationName).String(string(v.StorageClass))
}
if len(v.UploadAvailability) > 0 {
locationName := "X-Amz-Upload-Availability"
encoder.SetHeader(locationName).String(string(v.UploadAvailability))
}
return nil
}
| 343 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediastoredata
import (
"context"
"fmt"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpDeleteObject struct {
}
func (*validateOpDeleteObject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteObject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteObjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteObjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDescribeObject struct {
}
func (*validateOpDescribeObject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDescribeObject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DescribeObjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDescribeObjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetObject struct {
}
func (*validateOpGetObject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetObject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetObjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetObjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutObject struct {
}
func (*validateOpPutObject) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutObject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutObjectInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutObjectInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpDeleteObjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteObject{}, middleware.After)
}
func addOpDescribeObjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDescribeObject{}, middleware.After)
}
func addOpGetObjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetObject{}, middleware.After)
}
func addOpPutObjectValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutObject{}, middleware.After)
}
func validateOpDeleteObjectInput(v *DeleteObjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteObjectInput"}
if v.Path == nil {
invalidParams.Add(smithy.NewErrParamRequired("Path"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDescribeObjectInput(v *DescribeObjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DescribeObjectInput"}
if v.Path == nil {
invalidParams.Add(smithy.NewErrParamRequired("Path"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetObjectInput(v *GetObjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetObjectInput"}
if v.Path == nil {
invalidParams.Add(smithy.NewErrParamRequired("Path"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutObjectInput(v *PutObjectInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutObjectInput"}
if v.Body == nil {
invalidParams.Add(smithy.NewErrParamRequired("Body"))
}
if v.Path == nil {
invalidParams.Add(smithy.NewErrParamRequired("Path"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 170 |
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 MediaStore Data endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "data.mediastore.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "data.mediastore-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "data.mediastore-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "data.mediastore.{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-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "data.mediastore.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "data.mediastore-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "data.mediastore-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "data.mediastore.{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: "data.mediastore-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "data.mediastore.{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: "data.mediastore-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "data.mediastore.{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: "data.mediastore-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "data.mediastore.{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: "data.mediastore-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "data.mediastore.{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: "data.mediastore.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "data.mediastore-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "data.mediastore-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "data.mediastore.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 326 |
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 ItemType string
// Enum values for ItemType
const (
ItemTypeObject ItemType = "OBJECT"
ItemTypeFolder ItemType = "FOLDER"
)
// Values returns all known values for ItemType. 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 (ItemType) Values() []ItemType {
return []ItemType{
"OBJECT",
"FOLDER",
}
}
type StorageClass string
// Enum values for StorageClass
const (
StorageClassTemporal StorageClass = "TEMPORAL"
)
// Values returns all known values for StorageClass. 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 (StorageClass) Values() []StorageClass {
return []StorageClass{
"TEMPORAL",
}
}
type UploadAvailability string
// Enum values for UploadAvailability
const (
UploadAvailabilityStandard UploadAvailability = "STANDARD"
UploadAvailabilityStreaming UploadAvailability = "STREAMING"
)
// Values returns all known values for UploadAvailability. 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 (UploadAvailability) Values() []UploadAvailability {
return []UploadAvailability{
"STANDARD",
"STREAMING",
}
}
| 56 |
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 specified container was not found for the specified account.
type ContainerNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ContainerNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ContainerNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ContainerNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ContainerNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ContainerNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The service is temporarily unavailable.
type InternalServerError struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerError) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerError) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerError) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerError"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Could not perform an operation on an object that does not exist.
type ObjectNotFoundException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ObjectNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ObjectNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ObjectNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ObjectNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ObjectNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The requested content range is not valid.
type RequestedRangeNotSatisfiableException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *RequestedRangeNotSatisfiableException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *RequestedRangeNotSatisfiableException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *RequestedRangeNotSatisfiableException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "RequestedRangeNotSatisfiableException"
}
return *e.ErrorCodeOverride
}
func (e *RequestedRangeNotSatisfiableException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
| 115 |
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"
)
// A metadata entry for a folder or object.
type Item struct {
// The length of the item in bytes.
ContentLength *int64
// The content type of the item.
ContentType *string
// The ETag that represents a unique instance of the item.
ETag *string
// The date and time that the item was last modified.
LastModified *time.Time
// The name of the item.
Name *string
// The item type (folder or object).
Type ItemType
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 35 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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 = "MediaTailor"
const ServiceAPIVersion = "2018-04-23"
// Client provides the API client to make operations call for AWS MediaTailor.
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, "mediatailor", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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 mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Configures Amazon CloudWatch log settings for a channel.
func (c *Client) ConfigureLogsForChannel(ctx context.Context, params *ConfigureLogsForChannelInput, optFns ...func(*Options)) (*ConfigureLogsForChannelOutput, error) {
if params == nil {
params = &ConfigureLogsForChannelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ConfigureLogsForChannel", params, optFns, c.addOperationConfigureLogsForChannelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ConfigureLogsForChannelOutput)
out.ResultMetadata = metadata
return out, nil
}
type ConfigureLogsForChannelInput struct {
// The name of the channel.
//
// This member is required.
ChannelName *string
// The types of logs to collect.
//
// This member is required.
LogTypes []types.LogType
noSmithyDocumentSerde
}
type ConfigureLogsForChannelOutput struct {
// The name of the channel.
ChannelName *string
// The types of logs collected.
LogTypes []types.LogType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationConfigureLogsForChannelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpConfigureLogsForChannel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpConfigureLogsForChannel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpConfigureLogsForChannelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opConfigureLogsForChannel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opConfigureLogsForChannel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "ConfigureLogsForChannel",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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"
)
// Amazon CloudWatch log settings for a playback configuration.
func (c *Client) ConfigureLogsForPlaybackConfiguration(ctx context.Context, params *ConfigureLogsForPlaybackConfigurationInput, optFns ...func(*Options)) (*ConfigureLogsForPlaybackConfigurationOutput, error) {
if params == nil {
params = &ConfigureLogsForPlaybackConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ConfigureLogsForPlaybackConfiguration", params, optFns, c.addOperationConfigureLogsForPlaybackConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ConfigureLogsForPlaybackConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
// Configures Amazon CloudWatch log settings for a playback configuration.
type ConfigureLogsForPlaybackConfigurationInput struct {
// The percentage of session logs that MediaTailor sends to your Cloudwatch Logs
// account. For example, if your playback configuration has 1000 sessions and
// percentEnabled is set to 60 , MediaTailor sends logs for 600 of the sessions to
// CloudWatch Logs. MediaTailor decides at random which of the playback
// configuration sessions to send logs for. If you want to view logs for a specific
// session, you can use the debug log mode (https://docs.aws.amazon.com/mediatailor/latest/ug/debug-log-mode.html)
// . Valid values: 0 - 100
//
// This member is required.
PercentEnabled int32
// The name of the playback configuration.
//
// This member is required.
PlaybackConfigurationName *string
noSmithyDocumentSerde
}
type ConfigureLogsForPlaybackConfigurationOutput struct {
// The percentage of session logs that MediaTailor sends to your Cloudwatch Logs
// account.
//
// This member is required.
PercentEnabled int32
// The name of the playback configuration.
PlaybackConfigurationName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationConfigureLogsForPlaybackConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpConfigureLogsForPlaybackConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpConfigureLogsForPlaybackConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpConfigureLogsForPlaybackConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opConfigureLogsForPlaybackConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opConfigureLogsForPlaybackConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "ConfigureLogsForPlaybackConfiguration",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a channel. For information about MediaTailor channels, see Working with
// channels (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-channels.html)
// in the MediaTailor User Guide.
func (c *Client) CreateChannel(ctx context.Context, params *CreateChannelInput, optFns ...func(*Options)) (*CreateChannelOutput, error) {
if params == nil {
params = &CreateChannelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateChannel", params, optFns, c.addOperationCreateChannelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateChannelOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateChannelInput struct {
// The name of the channel.
//
// This member is required.
ChannelName *string
// The channel's output properties.
//
// This member is required.
Outputs []types.RequestOutputItem
// The type of playback mode to use for this channel. LINEAR - The programs in the
// schedule play once back-to-back in the schedule. LOOP - The programs in the
// schedule play back-to-back in an endless loop. When the last program in the
// schedule stops playing, playback loops back to the first program in the
// schedule.
//
// This member is required.
PlaybackMode types.PlaybackMode
// The slate used to fill gaps between programs in the schedule. You must
// configure filler slate if your channel uses the LINEAR PlaybackMode .
// MediaTailor doesn't support filler slate for channels using the LOOP PlaybackMode
// .
FillerSlate *types.SlateSource
// The tags to assign to the channel. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
// The tier of the channel.
Tier types.Tier
noSmithyDocumentSerde
}
type CreateChannelOutput struct {
// The Amazon Resource Name (ARN) to assign to the channel.
Arn *string
// The name to assign to the channel.
ChannelName *string
// Indicates whether the channel is in a running state or not.
ChannelState types.ChannelState
// The timestamp of when the channel was created.
CreationTime *time.Time
// Contains information about the slate used to fill gaps between programs in the
// schedule.
FillerSlate *types.SlateSource
// The timestamp of when the channel was last modified.
LastModifiedTime *time.Time
// The output properties to assign to the channel.
Outputs []types.ResponseOutputItem
// The playback mode to assign to the channel.
PlaybackMode *string
// The tags to assign to the channel. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
// The tier of the channel.
Tier *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateChannelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateChannel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateChannel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateChannelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateChannel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateChannel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "CreateChannel",
}
}
| 188 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// The live source configuration.
func (c *Client) CreateLiveSource(ctx context.Context, params *CreateLiveSourceInput, optFns ...func(*Options)) (*CreateLiveSourceOutput, error) {
if params == nil {
params = &CreateLiveSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateLiveSource", params, optFns, c.addOperationCreateLiveSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateLiveSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateLiveSourceInput struct {
// A list of HTTP package configuration parameters for this live source.
//
// This member is required.
HttpPackageConfigurations []types.HttpPackageConfiguration
// The name of the live source.
//
// This member is required.
LiveSourceName *string
// The name of the source location.
//
// This member is required.
SourceLocationName *string
// The tags to assign to the live source. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
noSmithyDocumentSerde
}
type CreateLiveSourceOutput struct {
// The ARN to assign to the live source.
Arn *string
// The time the live source was created.
CreationTime *time.Time
// A list of HTTP package configuration parameters for this live source.
HttpPackageConfigurations []types.HttpPackageConfiguration
// The time the live source was last modified.
LastModifiedTime *time.Time
// The name to assign to the live source.
LiveSourceName *string
// The name to assign to the source location of the live source.
SourceLocationName *string
// The tags to assign to the live source. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateLiveSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateLiveSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateLiveSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateLiveSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLiveSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateLiveSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "CreateLiveSource",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a prefetch schedule for a playback configuration. A prefetch schedule
// allows you to tell MediaTailor to fetch and prepare certain ads before an ad
// break happens. For more information about ad prefetching, see Using ad
// prefetching (https://docs.aws.amazon.com/mediatailor/latest/ug/prefetching-ads.html)
// in the MediaTailor User Guide.
func (c *Client) CreatePrefetchSchedule(ctx context.Context, params *CreatePrefetchScheduleInput, optFns ...func(*Options)) (*CreatePrefetchScheduleOutput, error) {
if params == nil {
params = &CreatePrefetchScheduleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreatePrefetchSchedule", params, optFns, c.addOperationCreatePrefetchScheduleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreatePrefetchScheduleOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreatePrefetchScheduleInput struct {
// The configuration settings for MediaTailor's consumption of the prefetched ads
// from the ad decision server. Each consumption configuration contains an end time
// and an optional start time that define the consumption window. Prefetch
// schedules automatically expire no earlier than seven days after the end time.
//
// This member is required.
Consumption *types.PrefetchConsumption
// The name to assign to the schedule request.
//
// This member is required.
Name *string
// The name to assign to the playback configuration.
//
// This member is required.
PlaybackConfigurationName *string
// The configuration settings for retrieval of prefetched ads from the ad decision
// server. Only one set of prefetched ads will be retrieved and subsequently
// consumed for each ad break.
//
// This member is required.
Retrieval *types.PrefetchRetrieval
// An optional stream identifier that MediaTailor uses to prefetch ads for
// multiple streams that use the same playback configuration. If StreamId is
// specified, MediaTailor returns all of the prefetch schedules with an exact match
// on StreamId . If not specified, MediaTailor returns all of the prefetch
// schedules for the playback configuration, regardless of StreamId .
StreamId *string
noSmithyDocumentSerde
}
type CreatePrefetchScheduleOutput struct {
// The ARN to assign to the prefetch schedule.
Arn *string
// The configuration settings for MediaTailor's consumption of the prefetched ads
// from the ad decision server. Each consumption configuration contains an end time
// and an optional start time that define the consumption window. Prefetch
// schedules automatically expire no earlier than seven days after the end time.
Consumption *types.PrefetchConsumption
// The name to assign to the prefetch schedule.
Name *string
// The name to assign to the playback configuration.
PlaybackConfigurationName *string
// The configuration settings for retrieval of prefetched ads from the ad decision
// server. Only one set of prefetched ads will be retrieved and subsequently
// consumed for each ad break.
Retrieval *types.PrefetchRetrieval
// An optional stream identifier that MediaTailor uses to prefetch ads for
// multiple streams that use the same playback configuration. If StreamId is
// specified, MediaTailor returns all of the prefetch schedules with an exact match
// on StreamId . If not specified, MediaTailor returns all of the prefetch
// schedules for the playback configuration, regardless of StreamId .
StreamId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreatePrefetchScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePrefetchSchedule{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePrefetchSchedule{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreatePrefetchScheduleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePrefetchSchedule(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreatePrefetchSchedule(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "CreatePrefetchSchedule",
}
}
| 180 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a program within a channel. For information about programs, see Working
// with programs (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-programs.html)
// in the MediaTailor User Guide.
func (c *Client) CreateProgram(ctx context.Context, params *CreateProgramInput, optFns ...func(*Options)) (*CreateProgramOutput, error) {
if params == nil {
params = &CreateProgramInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateProgram", params, optFns, c.addOperationCreateProgramMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateProgramOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateProgramInput struct {
// The name of the channel for this Program.
//
// This member is required.
ChannelName *string
// The name of the Program.
//
// This member is required.
ProgramName *string
// The schedule configuration settings.
//
// This member is required.
ScheduleConfiguration *types.ScheduleConfiguration
// The name of the source location.
//
// This member is required.
SourceLocationName *string
// The ad break configuration settings.
AdBreaks []types.AdBreak
// The name of the LiveSource for this Program.
LiveSourceName *string
// The name that's used to refer to a VOD source.
VodSourceName *string
noSmithyDocumentSerde
}
type CreateProgramOutput struct {
// The ad break configuration settings.
AdBreaks []types.AdBreak
// The ARN to assign to the program.
Arn *string
// The name to assign to the channel for this program.
ChannelName *string
// The clip range configuration settings.
ClipRange *types.ClipRange
// The time the program was created.
CreationTime *time.Time
// The duration of the live program in milliseconds.
DurationMillis int64
// The name of the LiveSource for this Program.
LiveSourceName *string
// The name to assign to this program.
ProgramName *string
// The scheduled start time for this Program.
ScheduledStartTime *time.Time
// The name to assign to the source location for this program.
SourceLocationName *string
// The name that's used to refer to a VOD source.
VodSourceName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateProgramMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProgram{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProgram{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateProgramValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProgram(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateProgram(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "CreateProgram",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a source location. A source location is a container for sources. For
// more information about source locations, see Working with source locations (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-source-locations.html)
// in the MediaTailor User Guide.
func (c *Client) CreateSourceLocation(ctx context.Context, params *CreateSourceLocationInput, optFns ...func(*Options)) (*CreateSourceLocationOutput, error) {
if params == nil {
params = &CreateSourceLocationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSourceLocation", params, optFns, c.addOperationCreateSourceLocationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSourceLocationOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSourceLocationInput struct {
// The source's HTTP package configurations.
//
// This member is required.
HttpConfiguration *types.HttpConfiguration
// The name associated with the source location.
//
// This member is required.
SourceLocationName *string
// Access configuration parameters. Configures the type of authentication used to
// access content from your source location.
AccessConfiguration *types.AccessConfiguration
// The optional configuration for the server that serves segments.
DefaultSegmentDeliveryConfiguration *types.DefaultSegmentDeliveryConfiguration
// A list of the segment delivery configurations associated with this resource.
SegmentDeliveryConfigurations []types.SegmentDeliveryConfiguration
// The tags to assign to the source location. Tags are key-value pairs that you
// can associate with Amazon resources to help with organization, access control,
// and cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
noSmithyDocumentSerde
}
type CreateSourceLocationOutput struct {
// Access configuration parameters. Configures the type of authentication used to
// access content from your source location.
AccessConfiguration *types.AccessConfiguration
// The ARN to assign to the source location.
Arn *string
// The time the source location was created.
CreationTime *time.Time
// The optional configuration for the server that serves segments.
DefaultSegmentDeliveryConfiguration *types.DefaultSegmentDeliveryConfiguration
// The source's HTTP package configurations.
HttpConfiguration *types.HttpConfiguration
// The time the source location was last modified.
LastModifiedTime *time.Time
// The segment delivery configurations for the source location. For information
// about MediaTailor configurations, see Working with configurations in AWS
// Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor/latest/ug/configurations.html)
// .
SegmentDeliveryConfigurations []types.SegmentDeliveryConfiguration
// The name to assign to the source location.
SourceLocationName *string
// The tags to assign to the source location. Tags are key-value pairs that you
// can associate with Amazon resources to help with organization, access control,
// and cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSourceLocationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSourceLocation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSourceLocation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSourceLocationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSourceLocation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateSourceLocation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "CreateSourceLocation",
}
}
| 180 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// The VOD source configuration parameters.
func (c *Client) CreateVodSource(ctx context.Context, params *CreateVodSourceInput, optFns ...func(*Options)) (*CreateVodSourceOutput, error) {
if params == nil {
params = &CreateVodSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateVodSource", params, optFns, c.addOperationCreateVodSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateVodSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateVodSourceInput struct {
// A list of HTTP package configuration parameters for this VOD source.
//
// This member is required.
HttpPackageConfigurations []types.HttpPackageConfiguration
// The name of the source location for this VOD source.
//
// This member is required.
SourceLocationName *string
// The name associated with the VOD source.>
//
// This member is required.
VodSourceName *string
// The tags to assign to the VOD source. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
noSmithyDocumentSerde
}
type CreateVodSourceOutput struct {
// The ARN to assign to this VOD source.
Arn *string
// The time the VOD source was created.
CreationTime *time.Time
// A list of HTTP package configuration parameters for this VOD source.
HttpPackageConfigurations []types.HttpPackageConfiguration
// The time the VOD source was last modified.
LastModifiedTime *time.Time
// The name to assign to the source location for this VOD source.
SourceLocationName *string
// The tags to assign to the VOD source. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
// The name to assign to the VOD source.
VodSourceName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateVodSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateVodSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateVodSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateVodSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVodSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opCreateVodSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "CreateVodSource",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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 channel. For information about MediaTailor channels, see Working with
// channels (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-channels.html)
// in the MediaTailor User Guide.
func (c *Client) DeleteChannel(ctx context.Context, params *DeleteChannelInput, optFns ...func(*Options)) (*DeleteChannelOutput, error) {
if params == nil {
params = &DeleteChannelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteChannel", params, optFns, c.addOperationDeleteChannelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteChannelOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteChannelInput struct {
// The name of the channel.
//
// This member is required.
ChannelName *string
noSmithyDocumentSerde
}
type DeleteChannelOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteChannelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteChannel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteChannel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteChannelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteChannel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteChannel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DeleteChannel",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The channel policy to delete.
func (c *Client) DeleteChannelPolicy(ctx context.Context, params *DeleteChannelPolicyInput, optFns ...func(*Options)) (*DeleteChannelPolicyOutput, error) {
if params == nil {
params = &DeleteChannelPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteChannelPolicy", params, optFns, c.addOperationDeleteChannelPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteChannelPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteChannelPolicyInput struct {
// The name of the channel associated with this channel policy.
//
// This member is required.
ChannelName *string
noSmithyDocumentSerde
}
type DeleteChannelPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteChannelPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteChannelPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteChannelPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteChannelPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteChannelPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteChannelPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DeleteChannelPolicy",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The live source to delete.
func (c *Client) DeleteLiveSource(ctx context.Context, params *DeleteLiveSourceInput, optFns ...func(*Options)) (*DeleteLiveSourceOutput, error) {
if params == nil {
params = &DeleteLiveSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteLiveSource", params, optFns, c.addOperationDeleteLiveSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteLiveSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteLiveSourceInput struct {
// The name of the live source.
//
// This member is required.
LiveSourceName *string
// The name of the source location associated with this Live Source.
//
// This member is required.
SourceLocationName *string
noSmithyDocumentSerde
}
type DeleteLiveSourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteLiveSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteLiveSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteLiveSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteLiveSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteLiveSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteLiveSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DeleteLiveSource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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 playback configuration. For information about MediaTailor
// configurations, see Working with configurations in AWS Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor/latest/ug/configurations.html)
// .
func (c *Client) DeletePlaybackConfiguration(ctx context.Context, params *DeletePlaybackConfigurationInput, optFns ...func(*Options)) (*DeletePlaybackConfigurationOutput, error) {
if params == nil {
params = &DeletePlaybackConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeletePlaybackConfiguration", params, optFns, c.addOperationDeletePlaybackConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeletePlaybackConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeletePlaybackConfigurationInput struct {
// The name of the playback configuration.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type DeletePlaybackConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeletePlaybackConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePlaybackConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePlaybackConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeletePlaybackConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePlaybackConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeletePlaybackConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DeletePlaybackConfiguration",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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 prefetch schedule for a specific playback configuration. If you call
// DeletePrefetchSchedule on an expired prefetch schedule, MediaTailor returns an
// HTTP 404 status code. For more information about ad prefetching, see Using ad
// prefetching (https://docs.aws.amazon.com/mediatailor/latest/ug/prefetching-ads.html)
// in the MediaTailor User Guide.
func (c *Client) DeletePrefetchSchedule(ctx context.Context, params *DeletePrefetchScheduleInput, optFns ...func(*Options)) (*DeletePrefetchScheduleOutput, error) {
if params == nil {
params = &DeletePrefetchScheduleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeletePrefetchSchedule", params, optFns, c.addOperationDeletePrefetchScheduleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeletePrefetchScheduleOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeletePrefetchScheduleInput struct {
// The name of the prefetch schedule. If the action is successful, the service
// sends back an HTTP 204 response with an empty HTTP body.
//
// This member is required.
Name *string
// The name of the playback configuration for this prefetch schedule.
//
// This member is required.
PlaybackConfigurationName *string
noSmithyDocumentSerde
}
type DeletePrefetchScheduleOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeletePrefetchScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePrefetchSchedule{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePrefetchSchedule{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeletePrefetchScheduleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePrefetchSchedule(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeletePrefetchSchedule(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DeletePrefetchSchedule",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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 program within a channel. For information about programs, see Working
// with programs (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-programs.html)
// in the MediaTailor User Guide.
func (c *Client) DeleteProgram(ctx context.Context, params *DeleteProgramInput, optFns ...func(*Options)) (*DeleteProgramOutput, error) {
if params == nil {
params = &DeleteProgramInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteProgram", params, optFns, c.addOperationDeleteProgramMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteProgramOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteProgramInput struct {
// The name of the channel.
//
// This member is required.
ChannelName *string
// The name of the program.
//
// This member is required.
ProgramName *string
noSmithyDocumentSerde
}
type DeleteProgramOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteProgramMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProgram{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProgram{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteProgramValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProgram(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteProgram(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DeleteProgram",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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 source location. A source location is a container for sources. For
// more information about source locations, see Working with source locations (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-source-locations.html)
// in the MediaTailor User Guide.
func (c *Client) DeleteSourceLocation(ctx context.Context, params *DeleteSourceLocationInput, optFns ...func(*Options)) (*DeleteSourceLocationOutput, error) {
if params == nil {
params = &DeleteSourceLocationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSourceLocation", params, optFns, c.addOperationDeleteSourceLocationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSourceLocationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSourceLocationInput struct {
// The name of the source location.
//
// This member is required.
SourceLocationName *string
noSmithyDocumentSerde
}
type DeleteSourceLocationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSourceLocationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSourceLocation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSourceLocation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSourceLocationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSourceLocation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteSourceLocation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DeleteSourceLocation",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The video on demand (VOD) source to delete.
func (c *Client) DeleteVodSource(ctx context.Context, params *DeleteVodSourceInput, optFns ...func(*Options)) (*DeleteVodSourceOutput, error) {
if params == nil {
params = &DeleteVodSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteVodSource", params, optFns, c.addOperationDeleteVodSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteVodSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteVodSourceInput struct {
// The name of the source location associated with this VOD Source.
//
// This member is required.
SourceLocationName *string
// The name of the VOD source.
//
// This member is required.
VodSourceName *string
noSmithyDocumentSerde
}
type DeleteVodSourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteVodSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVodSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVodSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteVodSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVodSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDeleteVodSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DeleteVodSource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Describes a channel. For information about MediaTailor channels, see Working
// with channels (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-channels.html)
// in the MediaTailor User Guide.
func (c *Client) DescribeChannel(ctx context.Context, params *DescribeChannelInput, optFns ...func(*Options)) (*DescribeChannelOutput, error) {
if params == nil {
params = &DescribeChannelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeChannel", params, optFns, c.addOperationDescribeChannelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeChannelOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeChannelInput struct {
// The name of the channel.
//
// This member is required.
ChannelName *string
noSmithyDocumentSerde
}
type DescribeChannelOutput struct {
// The log configuration for the channel.
//
// This member is required.
LogConfiguration *types.LogConfigurationForChannel
// The ARN of the channel.
Arn *string
// The name of the channel.
ChannelName *string
// Indicates whether the channel is in a running state or not.
ChannelState types.ChannelState
// The timestamp of when the channel was created.
CreationTime *time.Time
// Contains information about the slate used to fill gaps between programs in the
// schedule.
FillerSlate *types.SlateSource
// The timestamp of when the channel was last modified.
LastModifiedTime *time.Time
// The channel's output properties.
Outputs []types.ResponseOutputItem
// The channel's playback mode.
PlaybackMode *string
// The tags assigned to the channel. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
// The channel's tier.
Tier *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeChannelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeChannel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeChannel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeChannelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeChannel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeChannel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DescribeChannel",
}
}
| 164 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// The live source to describe.
func (c *Client) DescribeLiveSource(ctx context.Context, params *DescribeLiveSourceInput, optFns ...func(*Options)) (*DescribeLiveSourceOutput, error) {
if params == nil {
params = &DescribeLiveSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeLiveSource", params, optFns, c.addOperationDescribeLiveSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeLiveSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeLiveSourceInput struct {
// The name of the live source.
//
// This member is required.
LiveSourceName *string
// The name of the source location associated with this Live Source.
//
// This member is required.
SourceLocationName *string
noSmithyDocumentSerde
}
type DescribeLiveSourceOutput struct {
// The ARN of the live source.
Arn *string
// The timestamp that indicates when the live source was created.
CreationTime *time.Time
// The HTTP package configurations.
HttpPackageConfigurations []types.HttpPackageConfiguration
// The timestamp that indicates when the live source was modified.
LastModifiedTime *time.Time
// The name of the live source.
LiveSourceName *string
// The name of the source location associated with the live source.
SourceLocationName *string
// The tags assigned to the live source. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeLiveSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeLiveSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeLiveSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeLiveSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeLiveSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeLiveSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DescribeLiveSource",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Describes a program within a channel. For information about programs, see
// Working with programs (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-programs.html)
// in the MediaTailor User Guide.
func (c *Client) DescribeProgram(ctx context.Context, params *DescribeProgramInput, optFns ...func(*Options)) (*DescribeProgramOutput, error) {
if params == nil {
params = &DescribeProgramInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeProgram", params, optFns, c.addOperationDescribeProgramMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeProgramOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeProgramInput struct {
// The name of the channel associated with this Program.
//
// This member is required.
ChannelName *string
// The name of the program.
//
// This member is required.
ProgramName *string
noSmithyDocumentSerde
}
type DescribeProgramOutput struct {
// The ad break configuration settings.
AdBreaks []types.AdBreak
// The ARN of the program.
Arn *string
// The name of the channel that the program belongs to.
ChannelName *string
// The clip range configuration settings.
ClipRange *types.ClipRange
// The timestamp of when the program was created.
CreationTime *time.Time
// The duration of the live program in milliseconds.
DurationMillis *int64
// The name of the LiveSource for this Program.
LiveSourceName *string
// The name of the program.
ProgramName *string
// The date and time that the program is scheduled to start in ISO 8601 format and
// Coordinated Universal Time (UTC). For example, the value
// 2021-03-27T17:48:16.751Z represents March 27, 2021 at 17:48:16.751 UTC.
ScheduledStartTime *time.Time
// The source location name.
SourceLocationName *string
// The name that's used to refer to a VOD source.
VodSourceName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeProgramMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeProgram{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeProgram{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeProgramValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeProgram(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeProgram(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DescribeProgram",
}
}
| 165 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Describes a source location. A source location is a container for sources. For
// more information about source locations, see Working with source locations (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-source-locations.html)
// in the MediaTailor User Guide.
func (c *Client) DescribeSourceLocation(ctx context.Context, params *DescribeSourceLocationInput, optFns ...func(*Options)) (*DescribeSourceLocationOutput, error) {
if params == nil {
params = &DescribeSourceLocationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeSourceLocation", params, optFns, c.addOperationDescribeSourceLocationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeSourceLocationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeSourceLocationInput struct {
// The name of the source location.
//
// This member is required.
SourceLocationName *string
noSmithyDocumentSerde
}
type DescribeSourceLocationOutput struct {
// The access configuration for the source location.
AccessConfiguration *types.AccessConfiguration
// The ARN of the source location.
Arn *string
// The timestamp that indicates when the source location was created.
CreationTime *time.Time
// The default segment delivery configuration settings.
DefaultSegmentDeliveryConfiguration *types.DefaultSegmentDeliveryConfiguration
// The HTTP package configuration settings for the source location.
HttpConfiguration *types.HttpConfiguration
// The timestamp that indicates when the source location was last modified.
LastModifiedTime *time.Time
// A list of the segment delivery configurations associated with this resource.
SegmentDeliveryConfigurations []types.SegmentDeliveryConfiguration
// The name of the source location.
SourceLocationName *string
// The tags assigned to the source location. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeSourceLocationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSourceLocation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSourceLocation{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeSourceLocationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSourceLocation(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeSourceLocation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DescribeSourceLocation",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides details about a specific video on demand (VOD) source in a specific
// source location.
func (c *Client) DescribeVodSource(ctx context.Context, params *DescribeVodSourceInput, optFns ...func(*Options)) (*DescribeVodSourceOutput, error) {
if params == nil {
params = &DescribeVodSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeVodSource", params, optFns, c.addOperationDescribeVodSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeVodSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeVodSourceInput struct {
// The name of the source location associated with this VOD Source.
//
// This member is required.
SourceLocationName *string
// The name of the VOD Source.
//
// This member is required.
VodSourceName *string
noSmithyDocumentSerde
}
type DescribeVodSourceOutput struct {
// The ARN of the VOD source.
Arn *string
// The timestamp that indicates when the VOD source was created.
CreationTime *time.Time
// The HTTP package configurations.
HttpPackageConfigurations []types.HttpPackageConfiguration
// The last modified time of the VOD source.
LastModifiedTime *time.Time
// The name of the source location associated with the VOD source.
SourceLocationName *string
// The tags assigned to the VOD source. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
Tags map[string]string
// The name of the VOD source.
VodSourceName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeVodSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeVodSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeVodSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDescribeVodSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVodSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opDescribeVodSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "DescribeVodSource",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the channel's IAM policy. IAM policies are used to control access to
// your channel.
func (c *Client) GetChannelPolicy(ctx context.Context, params *GetChannelPolicyInput, optFns ...func(*Options)) (*GetChannelPolicyOutput, error) {
if params == nil {
params = &GetChannelPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetChannelPolicy", params, optFns, c.addOperationGetChannelPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetChannelPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetChannelPolicyInput struct {
// The name of the channel associated with this Channel Policy.
//
// This member is required.
ChannelName *string
noSmithyDocumentSerde
}
type GetChannelPolicyOutput struct {
// The IAM policy for the channel. IAM policies are used to control access to your
// channel.
Policy *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetChannelPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetChannelPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetChannelPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetChannelPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetChannelPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetChannelPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "GetChannelPolicy",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves information about your channel's schedule.
func (c *Client) GetChannelSchedule(ctx context.Context, params *GetChannelScheduleInput, optFns ...func(*Options)) (*GetChannelScheduleOutput, error) {
if params == nil {
params = &GetChannelScheduleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetChannelSchedule", params, optFns, c.addOperationGetChannelScheduleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetChannelScheduleOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetChannelScheduleInput struct {
// The name of the channel associated with this Channel Schedule.
//
// This member is required.
ChannelName *string
// The duration in minutes of the channel schedule.
DurationMinutes *string
// The maximum number of channel schedules that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults channel
// schedules, use the value of NextToken in the response to get the next page of
// results.
MaxResults int32
// (Optional) If the playback configuration has more than MaxResults channel
// schedules, use NextToken to get the second and subsequent pages of results. For
// the first GetChannelScheduleRequest request, omit this value. For the second
// and subsequent requests, get the value of NextToken from the previous response
// and specify that value for NextToken in the request. If the previous response
// didn't include a NextToken element, there are no more channel schedules to get.
NextToken *string
noSmithyDocumentSerde
}
type GetChannelScheduleOutput struct {
// A list of schedule entries for the channel.
Items []types.ScheduleEntry
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetChannelScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetChannelSchedule{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetChannelSchedule{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetChannelScheduleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetChannelSchedule(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// GetChannelScheduleAPIClient is a client that implements the GetChannelSchedule
// operation.
type GetChannelScheduleAPIClient interface {
GetChannelSchedule(context.Context, *GetChannelScheduleInput, ...func(*Options)) (*GetChannelScheduleOutput, error)
}
var _ GetChannelScheduleAPIClient = (*Client)(nil)
// GetChannelSchedulePaginatorOptions is the paginator options for
// GetChannelSchedule
type GetChannelSchedulePaginatorOptions struct {
// The maximum number of channel schedules that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults channel
// schedules, use the value of NextToken in the response to get the next page of
// results.
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
}
// GetChannelSchedulePaginator is a paginator for GetChannelSchedule
type GetChannelSchedulePaginator struct {
options GetChannelSchedulePaginatorOptions
client GetChannelScheduleAPIClient
params *GetChannelScheduleInput
nextToken *string
firstPage bool
}
// NewGetChannelSchedulePaginator returns a new GetChannelSchedulePaginator
func NewGetChannelSchedulePaginator(client GetChannelScheduleAPIClient, params *GetChannelScheduleInput, optFns ...func(*GetChannelSchedulePaginatorOptions)) *GetChannelSchedulePaginator {
if params == nil {
params = &GetChannelScheduleInput{}
}
options := GetChannelSchedulePaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetChannelSchedulePaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetChannelSchedulePaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetChannelSchedule page.
func (p *GetChannelSchedulePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetChannelScheduleOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.GetChannelSchedule(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetChannelSchedule(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "GetChannelSchedule",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a playback configuration. For information about MediaTailor
// configurations, see Working with configurations in AWS Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor/latest/ug/configurations.html)
// .
func (c *Client) GetPlaybackConfiguration(ctx context.Context, params *GetPlaybackConfigurationInput, optFns ...func(*Options)) (*GetPlaybackConfigurationOutput, error) {
if params == nil {
params = &GetPlaybackConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetPlaybackConfiguration", params, optFns, c.addOperationGetPlaybackConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetPlaybackConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetPlaybackConfigurationInput struct {
// The identifier for the playback configuration.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type GetPlaybackConfigurationOutput struct {
// The URL for the ad decision server (ADS). This includes the specification of
// static parameters and placeholders for dynamic parameters. AWS Elemental
// MediaTailor substitutes player-specific and session-specific parameters as
// needed when calling the ADS. Alternately, for testing, you can provide a static
// VAST URL. The maximum length is 25,000 characters.
AdDecisionServerUrl *string
// The configuration for avail suppression, also known as ad suppression. For more
// information about ad suppression, see Ad Suppression (https://docs.aws.amazon.com/mediatailor/latest/ug/ad-behavior.html)
// .
AvailSuppression *types.AvailSuppression
// The configuration for bumpers. Bumpers are short audio or video clips that play
// at the start or before the end of an ad break. To learn more about bumpers, see
// Bumpers (https://docs.aws.amazon.com/mediatailor/latest/ug/bumpers.html) .
Bumper *types.Bumper
// The configuration for using a content delivery network (CDN), like Amazon
// CloudFront, for content and ad segment management.
CdnConfiguration *types.CdnConfiguration
// The player parameters and aliases used as dynamic variables during session
// initialization. For more information, see Domain Variables (https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domain.html)
// .
ConfigurationAliases map[string]map[string]string
// The configuration for DASH content.
DashConfiguration *types.DashConfiguration
// The configuration for HLS content.
HlsConfiguration *types.HlsConfiguration
// The configuration for pre-roll ad insertion.
LivePreRollConfiguration *types.LivePreRollConfiguration
// The Amazon CloudWatch log settings for a playback configuration.
LogConfiguration *types.LogConfiguration
// The configuration for manifest processing rules. Manifest processing rules
// enable customization of the personalized manifests created by MediaTailor.
ManifestProcessingRules *types.ManifestProcessingRules
// The identifier for the playback configuration.
Name *string
// Defines the maximum duration of underfilled ad time (in seconds) allowed in an
// ad break. If the duration of underfilled ad time exceeds the personalization
// threshold, then the personalization of the ad break is abandoned and the
// underlying content is shown. This feature applies to ad replacement in live and
// VOD streams, rather than ad insertion, because it relies on an underlying
// content stream. For more information about ad break behavior, including ad
// replacement and insertion, see Ad Behavior in AWS Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor/latest/ug/ad-behavior.html)
// .
PersonalizationThresholdSeconds int32
// The Amazon Resource Name (ARN) for the playback configuration.
PlaybackConfigurationArn *string
// The URL that the player accesses to get a manifest from AWS Elemental
// MediaTailor. This session will use server-side reporting.
PlaybackEndpointPrefix *string
// The URL that the player uses to initialize a session that uses client-side
// reporting.
SessionInitializationEndpointPrefix *string
// The URL for a high-quality video asset to transcode and use to fill in time
// that's not used by ads. AWS Elemental MediaTailor shows the slate to fill in
// gaps in media content. Configuring the slate is optional for non-VPAID playback
// configurations. For VPAID, the slate is required because MediaTailor provides it
// in the slots designated for dynamic ad content. The slate must be a high-quality
// asset that contains both audio and video.
SlateAdUrl *string
// The tags assigned to the playback configuration. Tags are key-value pairs that
// you can associate with Amazon resources to help with organization, access
// control, and cost tracking. For more information, see Tagging AWS Elemental
// MediaTailor Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html)
// .
Tags map[string]string
// The name that is used to associate this playback configuration with a custom
// transcode profile. This overrides the dynamic transcoding defaults of
// MediaTailor. Use this only if you have already set up custom profiles with the
// help of AWS Support.
TranscodeProfileName *string
// The URL prefix for the parent manifest for the stream, minus the asset ID. The
// maximum length is 512 characters.
VideoContentSourceUrl *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetPlaybackConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPlaybackConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPlaybackConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetPlaybackConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPlaybackConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetPlaybackConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "GetPlaybackConfiguration",
}
}
| 215 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a prefetch schedule for a playback configuration. A prefetch schedule
// allows you to tell MediaTailor to fetch and prepare certain ads before an ad
// break happens. For more information about ad prefetching, see Using ad
// prefetching (https://docs.aws.amazon.com/mediatailor/latest/ug/prefetching-ads.html)
// in the MediaTailor User Guide.
func (c *Client) GetPrefetchSchedule(ctx context.Context, params *GetPrefetchScheduleInput, optFns ...func(*Options)) (*GetPrefetchScheduleOutput, error) {
if params == nil {
params = &GetPrefetchScheduleInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetPrefetchSchedule", params, optFns, c.addOperationGetPrefetchScheduleMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetPrefetchScheduleOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetPrefetchScheduleInput struct {
// The name of the prefetch schedule. The name must be unique among all prefetch
// schedules that are associated with the specified playback configuration.
//
// This member is required.
Name *string
// Returns information about the prefetch schedule for a specific playback
// configuration. If you call GetPrefetchSchedule on an expired prefetch schedule,
// MediaTailor returns an HTTP 404 status code.
//
// This member is required.
PlaybackConfigurationName *string
noSmithyDocumentSerde
}
type GetPrefetchScheduleOutput struct {
// The Amazon Resource Name (ARN) of the prefetch schedule.
Arn *string
// Consumption settings determine how, and when, MediaTailor places the prefetched
// ads into ad breaks. Ad consumption occurs within a span of time that you define,
// called a consumption window. You can designate which ad breaks that MediaTailor
// fills with prefetch ads by setting avail matching criteria.
Consumption *types.PrefetchConsumption
// The name of the prefetch schedule. The name must be unique among all prefetch
// schedules that are associated with the specified playback configuration.
Name *string
// The name of the playback configuration to create the prefetch schedule for.
PlaybackConfigurationName *string
// A complex type that contains settings for prefetch retrieval from the ad
// decision server (ADS).
Retrieval *types.PrefetchRetrieval
// An optional stream identifier that you can specify in order to prefetch for
// multiple streams that use the same playback configuration.
StreamId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetPrefetchScheduleMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPrefetchSchedule{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPrefetchSchedule{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetPrefetchScheduleValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPrefetchSchedule(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opGetPrefetchSchedule(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "GetPrefetchSchedule",
}
}
| 158 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the alerts that are associated with a MediaTailor channel assembly
// resource.
func (c *Client) ListAlerts(ctx context.Context, params *ListAlertsInput, optFns ...func(*Options)) (*ListAlertsOutput, error) {
if params == nil {
params = &ListAlertsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListAlerts", params, optFns, c.addOperationListAlertsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListAlertsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListAlertsInput struct {
// The Amazon Resource Name (ARN) of the resource.
//
// This member is required.
ResourceArn *string
// The maximum number of alerts that you want MediaTailor to return in response to
// the current request. If there are more than MaxResults alerts, use the value of
// NextToken in the response to get the next page of results.
MaxResults int32
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListAlertsOutput struct {
// A list of alerts that are associated with this resource.
Items []types.Alert
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListAlertsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAlerts{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAlerts{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListAlertsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAlerts(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListAlertsAPIClient is a client that implements the ListAlerts operation.
type ListAlertsAPIClient interface {
ListAlerts(context.Context, *ListAlertsInput, ...func(*Options)) (*ListAlertsOutput, error)
}
var _ ListAlertsAPIClient = (*Client)(nil)
// ListAlertsPaginatorOptions is the paginator options for ListAlerts
type ListAlertsPaginatorOptions struct {
// The maximum number of alerts that you want MediaTailor to return in response to
// the current request. If there are more than MaxResults alerts, use the value of
// NextToken in the response to get the next page of results.
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
}
// ListAlertsPaginator is a paginator for ListAlerts
type ListAlertsPaginator struct {
options ListAlertsPaginatorOptions
client ListAlertsAPIClient
params *ListAlertsInput
nextToken *string
firstPage bool
}
// NewListAlertsPaginator returns a new ListAlertsPaginator
func NewListAlertsPaginator(client ListAlertsAPIClient, params *ListAlertsInput, optFns ...func(*ListAlertsPaginatorOptions)) *ListAlertsPaginator {
if params == nil {
params = &ListAlertsInput{}
}
options := ListAlertsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListAlertsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListAlertsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListAlerts page.
func (p *ListAlertsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAlertsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListAlerts(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListAlerts(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "ListAlerts",
}
}
| 227 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves information about the channels that are associated with the current
// AWS account.
func (c *Client) ListChannels(ctx context.Context, params *ListChannelsInput, optFns ...func(*Options)) (*ListChannelsOutput, error) {
if params == nil {
params = &ListChannelsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListChannels", params, optFns, c.addOperationListChannelsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListChannelsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListChannelsInput struct {
// The maximum number of channels that you want MediaTailor to return in response
// to the current request. If there are more than MaxResults channels, use the
// value of NextToken in the response to get the next page of results.
MaxResults int32
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListChannelsOutput struct {
// A list of channels that are associated with this account.
Items []types.Channel
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListChannelsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListChannels{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListChannels{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListChannels(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListChannelsAPIClient is a client that implements the ListChannels operation.
type ListChannelsAPIClient interface {
ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error)
}
var _ ListChannelsAPIClient = (*Client)(nil)
// ListChannelsPaginatorOptions is the paginator options for ListChannels
type ListChannelsPaginatorOptions struct {
// The maximum number of channels that you want MediaTailor to return in response
// to the current request. If there are more than MaxResults channels, use the
// value of NextToken in the response to get the next page of results.
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
}
// ListChannelsPaginator is a paginator for ListChannels
type ListChannelsPaginator struct {
options ListChannelsPaginatorOptions
client ListChannelsAPIClient
params *ListChannelsInput
nextToken *string
firstPage bool
}
// NewListChannelsPaginator returns a new ListChannelsPaginator
func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator {
if params == nil {
params = &ListChannelsInput{}
}
options := ListChannelsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListChannelsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListChannelsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListChannels page.
func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListChannels(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "ListChannels",
}
}
| 219 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the live sources contained in a source location. A source represents a
// piece of content.
func (c *Client) ListLiveSources(ctx context.Context, params *ListLiveSourcesInput, optFns ...func(*Options)) (*ListLiveSourcesOutput, error) {
if params == nil {
params = &ListLiveSourcesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLiveSources", params, optFns, c.addOperationListLiveSourcesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLiveSourcesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLiveSourcesInput struct {
// The name of the source location associated with this Live Sources list.
//
// This member is required.
SourceLocationName *string
// The maximum number of live sources that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults live
// sources, use the value of NextToken in the response to get the next page of
// results.
MaxResults int32
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListLiveSourcesOutput struct {
// Lists the live sources.
Items []types.LiveSource
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLiveSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListLiveSources{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLiveSources{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListLiveSourcesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLiveSources(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListLiveSourcesAPIClient is a client that implements the ListLiveSources
// operation.
type ListLiveSourcesAPIClient interface {
ListLiveSources(context.Context, *ListLiveSourcesInput, ...func(*Options)) (*ListLiveSourcesOutput, error)
}
var _ ListLiveSourcesAPIClient = (*Client)(nil)
// ListLiveSourcesPaginatorOptions is the paginator options for ListLiveSources
type ListLiveSourcesPaginatorOptions struct {
// The maximum number of live sources that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults live
// sources, use the value of NextToken in the response to get the next page of
// results.
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
}
// ListLiveSourcesPaginator is a paginator for ListLiveSources
type ListLiveSourcesPaginator struct {
options ListLiveSourcesPaginatorOptions
client ListLiveSourcesAPIClient
params *ListLiveSourcesInput
nextToken *string
firstPage bool
}
// NewListLiveSourcesPaginator returns a new ListLiveSourcesPaginator
func NewListLiveSourcesPaginator(client ListLiveSourcesAPIClient, params *ListLiveSourcesInput, optFns ...func(*ListLiveSourcesPaginatorOptions)) *ListLiveSourcesPaginator {
if params == nil {
params = &ListLiveSourcesInput{}
}
options := ListLiveSourcesPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListLiveSourcesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListLiveSourcesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListLiveSources page.
func (p *ListLiveSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLiveSourcesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListLiveSources(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListLiveSources(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "ListLiveSources",
}
}
| 230 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves existing playback configurations. For information about MediaTailor
// configurations, see Working with Configurations in AWS Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor/latest/ug/configurations.html)
// .
func (c *Client) ListPlaybackConfigurations(ctx context.Context, params *ListPlaybackConfigurationsInput, optFns ...func(*Options)) (*ListPlaybackConfigurationsOutput, error) {
if params == nil {
params = &ListPlaybackConfigurationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListPlaybackConfigurations", params, optFns, c.addOperationListPlaybackConfigurationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListPlaybackConfigurationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListPlaybackConfigurationsInput struct {
// The maximum number of playback configurations that you want MediaTailor to
// return in response to the current request. If there are more than MaxResults
// playback configurations, use the value of NextToken in the response to get the
// next page of results.
MaxResults int32
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListPlaybackConfigurationsOutput struct {
// Array of playback configurations. This might be all the available
// configurations or a subset, depending on the settings that you provide and the
// total number of configurations stored.
Items []types.PlaybackConfiguration
// Pagination token returned by the GET list request when results exceed the
// maximum allowed. Use the token to fetch the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListPlaybackConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListPlaybackConfigurations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPlaybackConfigurations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListPlaybackConfigurations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListPlaybackConfigurationsAPIClient is a client that implements the
// ListPlaybackConfigurations operation.
type ListPlaybackConfigurationsAPIClient interface {
ListPlaybackConfigurations(context.Context, *ListPlaybackConfigurationsInput, ...func(*Options)) (*ListPlaybackConfigurationsOutput, error)
}
var _ ListPlaybackConfigurationsAPIClient = (*Client)(nil)
// ListPlaybackConfigurationsPaginatorOptions is the paginator options for
// ListPlaybackConfigurations
type ListPlaybackConfigurationsPaginatorOptions struct {
// The maximum number of playback configurations that you want MediaTailor to
// return in response to the current request. If there are more than MaxResults
// playback configurations, use the value of NextToken in the response to get the
// next page of results.
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
}
// ListPlaybackConfigurationsPaginator is a paginator for
// ListPlaybackConfigurations
type ListPlaybackConfigurationsPaginator struct {
options ListPlaybackConfigurationsPaginatorOptions
client ListPlaybackConfigurationsAPIClient
params *ListPlaybackConfigurationsInput
nextToken *string
firstPage bool
}
// NewListPlaybackConfigurationsPaginator returns a new
// ListPlaybackConfigurationsPaginator
func NewListPlaybackConfigurationsPaginator(client ListPlaybackConfigurationsAPIClient, params *ListPlaybackConfigurationsInput, optFns ...func(*ListPlaybackConfigurationsPaginatorOptions)) *ListPlaybackConfigurationsPaginator {
if params == nil {
params = &ListPlaybackConfigurationsInput{}
}
options := ListPlaybackConfigurationsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListPlaybackConfigurationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListPlaybackConfigurationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListPlaybackConfigurations page.
func (p *ListPlaybackConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlaybackConfigurationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListPlaybackConfigurations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListPlaybackConfigurations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "ListPlaybackConfigurations",
}
}
| 228 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the prefetch schedules for a playback configuration.
func (c *Client) ListPrefetchSchedules(ctx context.Context, params *ListPrefetchSchedulesInput, optFns ...func(*Options)) (*ListPrefetchSchedulesOutput, error) {
if params == nil {
params = &ListPrefetchSchedulesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListPrefetchSchedules", params, optFns, c.addOperationListPrefetchSchedulesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListPrefetchSchedulesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListPrefetchSchedulesInput struct {
// Retrieves the prefetch schedule(s) for a specific playback configuration.
//
// This member is required.
PlaybackConfigurationName *string
// The maximum number of prefetch schedules that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults prefetch
// schedules, use the value of NextToken in the response to get the next page of
// results.
MaxResults int32
// (Optional) If the playback configuration has more than MaxResults prefetch
// schedules, use NextToken to get the second and subsequent pages of results. For
// the first ListPrefetchSchedulesRequest request, omit this value. For the second
// and subsequent requests, get the value of NextToken from the previous response
// and specify that value for NextToken in the request. If the previous response
// didn't include a NextToken element, there are no more prefetch schedules to get.
NextToken *string
// An optional filtering parameter whereby MediaTailor filters the prefetch
// schedules to include only specific streams.
StreamId *string
noSmithyDocumentSerde
}
type ListPrefetchSchedulesOutput struct {
// Lists the prefetch schedules. An empty Items list doesn't mean there aren't
// more items to fetch, just that that page was empty.
Items []types.PrefetchSchedule
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListPrefetchSchedulesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListPrefetchSchedules{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPrefetchSchedules{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListPrefetchSchedulesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPrefetchSchedules(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListPrefetchSchedulesAPIClient is a client that implements the
// ListPrefetchSchedules operation.
type ListPrefetchSchedulesAPIClient interface {
ListPrefetchSchedules(context.Context, *ListPrefetchSchedulesInput, ...func(*Options)) (*ListPrefetchSchedulesOutput, error)
}
var _ ListPrefetchSchedulesAPIClient = (*Client)(nil)
// ListPrefetchSchedulesPaginatorOptions is the paginator options for
// ListPrefetchSchedules
type ListPrefetchSchedulesPaginatorOptions struct {
// The maximum number of prefetch schedules that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults prefetch
// schedules, use the value of NextToken in the response to get the next page of
// results.
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
}
// ListPrefetchSchedulesPaginator is a paginator for ListPrefetchSchedules
type ListPrefetchSchedulesPaginator struct {
options ListPrefetchSchedulesPaginatorOptions
client ListPrefetchSchedulesAPIClient
params *ListPrefetchSchedulesInput
nextToken *string
firstPage bool
}
// NewListPrefetchSchedulesPaginator returns a new ListPrefetchSchedulesPaginator
func NewListPrefetchSchedulesPaginator(client ListPrefetchSchedulesAPIClient, params *ListPrefetchSchedulesInput, optFns ...func(*ListPrefetchSchedulesPaginatorOptions)) *ListPrefetchSchedulesPaginator {
if params == nil {
params = &ListPrefetchSchedulesInput{}
}
options := ListPrefetchSchedulesPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListPrefetchSchedulesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListPrefetchSchedulesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListPrefetchSchedules page.
func (p *ListPrefetchSchedulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrefetchSchedulesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListPrefetchSchedules(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListPrefetchSchedules(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "ListPrefetchSchedules",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the source locations for a channel. A source location defines the host
// server URL, and contains a list of sources.
func (c *Client) ListSourceLocations(ctx context.Context, params *ListSourceLocationsInput, optFns ...func(*Options)) (*ListSourceLocationsOutput, error) {
if params == nil {
params = &ListSourceLocationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSourceLocations", params, optFns, c.addOperationListSourceLocationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSourceLocationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSourceLocationsInput struct {
// The maximum number of source locations that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults source
// locations, use the value of NextToken in the response to get the next page of
// results.
MaxResults int32
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListSourceLocationsOutput struct {
// A list of source locations.
Items []types.SourceLocation
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSourceLocationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSourceLocations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSourceLocations{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); 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_opListSourceLocations(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSourceLocationsAPIClient is a client that implements the
// ListSourceLocations operation.
type ListSourceLocationsAPIClient interface {
ListSourceLocations(context.Context, *ListSourceLocationsInput, ...func(*Options)) (*ListSourceLocationsOutput, error)
}
var _ ListSourceLocationsAPIClient = (*Client)(nil)
// ListSourceLocationsPaginatorOptions is the paginator options for
// ListSourceLocations
type ListSourceLocationsPaginatorOptions struct {
// The maximum number of source locations that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults source
// locations, use the value of NextToken in the response to get the next page of
// results.
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
}
// ListSourceLocationsPaginator is a paginator for ListSourceLocations
type ListSourceLocationsPaginator struct {
options ListSourceLocationsPaginatorOptions
client ListSourceLocationsAPIClient
params *ListSourceLocationsInput
nextToken *string
firstPage bool
}
// NewListSourceLocationsPaginator returns a new ListSourceLocationsPaginator
func NewListSourceLocationsPaginator(client ListSourceLocationsAPIClient, params *ListSourceLocationsInput, optFns ...func(*ListSourceLocationsPaginatorOptions)) *ListSourceLocationsPaginator {
if params == nil {
params = &ListSourceLocationsInput{}
}
options := ListSourceLocationsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSourceLocationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSourceLocationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSourceLocations page.
func (p *ListSourceLocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSourceLocationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListSourceLocations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSourceLocations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "ListSourceLocations",
}
}
| 223 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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"
)
// A list of tags that are associated with this resource. Tags are key-value pairs
// that you can associate with Amazon resources to help with organization, access
// control, and cost tracking. For more information, see Tagging AWS Elemental
// MediaTailor Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html)
// .
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) associated with this resource.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The tags associated with this resource. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
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: "mediatailor",
OperationName: "ListTagsForResource",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the VOD sources contained in a source location. A source represents a
// piece of content.
func (c *Client) ListVodSources(ctx context.Context, params *ListVodSourcesInput, optFns ...func(*Options)) (*ListVodSourcesOutput, error) {
if params == nil {
params = &ListVodSourcesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListVodSources", params, optFns, c.addOperationListVodSourcesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListVodSourcesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListVodSourcesInput struct {
// The name of the source location associated with this VOD Source list.
//
// This member is required.
SourceLocationName *string
// The maximum number of VOD sources that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults VOD sources,
// use the value of NextToken in the response to get the next page of results.
MaxResults int32
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
noSmithyDocumentSerde
}
type ListVodSourcesOutput struct {
// Lists the VOD sources.
Items []types.VodSource
// Pagination token returned by the list request when results exceed the maximum
// allowed. Use the token to fetch the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListVodSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListVodSources{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVodSources{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListVodSourcesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVodSources(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListVodSourcesAPIClient is a client that implements the ListVodSources
// operation.
type ListVodSourcesAPIClient interface {
ListVodSources(context.Context, *ListVodSourcesInput, ...func(*Options)) (*ListVodSourcesOutput, error)
}
var _ ListVodSourcesAPIClient = (*Client)(nil)
// ListVodSourcesPaginatorOptions is the paginator options for ListVodSources
type ListVodSourcesPaginatorOptions struct {
// The maximum number of VOD sources that you want MediaTailor to return in
// response to the current request. If there are more than MaxResults VOD sources,
// use the value of NextToken in the response to get the next page of results.
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
}
// ListVodSourcesPaginator is a paginator for ListVodSources
type ListVodSourcesPaginator struct {
options ListVodSourcesPaginatorOptions
client ListVodSourcesAPIClient
params *ListVodSourcesInput
nextToken *string
firstPage bool
}
// NewListVodSourcesPaginator returns a new ListVodSourcesPaginator
func NewListVodSourcesPaginator(client ListVodSourcesAPIClient, params *ListVodSourcesInput, optFns ...func(*ListVodSourcesPaginatorOptions)) *ListVodSourcesPaginator {
if params == nil {
params = &ListVodSourcesInput{}
}
options := ListVodSourcesPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListVodSourcesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListVodSourcesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListVodSources page.
func (p *ListVodSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVodSourcesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListVodSources(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListVodSources(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "ListVodSources",
}
}
| 228 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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 an IAM policy for the channel. IAM policies are used to control access
// to your channel.
func (c *Client) PutChannelPolicy(ctx context.Context, params *PutChannelPolicyInput, optFns ...func(*Options)) (*PutChannelPolicyOutput, error) {
if params == nil {
params = &PutChannelPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutChannelPolicy", params, optFns, c.addOperationPutChannelPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutChannelPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutChannelPolicyInput struct {
// The channel name associated with this Channel Policy.
//
// This member is required.
ChannelName *string
// Adds an IAM role that determines the permissions of your channel.
//
// This member is required.
Policy *string
noSmithyDocumentSerde
}
type PutChannelPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutChannelPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutChannelPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutChannelPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutChannelPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutChannelPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutChannelPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "PutChannelPolicy",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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/mediatailor/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a playback configuration. For information about MediaTailor
// configurations, see Working with configurations in AWS Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor/latest/ug/configurations.html)
// .
func (c *Client) PutPlaybackConfiguration(ctx context.Context, params *PutPlaybackConfigurationInput, optFns ...func(*Options)) (*PutPlaybackConfigurationOutput, error) {
if params == nil {
params = &PutPlaybackConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutPlaybackConfiguration", params, optFns, c.addOperationPutPlaybackConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutPlaybackConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutPlaybackConfigurationInput struct {
// The identifier for the playback configuration.
//
// This member is required.
Name *string
// The URL for the ad decision server (ADS). This includes the specification of
// static parameters and placeholders for dynamic parameters. AWS Elemental
// MediaTailor substitutes player-specific and session-specific parameters as
// needed when calling the ADS. Alternately, for testing you can provide a static
// VAST URL. The maximum length is 25,000 characters.
AdDecisionServerUrl *string
// The configuration for avail suppression, also known as ad suppression. For more
// information about ad suppression, see Ad Suppression (https://docs.aws.amazon.com/mediatailor/latest/ug/ad-behavior.html)
// .
AvailSuppression *types.AvailSuppression
// The configuration for bumpers. Bumpers are short audio or video clips that play
// at the start or before the end of an ad break. To learn more about bumpers, see
// Bumpers (https://docs.aws.amazon.com/mediatailor/latest/ug/bumpers.html) .
Bumper *types.Bumper
// The configuration for using a content delivery network (CDN), like Amazon
// CloudFront, for content and ad segment management.
CdnConfiguration *types.CdnConfiguration
// The player parameters and aliases used as dynamic variables during session
// initialization. For more information, see Domain Variables (https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domain.html)
// .
ConfigurationAliases map[string]map[string]string
// The configuration for DASH content.
DashConfiguration *types.DashConfigurationForPut
// The configuration for pre-roll ad insertion.
LivePreRollConfiguration *types.LivePreRollConfiguration
// The configuration for manifest processing rules. Manifest processing rules
// enable customization of the personalized manifests created by MediaTailor.
ManifestProcessingRules *types.ManifestProcessingRules
// Defines the maximum duration of underfilled ad time (in seconds) allowed in an
// ad break. If the duration of underfilled ad time exceeds the personalization
// threshold, then the personalization of the ad break is abandoned and the
// underlying content is shown. This feature applies to ad replacement in live and
// VOD streams, rather than ad insertion, because it relies on an underlying
// content stream. For more information about ad break behavior, including ad
// replacement and insertion, see Ad Behavior in AWS Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor/latest/ug/ad-behavior.html)
// .
PersonalizationThresholdSeconds int32
// The URL for a high-quality video asset to transcode and use to fill in time
// that's not used by ads. AWS Elemental MediaTailor shows the slate to fill in
// gaps in media content. Configuring the slate is optional for non-VPAID
// configurations. For VPAID, the slate is required because MediaTailor provides it
// in the slots that are designated for dynamic ad content. The slate must be a
// high-quality asset that contains both audio and video.
SlateAdUrl *string
// The tags to assign to the playback configuration. Tags are key-value pairs that
// you can associate with Amazon resources to help with organization, access
// control, and cost tracking. For more information, see Tagging AWS Elemental
// MediaTailor Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html)
// .
Tags map[string]string
// The name that is used to associate this playback configuration with a custom
// transcode profile. This overrides the dynamic transcoding defaults of
// MediaTailor. Use this only if you have already set up custom profiles with the
// help of AWS Support.
TranscodeProfileName *string
// The URL prefix for the parent manifest for the stream, minus the asset ID. The
// maximum length is 512 characters.
VideoContentSourceUrl *string
noSmithyDocumentSerde
}
type PutPlaybackConfigurationOutput struct {
// The URL for the ad decision server (ADS). This includes the specification of
// static parameters and placeholders for dynamic parameters. AWS Elemental
// MediaTailor substitutes player-specific and session-specific parameters as
// needed when calling the ADS. Alternately, for testing you can provide a static
// VAST URL. The maximum length is 25,000 characters.
AdDecisionServerUrl *string
// The configuration for avail suppression, also known as ad suppression. For more
// information about ad suppression, see Ad Suppression (https://docs.aws.amazon.com/mediatailor/latest/ug/ad-behavior.html)
// .
AvailSuppression *types.AvailSuppression
// The configuration for bumpers. Bumpers are short audio or video clips that play
// at the start or before the end of an ad break. To learn more about bumpers, see
// Bumpers (https://docs.aws.amazon.com/mediatailor/latest/ug/bumpers.html) .
Bumper *types.Bumper
// The configuration for using a content delivery network (CDN), like Amazon
// CloudFront, for content and ad segment management.
CdnConfiguration *types.CdnConfiguration
// The player parameters and aliases used as dynamic variables during session
// initialization. For more information, see Domain Variables (https://docs.aws.amazon.com/mediatailor/latest/ug/variables-domain.html)
// .
ConfigurationAliases map[string]map[string]string
// The configuration for DASH content.
DashConfiguration *types.DashConfiguration
// The configuration for HLS content.
HlsConfiguration *types.HlsConfiguration
// The configuration for pre-roll ad insertion.
LivePreRollConfiguration *types.LivePreRollConfiguration
// The Amazon CloudWatch log settings for a playback configuration.
LogConfiguration *types.LogConfiguration
// The configuration for manifest processing rules. Manifest processing rules
// enable customization of the personalized manifests created by MediaTailor.
ManifestProcessingRules *types.ManifestProcessingRules
// The identifier for the playback configuration.
Name *string
// Defines the maximum duration of underfilled ad time (in seconds) allowed in an
// ad break. If the duration of underfilled ad time exceeds the personalization
// threshold, then the personalization of the ad break is abandoned and the
// underlying content is shown. This feature applies to ad replacement in live and
// VOD streams, rather than ad insertion, because it relies on an underlying
// content stream. For more information about ad break behavior, including ad
// replacement and insertion, see Ad Behavior in AWS Elemental MediaTailor (https://docs.aws.amazon.com/mediatailor/latest/ug/ad-behavior.html)
// .
PersonalizationThresholdSeconds int32
// The Amazon Resource Name (ARN) associated with the playback configuration.
PlaybackConfigurationArn *string
// The playback endpoint prefix associated with the playback configuration.
PlaybackEndpointPrefix *string
// The session initialization endpoint prefix associated with the playback
// configuration.
SessionInitializationEndpointPrefix *string
// The URL for a high-quality video asset to transcode and use to fill in time
// that's not used by ads. AWS Elemental MediaTailor shows the slate to fill in
// gaps in media content. Configuring the slate is optional for non-VPAID
// configurations. For VPAID, the slate is required because MediaTailor provides it
// in the slots that are designated for dynamic ad content. The slate must be a
// high-quality asset that contains both audio and video.
SlateAdUrl *string
// The tags to assign to the playback configuration. Tags are key-value pairs that
// you can associate with Amazon resources to help with organization, access
// control, and cost tracking. For more information, see Tagging AWS Elemental
// MediaTailor Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html)
// .
Tags map[string]string
// The name that is used to associate this playback configuration with a custom
// transcode profile. This overrides the dynamic transcoding defaults of
// MediaTailor. Use this only if you have already set up custom profiles with the
// help of AWS Support.
TranscodeProfileName *string
// The URL prefix for the parent manifest for the stream, minus the asset ID. The
// maximum length is 512 characters.
VideoContentSourceUrl *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutPlaybackConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutPlaybackConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutPlaybackConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutPlaybackConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutPlaybackConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opPutPlaybackConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "PutPlaybackConfiguration",
}
}
| 285 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Starts a channel. For information about MediaTailor channels, see Working with
// channels (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-channels.html)
// in the MediaTailor User Guide.
func (c *Client) StartChannel(ctx context.Context, params *StartChannelInput, optFns ...func(*Options)) (*StartChannelOutput, error) {
if params == nil {
params = &StartChannelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartChannel", params, optFns, c.addOperationStartChannelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartChannelOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartChannelInput struct {
// The name of the channel.
//
// This member is required.
ChannelName *string
noSmithyDocumentSerde
}
type StartChannelOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartChannelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartChannel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartChannel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStartChannelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartChannel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStartChannel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "StartChannel",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
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 channel. For information about MediaTailor channels, see Working with
// channels (https://docs.aws.amazon.com/mediatailor/latest/ug/channel-assembly-channels.html)
// in the MediaTailor User Guide.
func (c *Client) StopChannel(ctx context.Context, params *StopChannelInput, optFns ...func(*Options)) (*StopChannelOutput, error) {
if params == nil {
params = &StopChannelInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StopChannel", params, optFns, c.addOperationStopChannelMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StopChannelOutput)
out.ResultMetadata = metadata
return out, nil
}
type StopChannelInput struct {
// The name of the channel.
//
// This member is required.
ChannelName *string
noSmithyDocumentSerde
}
type StopChannelOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStopChannelMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStopChannel{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopChannel{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpStopChannelValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopChannel(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(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_opStopChannel(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "mediatailor",
OperationName: "StopChannel",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package mediatailor
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// The resource to tag. Tags are key-value pairs that you can associate with
// Amazon resources to help with organization, access control, and cost tracking.
// For more information, see Tagging AWS Elemental MediaTailor Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html)
// .
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) associated with the resource.
//
// This member is required.
ResourceArn *string
// The tags to assign to the resource. Tags are key-value pairs that you can
// associate with Amazon resources to help with organization, access control, and
// cost tracking. For more information, see Tagging AWS Elemental MediaTailor
// Resources (https://docs.aws.amazon.com/mediatailor/latest/ug/tagging.html) .
//
// 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: "mediatailor",
OperationName: "TagResource",
}
}
| 131 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.