service/networkflowmonitor/serializers.go (1,948 lines of code) (raw):
// Code generated by smithy-go-codegen DO NOT EDIT.
package networkflowmonitor
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/networkflowmonitor/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
"github.com/aws/smithy-go/tracing"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpCreateMonitor struct {
}
func (*awsRestjson1_serializeOpCreateMonitor) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateMonitor) 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.(*CreateMonitorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/monitors")
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_serializeOpDocumentCreateMonitorInput(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_serializeOpHttpBindingsCreateMonitorInput(v *CreateMonitorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateMonitorInput(v *CreateMonitorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.LocalResources != nil {
ok := object.Key("localResources")
if err := awsRestjson1_serializeDocumentMonitorLocalResources(v.LocalResources, ok); err != nil {
return err
}
}
if v.MonitorName != nil {
ok := object.Key("monitorName")
ok.String(*v.MonitorName)
}
if v.RemoteResources != nil {
ok := object.Key("remoteResources")
if err := awsRestjson1_serializeDocumentMonitorRemoteResources(v.RemoteResources, ok); err != nil {
return err
}
}
if v.ScopeArn != nil {
ok := object.Key("scopeArn")
ok.String(*v.ScopeArn)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateScope struct {
}
func (*awsRestjson1_serializeOpCreateScope) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateScope) 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.(*CreateScopeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/scopes")
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_serializeOpDocumentCreateScopeInput(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_serializeOpHttpBindingsCreateScopeInput(v *CreateScopeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateScopeInput(v *CreateScopeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
if v.Targets != nil {
ok := object.Key("targets")
if err := awsRestjson1_serializeDocumentTargetResourceList(v.Targets, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteMonitor struct {
}
func (*awsRestjson1_serializeOpDeleteMonitor) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteMonitor) 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.(*DeleteMonitorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/monitors/{monitorName}")
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_serializeOpHttpBindingsDeleteMonitorInput(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_serializeOpHttpBindingsDeleteMonitorInput(v *DeleteMonitorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MonitorName == nil || len(*v.MonitorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member monitorName must not be empty")}
}
if v.MonitorName != nil {
if err := encoder.SetURI("monitorName").String(*v.MonitorName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteScope struct {
}
func (*awsRestjson1_serializeOpDeleteScope) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteScope) 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.(*DeleteScopeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/scopes/{scopeId}")
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_serializeOpHttpBindingsDeleteScopeInput(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_serializeOpHttpBindingsDeleteScopeInput(v *DeleteScopeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetMonitor struct {
}
func (*awsRestjson1_serializeOpGetMonitor) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetMonitor) 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.(*GetMonitorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/monitors/{monitorName}")
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_serializeOpHttpBindingsGetMonitorInput(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_serializeOpHttpBindingsGetMonitorInput(v *GetMonitorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MonitorName == nil || len(*v.MonitorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member monitorName must not be empty")}
}
if v.MonitorName != nil {
if err := encoder.SetURI("monitorName").String(*v.MonitorName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetQueryResultsMonitorTopContributors struct {
}
func (*awsRestjson1_serializeOpGetQueryResultsMonitorTopContributors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetQueryResultsMonitorTopContributors) 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.(*GetQueryResultsMonitorTopContributorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/monitors/{monitorName}/topContributorsQueries/{queryId}/results")
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_serializeOpHttpBindingsGetQueryResultsMonitorTopContributorsInput(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_serializeOpHttpBindingsGetQueryResultsMonitorTopContributorsInput(v *GetQueryResultsMonitorTopContributorsInput, 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.MonitorName == nil || len(*v.MonitorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member monitorName must not be empty")}
}
if v.MonitorName != nil {
if err := encoder.SetURI("monitorName").String(*v.MonitorName); err != nil {
return err
}
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.QueryId == nil || len(*v.QueryId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member queryId must not be empty")}
}
if v.QueryId != nil {
if err := encoder.SetURI("queryId").String(*v.QueryId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetQueryResultsWorkloadInsightsTopContributors struct {
}
func (*awsRestjson1_serializeOpGetQueryResultsWorkloadInsightsTopContributors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetQueryResultsWorkloadInsightsTopContributors) 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.(*GetQueryResultsWorkloadInsightsTopContributorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/workloadInsights/{scopeId}/topContributorsQueries/{queryId}/results")
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_serializeOpHttpBindingsGetQueryResultsWorkloadInsightsTopContributorsInput(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_serializeOpHttpBindingsGetQueryResultsWorkloadInsightsTopContributorsInput(v *GetQueryResultsWorkloadInsightsTopContributorsInput, 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.QueryId == nil || len(*v.QueryId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member queryId must not be empty")}
}
if v.QueryId != nil {
if err := encoder.SetURI("queryId").String(*v.QueryId); err != nil {
return err
}
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetQueryResultsWorkloadInsightsTopContributorsData struct {
}
func (*awsRestjson1_serializeOpGetQueryResultsWorkloadInsightsTopContributorsData) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetQueryResultsWorkloadInsightsTopContributorsData) 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.(*GetQueryResultsWorkloadInsightsTopContributorsDataInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/workloadInsights/{scopeId}/topContributorsDataQueries/{queryId}/results")
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_serializeOpHttpBindingsGetQueryResultsWorkloadInsightsTopContributorsDataInput(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_serializeOpHttpBindingsGetQueryResultsWorkloadInsightsTopContributorsDataInput(v *GetQueryResultsWorkloadInsightsTopContributorsDataInput, 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.QueryId == nil || len(*v.QueryId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member queryId must not be empty")}
}
if v.QueryId != nil {
if err := encoder.SetURI("queryId").String(*v.QueryId); err != nil {
return err
}
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetQueryStatusMonitorTopContributors struct {
}
func (*awsRestjson1_serializeOpGetQueryStatusMonitorTopContributors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetQueryStatusMonitorTopContributors) 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.(*GetQueryStatusMonitorTopContributorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/monitors/{monitorName}/topContributorsQueries/{queryId}/status")
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_serializeOpHttpBindingsGetQueryStatusMonitorTopContributorsInput(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_serializeOpHttpBindingsGetQueryStatusMonitorTopContributorsInput(v *GetQueryStatusMonitorTopContributorsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MonitorName == nil || len(*v.MonitorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member monitorName must not be empty")}
}
if v.MonitorName != nil {
if err := encoder.SetURI("monitorName").String(*v.MonitorName); err != nil {
return err
}
}
if v.QueryId == nil || len(*v.QueryId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member queryId must not be empty")}
}
if v.QueryId != nil {
if err := encoder.SetURI("queryId").String(*v.QueryId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetQueryStatusWorkloadInsightsTopContributors struct {
}
func (*awsRestjson1_serializeOpGetQueryStatusWorkloadInsightsTopContributors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetQueryStatusWorkloadInsightsTopContributors) 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.(*GetQueryStatusWorkloadInsightsTopContributorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/workloadInsights/{scopeId}/topContributorsQueries/{queryId}/status")
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_serializeOpHttpBindingsGetQueryStatusWorkloadInsightsTopContributorsInput(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_serializeOpHttpBindingsGetQueryStatusWorkloadInsightsTopContributorsInput(v *GetQueryStatusWorkloadInsightsTopContributorsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.QueryId == nil || len(*v.QueryId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member queryId must not be empty")}
}
if v.QueryId != nil {
if err := encoder.SetURI("queryId").String(*v.QueryId); err != nil {
return err
}
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetQueryStatusWorkloadInsightsTopContributorsData struct {
}
func (*awsRestjson1_serializeOpGetQueryStatusWorkloadInsightsTopContributorsData) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetQueryStatusWorkloadInsightsTopContributorsData) 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.(*GetQueryStatusWorkloadInsightsTopContributorsDataInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/workloadInsights/{scopeId}/topContributorsDataQueries/{queryId}/status")
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_serializeOpHttpBindingsGetQueryStatusWorkloadInsightsTopContributorsDataInput(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_serializeOpHttpBindingsGetQueryStatusWorkloadInsightsTopContributorsDataInput(v *GetQueryStatusWorkloadInsightsTopContributorsDataInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.QueryId == nil || len(*v.QueryId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member queryId must not be empty")}
}
if v.QueryId != nil {
if err := encoder.SetURI("queryId").String(*v.QueryId); err != nil {
return err
}
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetScope struct {
}
func (*awsRestjson1_serializeOpGetScope) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetScope) 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.(*GetScopeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/scopes/{scopeId}")
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_serializeOpHttpBindingsGetScopeInput(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_serializeOpHttpBindingsGetScopeInput(v *GetScopeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListMonitors struct {
}
func (*awsRestjson1_serializeOpListMonitors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListMonitors) 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.(*ListMonitorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/monitors")
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_serializeOpHttpBindingsListMonitorsInput(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_serializeOpHttpBindingsListMonitorsInput(v *ListMonitorsInput, 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 len(v.MonitorStatus) > 0 {
encoder.SetQuery("monitorStatus").String(string(v.MonitorStatus))
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListScopes struct {
}
func (*awsRestjson1_serializeOpListScopes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListScopes) 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.(*ListScopesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/scopes")
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_serializeOpHttpBindingsListScopesInput(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_serializeOpHttpBindingsListScopesInput(v *ListScopesInput, 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/{resourceArn}")
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.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStartQueryMonitorTopContributors struct {
}
func (*awsRestjson1_serializeOpStartQueryMonitorTopContributors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartQueryMonitorTopContributors) 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.(*StartQueryMonitorTopContributorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/monitors/{monitorName}/topContributorsQueries")
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_serializeOpHttpBindingsStartQueryMonitorTopContributorsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartQueryMonitorTopContributorsInput(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_serializeOpHttpBindingsStartQueryMonitorTopContributorsInput(v *StartQueryMonitorTopContributorsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MonitorName == nil || len(*v.MonitorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member monitorName must not be empty")}
}
if v.MonitorName != nil {
if err := encoder.SetURI("monitorName").String(*v.MonitorName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentStartQueryMonitorTopContributorsInput(v *StartQueryMonitorTopContributorsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DestinationCategory) > 0 {
ok := object.Key("destinationCategory")
ok.String(string(v.DestinationCategory))
}
if v.EndTime != nil {
ok := object.Key("endTime")
ok.String(smithytime.FormatDateTime(*v.EndTime))
}
if v.Limit != nil {
ok := object.Key("limit")
ok.Integer(*v.Limit)
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.String(smithytime.FormatDateTime(*v.StartTime))
}
return nil
}
type awsRestjson1_serializeOpStartQueryWorkloadInsightsTopContributors struct {
}
func (*awsRestjson1_serializeOpStartQueryWorkloadInsightsTopContributors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartQueryWorkloadInsightsTopContributors) 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.(*StartQueryWorkloadInsightsTopContributorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/workloadInsights/{scopeId}/topContributorsQueries")
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_serializeOpHttpBindingsStartQueryWorkloadInsightsTopContributorsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartQueryWorkloadInsightsTopContributorsInput(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_serializeOpHttpBindingsStartQueryWorkloadInsightsTopContributorsInput(v *StartQueryWorkloadInsightsTopContributorsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentStartQueryWorkloadInsightsTopContributorsInput(v *StartQueryWorkloadInsightsTopContributorsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DestinationCategory) > 0 {
ok := object.Key("destinationCategory")
ok.String(string(v.DestinationCategory))
}
if v.EndTime != nil {
ok := object.Key("endTime")
ok.String(smithytime.FormatDateTime(*v.EndTime))
}
if v.Limit != nil {
ok := object.Key("limit")
ok.Integer(*v.Limit)
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.String(smithytime.FormatDateTime(*v.StartTime))
}
return nil
}
type awsRestjson1_serializeOpStartQueryWorkloadInsightsTopContributorsData struct {
}
func (*awsRestjson1_serializeOpStartQueryWorkloadInsightsTopContributorsData) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartQueryWorkloadInsightsTopContributorsData) 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.(*StartQueryWorkloadInsightsTopContributorsDataInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/workloadInsights/{scopeId}/topContributorsDataQueries")
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_serializeOpHttpBindingsStartQueryWorkloadInsightsTopContributorsDataInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentStartQueryWorkloadInsightsTopContributorsDataInput(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_serializeOpHttpBindingsStartQueryWorkloadInsightsTopContributorsDataInput(v *StartQueryWorkloadInsightsTopContributorsDataInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentStartQueryWorkloadInsightsTopContributorsDataInput(v *StartQueryWorkloadInsightsTopContributorsDataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DestinationCategory) > 0 {
ok := object.Key("destinationCategory")
ok.String(string(v.DestinationCategory))
}
if v.EndTime != nil {
ok := object.Key("endTime")
ok.String(smithytime.FormatDateTime(*v.EndTime))
}
if len(v.MetricName) > 0 {
ok := object.Key("metricName")
ok.String(string(v.MetricName))
}
if v.StartTime != nil {
ok := object.Key("startTime")
ok.String(smithytime.FormatDateTime(*v.StartTime))
}
return nil
}
type awsRestjson1_serializeOpStopQueryMonitorTopContributors struct {
}
func (*awsRestjson1_serializeOpStopQueryMonitorTopContributors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStopQueryMonitorTopContributors) 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.(*StopQueryMonitorTopContributorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/monitors/{monitorName}/topContributorsQueries/{queryId}")
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_serializeOpHttpBindingsStopQueryMonitorTopContributorsInput(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_serializeOpHttpBindingsStopQueryMonitorTopContributorsInput(v *StopQueryMonitorTopContributorsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MonitorName == nil || len(*v.MonitorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member monitorName must not be empty")}
}
if v.MonitorName != nil {
if err := encoder.SetURI("monitorName").String(*v.MonitorName); err != nil {
return err
}
}
if v.QueryId == nil || len(*v.QueryId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member queryId must not be empty")}
}
if v.QueryId != nil {
if err := encoder.SetURI("queryId").String(*v.QueryId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStopQueryWorkloadInsightsTopContributors struct {
}
func (*awsRestjson1_serializeOpStopQueryWorkloadInsightsTopContributors) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStopQueryWorkloadInsightsTopContributors) 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.(*StopQueryWorkloadInsightsTopContributorsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/workloadInsights/{scopeId}/topContributorsQueries/{queryId}")
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_serializeOpHttpBindingsStopQueryWorkloadInsightsTopContributorsInput(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_serializeOpHttpBindingsStopQueryWorkloadInsightsTopContributorsInput(v *StopQueryWorkloadInsightsTopContributorsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.QueryId == nil || len(*v.QueryId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member queryId must not be empty")}
}
if v.QueryId != nil {
if err := encoder.SetURI("queryId").String(*v.QueryId); err != nil {
return err
}
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStopQueryWorkloadInsightsTopContributorsData struct {
}
func (*awsRestjson1_serializeOpStopQueryWorkloadInsightsTopContributorsData) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStopQueryWorkloadInsightsTopContributorsData) 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.(*StopQueryWorkloadInsightsTopContributorsDataInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/workloadInsights/{scopeId}/topContributorsDataQueries/{queryId}")
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_serializeOpHttpBindingsStopQueryWorkloadInsightsTopContributorsDataInput(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_serializeOpHttpBindingsStopQueryWorkloadInsightsTopContributorsDataInput(v *StopQueryWorkloadInsightsTopContributorsDataInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.QueryId == nil || len(*v.QueryId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member queryId must not be empty")}
}
if v.QueryId != nil {
if err := encoder.SetURI("queryId").String(*v.QueryId); err != nil {
return err
}
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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/{resourceArn}")
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.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUntagResource struct {
}
func (*awsRestjson1_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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/{resourceArn}")
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.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("tagKeys").String(v.TagKeys[i])
}
}
return nil
}
type awsRestjson1_serializeOpUpdateMonitor struct {
}
func (*awsRestjson1_serializeOpUpdateMonitor) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateMonitor) 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.(*UpdateMonitorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/monitors/{monitorName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
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_serializeOpHttpBindingsUpdateMonitorInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateMonitorInput(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_serializeOpHttpBindingsUpdateMonitorInput(v *UpdateMonitorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MonitorName == nil || len(*v.MonitorName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member monitorName must not be empty")}
}
if v.MonitorName != nil {
if err := encoder.SetURI("monitorName").String(*v.MonitorName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateMonitorInput(v *UpdateMonitorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.LocalResourcesToAdd != nil {
ok := object.Key("localResourcesToAdd")
if err := awsRestjson1_serializeDocumentMonitorLocalResources(v.LocalResourcesToAdd, ok); err != nil {
return err
}
}
if v.LocalResourcesToRemove != nil {
ok := object.Key("localResourcesToRemove")
if err := awsRestjson1_serializeDocumentMonitorLocalResources(v.LocalResourcesToRemove, ok); err != nil {
return err
}
}
if v.RemoteResourcesToAdd != nil {
ok := object.Key("remoteResourcesToAdd")
if err := awsRestjson1_serializeDocumentMonitorRemoteResources(v.RemoteResourcesToAdd, ok); err != nil {
return err
}
}
if v.RemoteResourcesToRemove != nil {
ok := object.Key("remoteResourcesToRemove")
if err := awsRestjson1_serializeDocumentMonitorRemoteResources(v.RemoteResourcesToRemove, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateScope struct {
}
func (*awsRestjson1_serializeOpUpdateScope) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateScope) 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.(*UpdateScopeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/scopes/{scopeId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
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_serializeOpHttpBindingsUpdateScopeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateScopeInput(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_serializeOpHttpBindingsUpdateScopeInput(v *UpdateScopeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ScopeId == nil || len(*v.ScopeId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member scopeId must not be empty")}
}
if v.ScopeId != nil {
if err := encoder.SetURI("scopeId").String(*v.ScopeId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateScopeInput(v *UpdateScopeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourcesToAdd != nil {
ok := object.Key("resourcesToAdd")
if err := awsRestjson1_serializeDocumentTargetResourceList(v.ResourcesToAdd, ok); err != nil {
return err
}
}
if v.ResourcesToDelete != nil {
ok := object.Key("resourcesToDelete")
if err := awsRestjson1_serializeDocumentTargetResourceList(v.ResourcesToDelete, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMonitorLocalResource(v *types.MonitorLocalResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Identifier != nil {
ok := object.Key("identifier")
ok.String(*v.Identifier)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentMonitorLocalResources(v []types.MonitorLocalResource, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentMonitorLocalResource(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMonitorRemoteResource(v *types.MonitorRemoteResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Identifier != nil {
ok := object.Key("identifier")
ok.String(*v.Identifier)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentMonitorRemoteResources(v []types.MonitorRemoteResource, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentMonitorRemoteResource(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
om.String(v[key])
}
return nil
}
func awsRestjson1_serializeDocumentTargetId(v types.TargetId, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.TargetIdMemberAccountId:
av := object.Key("accountId")
av.String(uv.Value)
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestjson1_serializeDocumentTargetIdentifier(v *types.TargetIdentifier, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TargetId != nil {
ok := object.Key("targetId")
if err := awsRestjson1_serializeDocumentTargetId(v.TargetId, ok); err != nil {
return err
}
}
if len(v.TargetType) > 0 {
ok := object.Key("targetType")
ok.String(string(v.TargetType))
}
return nil
}
func awsRestjson1_serializeDocumentTargetResource(v *types.TargetResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Region != nil {
ok := object.Key("region")
ok.String(*v.Region)
}
if v.TargetIdentifier != nil {
ok := object.Key("targetIdentifier")
if err := awsRestjson1_serializeDocumentTargetIdentifier(v.TargetIdentifier, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTargetResourceList(v []types.TargetResource, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentTargetResource(&v[i], av); err != nil {
return err
}
}
return nil
}