service/notifications/serializers.go (2,393 lines of code) (raw):

// Code generated by smithy-go-codegen DO NOT EDIT. package notifications import ( "bytes" "context" "fmt" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpAssociateChannel struct { } func (*awsRestjson1_serializeOpAssociateChannel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAssociateChannel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AssociateChannelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/channels/associate/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsAssociateChannelInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAssociateChannelInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsAssociateChannelInput(v *AssociateChannelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentAssociateChannelInput(v *AssociateChannelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.NotificationConfigurationArn != nil { ok := object.Key("notificationConfigurationArn") ok.String(*v.NotificationConfigurationArn) } return nil } type awsRestjson1_serializeOpAssociateManagedNotificationAccountContact struct { } func (*awsRestjson1_serializeOpAssociateManagedNotificationAccountContact) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAssociateManagedNotificationAccountContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AssociateManagedNotificationAccountContactInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/contacts/associate-managed-notification/{contactIdentifier}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsAssociateManagedNotificationAccountContactInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAssociateManagedNotificationAccountContactInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsAssociateManagedNotificationAccountContactInput(v *AssociateManagedNotificationAccountContactInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if len(v.ContactIdentifier) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member contactIdentifier must not be empty")} } if len(v.ContactIdentifier) > 0 { if err := encoder.SetURI("contactIdentifier").String(string(v.ContactIdentifier)); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentAssociateManagedNotificationAccountContactInput(v *AssociateManagedNotificationAccountContactInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ManagedNotificationConfigurationArn != nil { ok := object.Key("managedNotificationConfigurationArn") ok.String(*v.ManagedNotificationConfigurationArn) } return nil } type awsRestjson1_serializeOpAssociateManagedNotificationAdditionalChannel struct { } func (*awsRestjson1_serializeOpAssociateManagedNotificationAdditionalChannel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpAssociateManagedNotificationAdditionalChannel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*AssociateManagedNotificationAdditionalChannelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/channels/associate-managed-notification/{channelArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsAssociateManagedNotificationAdditionalChannelInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentAssociateManagedNotificationAdditionalChannelInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsAssociateManagedNotificationAdditionalChannelInput(v *AssociateManagedNotificationAdditionalChannelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ChannelArn == nil || len(*v.ChannelArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member channelArn must not be empty")} } if v.ChannelArn != nil { if err := encoder.SetURI("channelArn").String(*v.ChannelArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentAssociateManagedNotificationAdditionalChannelInput(v *AssociateManagedNotificationAdditionalChannelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ManagedNotificationConfigurationArn != nil { ok := object.Key("managedNotificationConfigurationArn") ok.String(*v.ManagedNotificationConfigurationArn) } return nil } type awsRestjson1_serializeOpCreateEventRule struct { } func (*awsRestjson1_serializeOpCreateEventRule) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateEventRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateEventRuleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/event-rules") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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_serializeOpDocumentCreateEventRuleInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateEventRuleInput(v *CreateEventRuleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateEventRuleInput(v *CreateEventRuleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EventPattern != nil { ok := object.Key("eventPattern") ok.String(*v.EventPattern) } if v.EventType != nil { ok := object.Key("eventType") ok.String(*v.EventType) } if v.NotificationConfigurationArn != nil { ok := object.Key("notificationConfigurationArn") ok.String(*v.NotificationConfigurationArn) } if v.Regions != nil { ok := object.Key("regions") if err := awsRestjson1_serializeDocumentRegions(v.Regions, ok); err != nil { return err } } if v.Source != nil { ok := object.Key("source") ok.String(*v.Source) } return nil } type awsRestjson1_serializeOpCreateNotificationConfiguration struct { } func (*awsRestjson1_serializeOpCreateNotificationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateNotificationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-configurations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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_serializeOpDocumentCreateNotificationConfigurationInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsCreateNotificationConfigurationInput(v *CreateNotificationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateNotificationConfigurationInput(v *CreateNotificationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AggregationDuration) > 0 { ok := object.Key("aggregationDuration") ok.String(string(v.AggregationDuration)) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteEventRule struct { } func (*awsRestjson1_serializeOpDeleteEventRule) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteEventRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteEventRuleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/event-rules/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteEventRuleInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteEventRuleInput(v *DeleteEventRuleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteNotificationConfiguration struct { } func (*awsRestjson1_serializeOpDeleteNotificationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteNotificationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-configurations/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeleteNotificationConfigurationInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeleteNotificationConfigurationInput(v *DeleteNotificationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeregisterNotificationHub struct { } func (*awsRestjson1_serializeOpDeregisterNotificationHub) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeregisterNotificationHub) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeregisterNotificationHubInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-hubs/{notificationHubRegion}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDeregisterNotificationHubInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDeregisterNotificationHubInput(v *DeregisterNotificationHubInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.NotificationHubRegion == nil || len(*v.NotificationHubRegion) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member notificationHubRegion must not be empty")} } if v.NotificationHubRegion != nil { if err := encoder.SetURI("notificationHubRegion").String(*v.NotificationHubRegion); err != nil { return err } } return nil } type awsRestjson1_serializeOpDisableNotificationsAccessForOrganization struct { } func (*awsRestjson1_serializeOpDisableNotificationsAccessForOrganization) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisableNotificationsAccessForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisableNotificationsAccessForOrganizationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/organization/access") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if 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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDisableNotificationsAccessForOrganizationInput(v *DisableNotificationsAccessForOrganizationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpDisassociateChannel struct { } func (*awsRestjson1_serializeOpDisassociateChannel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateChannel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateChannelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/channels/disassociate/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDisassociateChannelInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDisassociateChannelInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDisassociateChannelInput(v *DisassociateChannelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentDisassociateChannelInput(v *DisassociateChannelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.NotificationConfigurationArn != nil { ok := object.Key("notificationConfigurationArn") ok.String(*v.NotificationConfigurationArn) } return nil } type awsRestjson1_serializeOpDisassociateManagedNotificationAccountContact struct { } func (*awsRestjson1_serializeOpDisassociateManagedNotificationAccountContact) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateManagedNotificationAccountContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateManagedNotificationAccountContactInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/contacts/disassociate-managed-notification/{contactIdentifier}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDisassociateManagedNotificationAccountContactInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDisassociateManagedNotificationAccountContactInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDisassociateManagedNotificationAccountContactInput(v *DisassociateManagedNotificationAccountContactInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if len(v.ContactIdentifier) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member contactIdentifier must not be empty")} } if len(v.ContactIdentifier) > 0 { if err := encoder.SetURI("contactIdentifier").String(string(v.ContactIdentifier)); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentDisassociateManagedNotificationAccountContactInput(v *DisassociateManagedNotificationAccountContactInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ManagedNotificationConfigurationArn != nil { ok := object.Key("managedNotificationConfigurationArn") ok.String(*v.ManagedNotificationConfigurationArn) } return nil } type awsRestjson1_serializeOpDisassociateManagedNotificationAdditionalChannel struct { } func (*awsRestjson1_serializeOpDisassociateManagedNotificationAdditionalChannel) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDisassociateManagedNotificationAdditionalChannel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateManagedNotificationAdditionalChannelInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/channels/disassociate-managed-notification/{channelArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsDisassociateManagedNotificationAdditionalChannelInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentDisassociateManagedNotificationAdditionalChannelInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsDisassociateManagedNotificationAdditionalChannelInput(v *DisassociateManagedNotificationAdditionalChannelInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ChannelArn == nil || len(*v.ChannelArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member channelArn must not be empty")} } if v.ChannelArn != nil { if err := encoder.SetURI("channelArn").String(*v.ChannelArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentDisassociateManagedNotificationAdditionalChannelInput(v *DisassociateManagedNotificationAdditionalChannelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ManagedNotificationConfigurationArn != nil { ok := object.Key("managedNotificationConfigurationArn") ok.String(*v.ManagedNotificationConfigurationArn) } return nil } type awsRestjson1_serializeOpEnableNotificationsAccessForOrganization struct { } func (*awsRestjson1_serializeOpEnableNotificationsAccessForOrganization) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpEnableNotificationsAccessForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*EnableNotificationsAccessForOrganizationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/organization/access") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if 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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsEnableNotificationsAccessForOrganizationInput(v *EnableNotificationsAccessForOrganizationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpGetEventRule struct { } func (*awsRestjson1_serializeOpGetEventRule) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetEventRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetEventRuleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/event-rules/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetEventRuleInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetEventRuleInput(v *GetEventRuleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetManagedNotificationChildEvent struct { } func (*awsRestjson1_serializeOpGetManagedNotificationChildEvent) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetManagedNotificationChildEvent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetManagedNotificationChildEventInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/managed-notification-child-events/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetManagedNotificationChildEventInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetManagedNotificationChildEventInput(v *GetManagedNotificationChildEventInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } if len(v.Locale) > 0 { encoder.SetQuery("locale").String(string(v.Locale)) } return nil } type awsRestjson1_serializeOpGetManagedNotificationConfiguration struct { } func (*awsRestjson1_serializeOpGetManagedNotificationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetManagedNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetManagedNotificationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/managed-notification-configurations/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetManagedNotificationConfigurationInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetManagedNotificationConfigurationInput(v *GetManagedNotificationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetManagedNotificationEvent struct { } func (*awsRestjson1_serializeOpGetManagedNotificationEvent) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetManagedNotificationEvent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetManagedNotificationEventInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/managed-notification-events/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetManagedNotificationEventInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetManagedNotificationEventInput(v *GetManagedNotificationEventInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } if len(v.Locale) > 0 { encoder.SetQuery("locale").String(string(v.Locale)) } return nil } type awsRestjson1_serializeOpGetNotificationConfiguration struct { } func (*awsRestjson1_serializeOpGetNotificationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetNotificationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-configurations/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetNotificationConfigurationInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetNotificationConfigurationInput(v *GetNotificationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetNotificationEvent struct { } func (*awsRestjson1_serializeOpGetNotificationEvent) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetNotificationEvent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetNotificationEventInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-events/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsGetNotificationEventInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetNotificationEventInput(v *GetNotificationEventInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } if len(v.Locale) > 0 { encoder.SetQuery("locale").String(string(v.Locale)) } return nil } type awsRestjson1_serializeOpGetNotificationsAccessForOrganization struct { } func (*awsRestjson1_serializeOpGetNotificationsAccessForOrganization) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetNotificationsAccessForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetNotificationsAccessForOrganizationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/organization/access") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if 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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsGetNotificationsAccessForOrganizationInput(v *GetNotificationsAccessForOrganizationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } type awsRestjson1_serializeOpListChannels struct { } func (*awsRestjson1_serializeOpListChannels) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListChannels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListChannelsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/channels") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListChannelsInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListChannelsInput(v *ListChannelsInput, 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.NotificationConfigurationArn != nil { encoder.SetQuery("notificationConfigurationArn").String(*v.NotificationConfigurationArn) } return nil } type awsRestjson1_serializeOpListEventRules struct { } func (*awsRestjson1_serializeOpListEventRules) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListEventRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListEventRulesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/event-rules") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListEventRulesInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListEventRulesInput(v *ListEventRulesInput, 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.NotificationConfigurationArn != nil { encoder.SetQuery("notificationConfigurationArn").String(*v.NotificationConfigurationArn) } return nil } type awsRestjson1_serializeOpListManagedNotificationChannelAssociations struct { } func (*awsRestjson1_serializeOpListManagedNotificationChannelAssociations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListManagedNotificationChannelAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListManagedNotificationChannelAssociationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/channels/list-managed-notification-channel-associations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListManagedNotificationChannelAssociationsInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListManagedNotificationChannelAssociationsInput(v *ListManagedNotificationChannelAssociationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ManagedNotificationConfigurationArn != nil { encoder.SetQuery("managedNotificationConfigurationArn").String(*v.ManagedNotificationConfigurationArn) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListManagedNotificationChildEvents struct { } func (*awsRestjson1_serializeOpListManagedNotificationChildEvents) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListManagedNotificationChildEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListManagedNotificationChildEventsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/list-managed-notification-child-events/{aggregateManagedNotificationEventArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListManagedNotificationChildEventsInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListManagedNotificationChildEventsInput(v *ListManagedNotificationChildEventsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.AggregateManagedNotificationEventArn == nil || len(*v.AggregateManagedNotificationEventArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member aggregateManagedNotificationEventArn must not be empty")} } if v.AggregateManagedNotificationEventArn != nil { if err := encoder.SetURI("aggregateManagedNotificationEventArn").String(*v.AggregateManagedNotificationEventArn); err != nil { return err } } if v.EndTime != nil { encoder.SetQuery("endTime").String(smithytime.FormatDateTime(*v.EndTime)) } if len(v.Locale) > 0 { encoder.SetQuery("locale").String(string(v.Locale)) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.OrganizationalUnitId != nil { encoder.SetQuery("organizationalUnitId").String(*v.OrganizationalUnitId) } if v.RelatedAccount != nil { encoder.SetQuery("relatedAccount").String(*v.RelatedAccount) } if v.StartTime != nil { encoder.SetQuery("startTime").String(smithytime.FormatDateTime(*v.StartTime)) } return nil } type awsRestjson1_serializeOpListManagedNotificationConfigurations struct { } func (*awsRestjson1_serializeOpListManagedNotificationConfigurations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListManagedNotificationConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListManagedNotificationConfigurationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/managed-notification-configurations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListManagedNotificationConfigurationsInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListManagedNotificationConfigurationsInput(v *ListManagedNotificationConfigurationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ChannelIdentifier != nil { encoder.SetQuery("channelIdentifier").String(*v.ChannelIdentifier) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListManagedNotificationEvents struct { } func (*awsRestjson1_serializeOpListManagedNotificationEvents) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListManagedNotificationEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListManagedNotificationEventsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/managed-notification-events") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListManagedNotificationEventsInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListManagedNotificationEventsInput(v *ListManagedNotificationEventsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.EndTime != nil { encoder.SetQuery("endTime").String(smithytime.FormatDateTime(*v.EndTime)) } if len(v.Locale) > 0 { encoder.SetQuery("locale").String(string(v.Locale)) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.OrganizationalUnitId != nil { encoder.SetQuery("organizationalUnitId").String(*v.OrganizationalUnitId) } if v.RelatedAccount != nil { encoder.SetQuery("relatedAccount").String(*v.RelatedAccount) } if v.Source != nil { encoder.SetQuery("source").String(*v.Source) } if v.StartTime != nil { encoder.SetQuery("startTime").String(smithytime.FormatDateTime(*v.StartTime)) } return nil } type awsRestjson1_serializeOpListNotificationConfigurations struct { } func (*awsRestjson1_serializeOpListNotificationConfigurations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListNotificationConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListNotificationConfigurationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-configurations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListNotificationConfigurationsInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListNotificationConfigurationsInput(v *ListNotificationConfigurationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ChannelArn != nil { encoder.SetQuery("channelArn").String(*v.ChannelArn) } if v.EventRuleSource != nil { encoder.SetQuery("eventRuleSource").String(*v.EventRuleSource) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if len(v.Status) > 0 { encoder.SetQuery("status").String(string(v.Status)) } return nil } type awsRestjson1_serializeOpListNotificationEvents struct { } func (*awsRestjson1_serializeOpListNotificationEvents) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListNotificationEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListNotificationEventsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-events") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListNotificationEventsInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListNotificationEventsInput(v *ListNotificationEventsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.AggregateNotificationEventArn != nil { encoder.SetQuery("aggregateNotificationEventArn").String(*v.AggregateNotificationEventArn) } if v.EndTime != nil { encoder.SetQuery("endTime").String(smithytime.FormatDateTime(*v.EndTime)) } if v.IncludeChildEvents != nil { encoder.SetQuery("includeChildEvents").Boolean(*v.IncludeChildEvents) } if len(v.Locale) > 0 { encoder.SetQuery("locale").String(string(v.Locale)) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.Source != nil { encoder.SetQuery("source").String(*v.Source) } if v.StartTime != nil { encoder.SetQuery("startTime").String(smithytime.FormatDateTime(*v.StartTime)) } return nil } type awsRestjson1_serializeOpListNotificationHubs struct { } func (*awsRestjson1_serializeOpListNotificationHubs) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListNotificationHubs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListNotificationHubsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-hubs") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListNotificationHubsInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListNotificationHubsInput(v *ListNotificationHubsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := 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/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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 endTimer() span.End() 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.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpRegisterNotificationHub struct { } func (*awsRestjson1_serializeOpRegisterNotificationHub) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRegisterNotificationHub) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*RegisterNotificationHubInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-hubs") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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_serializeOpDocumentRegisterNotificationHubInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsRegisterNotificationHubInput(v *RegisterNotificationHubInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentRegisterNotificationHubInput(v *RegisterNotificationHubInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.NotificationHubRegion != nil { ok := object.Key("notificationHubRegion") ok.String(*v.NotificationHubRegion) } 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, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := 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/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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 endTimer() span.End() 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.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := 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/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, 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 endTimer() span.End() 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.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateEventRule struct { } func (*awsRestjson1_serializeOpUpdateEventRule) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateEventRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateEventRuleInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/event-rules/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateEventRuleInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateEventRuleInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateEventRuleInput(v *UpdateEventRuleInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateEventRuleInput(v *UpdateEventRuleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EventPattern != nil { ok := object.Key("eventPattern") ok.String(*v.EventPattern) } if v.Regions != nil { ok := object.Key("regions") if err := awsRestjson1_serializeDocumentRegions(v.Regions, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateNotificationConfiguration struct { } func (*awsRestjson1_serializeOpUpdateNotificationConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") endTimer := startMetricTimer(ctx, "client.call.serialization_duration") defer endTimer() defer span.End() request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateNotificationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/notification-configurations/{arn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) } else { request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) } if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUpdateNotificationConfigurationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateNotificationConfigurationInput(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 endTimer() span.End() return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUpdateNotificationConfigurationInput(v *UpdateNotificationConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("arn").String(*v.Arn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateNotificationConfigurationInput(v *UpdateNotificationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AggregationDuration) > 0 { ok := object.Key("aggregationDuration") ok.String(string(v.AggregationDuration)) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } return nil } func awsRestjson1_serializeDocumentRegions(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil }