service/iotsitewise/serializers.go (7,978 lines of code) (raw):
// Code generated by smithy-go-codegen DO NOT EDIT.
package iotsitewise
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/iotsitewise/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"
"math"
)
type awsRestjson1_serializeOpAssociateAssets struct {
}
func (*awsRestjson1_serializeOpAssociateAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAssociateAssets) 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.(*AssociateAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/associate")
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_serializeOpHttpBindingsAssociateAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentAssociateAssetsInput(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_serializeOpHttpBindingsAssociateAssetsInput(v *AssociateAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentAssociateAssetsInput(v *AssociateAssetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChildAssetId != nil {
ok := object.Key("childAssetId")
ok.String(*v.ChildAssetId)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.HierarchyId != nil {
ok := object.Key("hierarchyId")
ok.String(*v.HierarchyId)
}
return nil
}
type awsRestjson1_serializeOpAssociateTimeSeriesToAssetProperty struct {
}
func (*awsRestjson1_serializeOpAssociateTimeSeriesToAssetProperty) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAssociateTimeSeriesToAssetProperty) 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.(*AssociateTimeSeriesToAssetPropertyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries/associate")
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_serializeOpHttpBindingsAssociateTimeSeriesToAssetPropertyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentAssociateTimeSeriesToAssetPropertyInput(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_serializeOpHttpBindingsAssociateTimeSeriesToAssetPropertyInput(v *AssociateTimeSeriesToAssetPropertyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Alias != nil {
encoder.SetQuery("alias").String(*v.Alias)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
func awsRestjson1_serializeOpDocumentAssociateTimeSeriesToAssetPropertyInput(v *AssociateTimeSeriesToAssetPropertyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpBatchAssociateProjectAssets struct {
}
func (*awsRestjson1_serializeOpBatchAssociateProjectAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchAssociateProjectAssets) 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.(*BatchAssociateProjectAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}/assets/associate")
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_serializeOpHttpBindingsBatchAssociateProjectAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchAssociateProjectAssetsInput(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_serializeOpHttpBindingsBatchAssociateProjectAssetsInput(v *BatchAssociateProjectAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchAssociateProjectAssetsInput(v *BatchAssociateProjectAssetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetIds != nil {
ok := object.Key("assetIds")
if err := awsRestjson1_serializeDocumentIDs(v.AssetIds, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpBatchDisassociateProjectAssets struct {
}
func (*awsRestjson1_serializeOpBatchDisassociateProjectAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchDisassociateProjectAssets) 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.(*BatchDisassociateProjectAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}/assets/disassociate")
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_serializeOpHttpBindingsBatchDisassociateProjectAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentBatchDisassociateProjectAssetsInput(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_serializeOpHttpBindingsBatchDisassociateProjectAssetsInput(v *BatchDisassociateProjectAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchDisassociateProjectAssetsInput(v *BatchDisassociateProjectAssetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetIds != nil {
ok := object.Key("assetIds")
if err := awsRestjson1_serializeDocumentIDs(v.AssetIds, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpBatchGetAssetPropertyAggregates struct {
}
func (*awsRestjson1_serializeOpBatchGetAssetPropertyAggregates) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchGetAssetPropertyAggregates) 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.(*BatchGetAssetPropertyAggregatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/batch/aggregates")
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_serializeOpDocumentBatchGetAssetPropertyAggregatesInput(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_serializeOpHttpBindingsBatchGetAssetPropertyAggregatesInput(v *BatchGetAssetPropertyAggregatesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchGetAssetPropertyAggregatesInput(v *BatchGetAssetPropertyAggregatesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Entries != nil {
ok := object.Key("entries")
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyAggregatesEntries(v.Entries, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpBatchGetAssetPropertyValue struct {
}
func (*awsRestjson1_serializeOpBatchGetAssetPropertyValue) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchGetAssetPropertyValue) 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.(*BatchGetAssetPropertyValueInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/batch/latest")
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_serializeOpDocumentBatchGetAssetPropertyValueInput(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_serializeOpHttpBindingsBatchGetAssetPropertyValueInput(v *BatchGetAssetPropertyValueInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchGetAssetPropertyValueInput(v *BatchGetAssetPropertyValueInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Entries != nil {
ok := object.Key("entries")
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyValueEntries(v.Entries, ok); err != nil {
return err
}
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpBatchGetAssetPropertyValueHistory struct {
}
func (*awsRestjson1_serializeOpBatchGetAssetPropertyValueHistory) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchGetAssetPropertyValueHistory) 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.(*BatchGetAssetPropertyValueHistoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/batch/history")
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_serializeOpDocumentBatchGetAssetPropertyValueHistoryInput(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_serializeOpHttpBindingsBatchGetAssetPropertyValueHistoryInput(v *BatchGetAssetPropertyValueHistoryInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchGetAssetPropertyValueHistoryInput(v *BatchGetAssetPropertyValueHistoryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Entries != nil {
ok := object.Key("entries")
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyValueHistoryEntries(v.Entries, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpBatchPutAssetPropertyValue struct {
}
func (*awsRestjson1_serializeOpBatchPutAssetPropertyValue) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchPutAssetPropertyValue) 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.(*BatchPutAssetPropertyValueInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties")
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_serializeOpDocumentBatchPutAssetPropertyValueInput(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_serializeOpHttpBindingsBatchPutAssetPropertyValueInput(v *BatchPutAssetPropertyValueInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchPutAssetPropertyValueInput(v *BatchPutAssetPropertyValueInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EnablePartialEntryProcessing != nil {
ok := object.Key("enablePartialEntryProcessing")
ok.Boolean(*v.EnablePartialEntryProcessing)
}
if v.Entries != nil {
ok := object.Key("entries")
if err := awsRestjson1_serializeDocumentPutAssetPropertyValueEntries(v.Entries, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateAccessPolicy struct {
}
func (*awsRestjson1_serializeOpCreateAccessPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAccessPolicy) 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.(*CreateAccessPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies")
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_serializeOpDocumentCreateAccessPolicyInput(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_serializeOpHttpBindingsCreateAccessPolicyInput(v *CreateAccessPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAccessPolicyInput(v *CreateAccessPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessPolicyIdentity != nil {
ok := object.Key("accessPolicyIdentity")
if err := awsRestjson1_serializeDocumentIdentity(v.AccessPolicyIdentity, ok); err != nil {
return err
}
}
if len(v.AccessPolicyPermission) > 0 {
ok := object.Key("accessPolicyPermission")
ok.String(string(v.AccessPolicyPermission))
}
if v.AccessPolicyResource != nil {
ok := object.Key("accessPolicyResource")
if err := awsRestjson1_serializeDocumentResource(v.AccessPolicyResource, ok); err != nil {
return err
}
}
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
}
}
return nil
}
type awsRestjson1_serializeOpCreateAsset struct {
}
func (*awsRestjson1_serializeOpCreateAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*CreateAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
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_serializeOpDocumentCreateAssetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateAssetInput(v *CreateAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAssetInput(v *CreateAssetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetDescription != nil {
ok := object.Key("assetDescription")
ok.String(*v.AssetDescription)
}
if v.AssetExternalId != nil {
ok := object.Key("assetExternalId")
ok.String(*v.AssetExternalId)
}
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
if v.AssetModelId != nil {
ok := object.Key("assetModelId")
ok.String(*v.AssetModelId)
}
if v.AssetName != nil {
ok := object.Key("assetName")
ok.String(*v.AssetName)
}
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
}
}
return nil
}
type awsRestjson1_serializeOpCreateAssetModel struct {
}
func (*awsRestjson1_serializeOpCreateAssetModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAssetModel) 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.(*CreateAssetModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models")
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_serializeOpDocumentCreateAssetModelInput(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_serializeOpHttpBindingsCreateAssetModelInput(v *CreateAssetModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAssetModelInput(v *CreateAssetModelInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetModelCompositeModels != nil {
ok := object.Key("assetModelCompositeModels")
if err := awsRestjson1_serializeDocumentAssetModelCompositeModelDefinitions(v.AssetModelCompositeModels, ok); err != nil {
return err
}
}
if v.AssetModelDescription != nil {
ok := object.Key("assetModelDescription")
ok.String(*v.AssetModelDescription)
}
if v.AssetModelExternalId != nil {
ok := object.Key("assetModelExternalId")
ok.String(*v.AssetModelExternalId)
}
if v.AssetModelHierarchies != nil {
ok := object.Key("assetModelHierarchies")
if err := awsRestjson1_serializeDocumentAssetModelHierarchyDefinitions(v.AssetModelHierarchies, ok); err != nil {
return err
}
}
if v.AssetModelId != nil {
ok := object.Key("assetModelId")
ok.String(*v.AssetModelId)
}
if v.AssetModelName != nil {
ok := object.Key("assetModelName")
ok.String(*v.AssetModelName)
}
if v.AssetModelProperties != nil {
ok := object.Key("assetModelProperties")
if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v.AssetModelProperties, ok); err != nil {
return err
}
}
if len(v.AssetModelType) > 0 {
ok := object.Key("assetModelType")
ok.String(string(v.AssetModelType))
}
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
}
}
return nil
}
type awsRestjson1_serializeOpCreateAssetModelCompositeModel struct {
}
func (*awsRestjson1_serializeOpCreateAssetModelCompositeModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAssetModelCompositeModel) 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.(*CreateAssetModelCompositeModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models")
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_serializeOpHttpBindingsCreateAssetModelCompositeModelInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateAssetModelCompositeModelInput(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_serializeOpHttpBindingsCreateAssetModelCompositeModelInput(v *CreateAssetModelCompositeModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.IfMatch != nil {
locationName := "If-Match"
encoder.SetHeader(locationName).String(*v.IfMatch)
}
if v.IfNoneMatch != nil {
locationName := "If-None-Match"
encoder.SetHeader(locationName).String(*v.IfNoneMatch)
}
if len(v.MatchForVersionType) > 0 {
locationName := "Match-For-Version-Type"
encoder.SetHeader(locationName).String(string(v.MatchForVersionType))
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAssetModelCompositeModelInput(v *CreateAssetModelCompositeModelInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetModelCompositeModelDescription != nil {
ok := object.Key("assetModelCompositeModelDescription")
ok.String(*v.AssetModelCompositeModelDescription)
}
if v.AssetModelCompositeModelExternalId != nil {
ok := object.Key("assetModelCompositeModelExternalId")
ok.String(*v.AssetModelCompositeModelExternalId)
}
if v.AssetModelCompositeModelId != nil {
ok := object.Key("assetModelCompositeModelId")
ok.String(*v.AssetModelCompositeModelId)
}
if v.AssetModelCompositeModelName != nil {
ok := object.Key("assetModelCompositeModelName")
ok.String(*v.AssetModelCompositeModelName)
}
if v.AssetModelCompositeModelProperties != nil {
ok := object.Key("assetModelCompositeModelProperties")
if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v.AssetModelCompositeModelProperties, ok); err != nil {
return err
}
}
if v.AssetModelCompositeModelType != nil {
ok := object.Key("assetModelCompositeModelType")
ok.String(*v.AssetModelCompositeModelType)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ComposedAssetModelId != nil {
ok := object.Key("composedAssetModelId")
ok.String(*v.ComposedAssetModelId)
}
if v.ParentAssetModelCompositeModelId != nil {
ok := object.Key("parentAssetModelCompositeModelId")
ok.String(*v.ParentAssetModelCompositeModelId)
}
return nil
}
type awsRestjson1_serializeOpCreateBulkImportJob struct {
}
func (*awsRestjson1_serializeOpCreateBulkImportJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateBulkImportJob) 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.(*CreateBulkImportJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobs")
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_serializeOpDocumentCreateBulkImportJobInput(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_serializeOpHttpBindingsCreateBulkImportJobInput(v *CreateBulkImportJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateBulkImportJobInput(v *CreateBulkImportJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdaptiveIngestion != nil {
ok := object.Key("adaptiveIngestion")
ok.Boolean(*v.AdaptiveIngestion)
}
if v.DeleteFilesAfterImport != nil {
ok := object.Key("deleteFilesAfterImport")
ok.Boolean(*v.DeleteFilesAfterImport)
}
if v.ErrorReportLocation != nil {
ok := object.Key("errorReportLocation")
if err := awsRestjson1_serializeDocumentErrorReportLocation(v.ErrorReportLocation, ok); err != nil {
return err
}
}
if v.Files != nil {
ok := object.Key("files")
if err := awsRestjson1_serializeDocumentFiles(v.Files, ok); err != nil {
return err
}
}
if v.JobConfiguration != nil {
ok := object.Key("jobConfiguration")
if err := awsRestjson1_serializeDocumentJobConfiguration(v.JobConfiguration, ok); err != nil {
return err
}
}
if v.JobName != nil {
ok := object.Key("jobName")
ok.String(*v.JobName)
}
if v.JobRoleArn != nil {
ok := object.Key("jobRoleArn")
ok.String(*v.JobRoleArn)
}
return nil
}
type awsRestjson1_serializeOpCreateDashboard struct {
}
func (*awsRestjson1_serializeOpCreateDashboard) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDashboard) 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.(*CreateDashboardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards")
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_serializeOpDocumentCreateDashboardInput(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_serializeOpHttpBindingsCreateDashboardInput(v *CreateDashboardInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDashboardInput(v *CreateDashboardInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.DashboardDefinition != nil {
ok := object.Key("dashboardDefinition")
ok.String(*v.DashboardDefinition)
}
if v.DashboardDescription != nil {
ok := object.Key("dashboardDescription")
ok.String(*v.DashboardDescription)
}
if v.DashboardName != nil {
ok := object.Key("dashboardName")
ok.String(*v.DashboardName)
}
if v.ProjectId != nil {
ok := object.Key("projectId")
ok.String(*v.ProjectId)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateDataset struct {
}
func (*awsRestjson1_serializeOpCreateDataset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*CreateDatasetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets")
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_serializeOpDocumentCreateDatasetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateDatasetInput(v *CreateDatasetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDatasetInput(v *CreateDatasetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.DatasetDescription != nil {
ok := object.Key("datasetDescription")
ok.String(*v.DatasetDescription)
}
if v.DatasetId != nil {
ok := object.Key("datasetId")
ok.String(*v.DatasetId)
}
if v.DatasetName != nil {
ok := object.Key("datasetName")
ok.String(*v.DatasetName)
}
if v.DatasetSource != nil {
ok := object.Key("datasetSource")
if err := awsRestjson1_serializeDocumentDatasetSource(v.DatasetSource, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateGateway struct {
}
func (*awsRestjson1_serializeOpCreateGateway) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateGateway) 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.(*CreateGatewayInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways")
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_serializeOpDocumentCreateGatewayInput(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_serializeOpHttpBindingsCreateGatewayInput(v *CreateGatewayInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateGatewayInput(v *CreateGatewayInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayName != nil {
ok := object.Key("gatewayName")
ok.String(*v.GatewayName)
}
if v.GatewayPlatform != nil {
ok := object.Key("gatewayPlatform")
if err := awsRestjson1_serializeDocumentGatewayPlatform(v.GatewayPlatform, ok); err != nil {
return err
}
}
if v.GatewayVersion != nil {
ok := object.Key("gatewayVersion")
ok.String(*v.GatewayVersion)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreatePortal struct {
}
func (*awsRestjson1_serializeOpCreatePortal) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreatePortal) 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.(*CreatePortalInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals")
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_serializeOpDocumentCreatePortalInput(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_serializeOpHttpBindingsCreatePortalInput(v *CreatePortalInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreatePortalInput(v *CreatePortalInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Alarms != nil {
ok := object.Key("alarms")
if err := awsRestjson1_serializeDocumentAlarms(v.Alarms, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.NotificationSenderEmail != nil {
ok := object.Key("notificationSenderEmail")
ok.String(*v.NotificationSenderEmail)
}
if len(v.PortalAuthMode) > 0 {
ok := object.Key("portalAuthMode")
ok.String(string(v.PortalAuthMode))
}
if v.PortalContactEmail != nil {
ok := object.Key("portalContactEmail")
ok.String(*v.PortalContactEmail)
}
if v.PortalDescription != nil {
ok := object.Key("portalDescription")
ok.String(*v.PortalDescription)
}
if v.PortalLogoImageFile != nil {
ok := object.Key("portalLogoImageFile")
if err := awsRestjson1_serializeDocumentImageFile(v.PortalLogoImageFile, ok); err != nil {
return err
}
}
if v.PortalName != nil {
ok := object.Key("portalName")
ok.String(*v.PortalName)
}
if len(v.PortalType) > 0 {
ok := object.Key("portalType")
ok.String(string(v.PortalType))
}
if v.PortalTypeConfiguration != nil {
ok := object.Key("portalTypeConfiguration")
if err := awsRestjson1_serializeDocumentPortalTypeConfiguration(v.PortalTypeConfiguration, ok); err != nil {
return err
}
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateProject struct {
}
func (*awsRestjson1_serializeOpCreateProject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*CreateProjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects")
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_serializeOpDocumentCreateProjectInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateProjectInput(v *CreateProjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.PortalId != nil {
ok := object.Key("portalId")
ok.String(*v.PortalId)
}
if v.ProjectDescription != nil {
ok := object.Key("projectDescription")
ok.String(*v.ProjectDescription)
}
if v.ProjectName != nil {
ok := object.Key("projectName")
ok.String(*v.ProjectName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteAccessPolicy struct {
}
func (*awsRestjson1_serializeOpDeleteAccessPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAccessPolicy) 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.(*DeleteAccessPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies/{accessPolicyId}")
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_serializeOpHttpBindingsDeleteAccessPolicyInput(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_serializeOpHttpBindingsDeleteAccessPolicyInput(v *DeleteAccessPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccessPolicyId == nil || len(*v.AccessPolicyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member accessPolicyId must not be empty")}
}
if v.AccessPolicyId != nil {
if err := encoder.SetURI("accessPolicyId").String(*v.AccessPolicyId); err != nil {
return err
}
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpDeleteAsset struct {
}
func (*awsRestjson1_serializeOpDeleteAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*DeleteAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}")
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_serializeOpHttpBindingsDeleteAssetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteAssetInput(v *DeleteAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpDeleteAssetModel struct {
}
func (*awsRestjson1_serializeOpDeleteAssetModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAssetModel) 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.(*DeleteAssetModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}")
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_serializeOpHttpBindingsDeleteAssetModelInput(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_serializeOpHttpBindingsDeleteAssetModelInput(v *DeleteAssetModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
if v.IfMatch != nil {
locationName := "If-Match"
encoder.SetHeader(locationName).String(*v.IfMatch)
}
if v.IfNoneMatch != nil {
locationName := "If-None-Match"
encoder.SetHeader(locationName).String(*v.IfNoneMatch)
}
if len(v.MatchForVersionType) > 0 {
locationName := "Match-For-Version-Type"
encoder.SetHeader(locationName).String(string(v.MatchForVersionType))
}
return nil
}
type awsRestjson1_serializeOpDeleteAssetModelCompositeModel struct {
}
func (*awsRestjson1_serializeOpDeleteAssetModelCompositeModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAssetModelCompositeModel) 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.(*DeleteAssetModelCompositeModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models/{assetModelCompositeModelId}")
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_serializeOpHttpBindingsDeleteAssetModelCompositeModelInput(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_serializeOpHttpBindingsDeleteAssetModelCompositeModelInput(v *DeleteAssetModelCompositeModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelCompositeModelId == nil || len(*v.AssetModelCompositeModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelCompositeModelId must not be empty")}
}
if v.AssetModelCompositeModelId != nil {
if err := encoder.SetURI("assetModelCompositeModelId").String(*v.AssetModelCompositeModelId); err != nil {
return err
}
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
if v.IfMatch != nil {
locationName := "If-Match"
encoder.SetHeader(locationName).String(*v.IfMatch)
}
if v.IfNoneMatch != nil {
locationName := "If-None-Match"
encoder.SetHeader(locationName).String(*v.IfNoneMatch)
}
if len(v.MatchForVersionType) > 0 {
locationName := "Match-For-Version-Type"
encoder.SetHeader(locationName).String(string(v.MatchForVersionType))
}
return nil
}
type awsRestjson1_serializeOpDeleteDashboard struct {
}
func (*awsRestjson1_serializeOpDeleteDashboard) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteDashboard) 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.(*DeleteDashboardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards/{dashboardId}")
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_serializeOpHttpBindingsDeleteDashboardInput(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_serializeOpHttpBindingsDeleteDashboardInput(v *DeleteDashboardInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
if v.DashboardId == nil || len(*v.DashboardId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member dashboardId must not be empty")}
}
if v.DashboardId != nil {
if err := encoder.SetURI("dashboardId").String(*v.DashboardId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteDataset struct {
}
func (*awsRestjson1_serializeOpDeleteDataset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*DeleteDatasetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}")
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_serializeOpHttpBindingsDeleteDatasetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteDatasetInput(v *DeleteDatasetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteGateway struct {
}
func (*awsRestjson1_serializeOpDeleteGateway) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteGateway) 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.(*DeleteGatewayInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}")
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_serializeOpHttpBindingsDeleteGatewayInput(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_serializeOpHttpBindingsDeleteGatewayInput(v *DeleteGatewayInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeletePortal struct {
}
func (*awsRestjson1_serializeOpDeletePortal) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeletePortal) 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.(*DeletePortalInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals/{portalId}")
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_serializeOpHttpBindingsDeletePortalInput(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_serializeOpHttpBindingsDeletePortalInput(v *DeletePortalInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
if v.PortalId == nil || len(*v.PortalId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member portalId must not be empty")}
}
if v.PortalId != nil {
if err := encoder.SetURI("portalId").String(*v.PortalId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteProject struct {
}
func (*awsRestjson1_serializeOpDeleteProject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*DeleteProjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}")
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_serializeOpHttpBindingsDeleteProjectInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(v *DeleteProjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ClientToken != nil {
encoder.SetQuery("clientToken").String(*v.ClientToken)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteTimeSeries struct {
}
func (*awsRestjson1_serializeOpDeleteTimeSeries) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteTimeSeries) 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.(*DeleteTimeSeriesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries/delete")
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_serializeOpHttpBindingsDeleteTimeSeriesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDeleteTimeSeriesInput(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_serializeOpHttpBindingsDeleteTimeSeriesInput(v *DeleteTimeSeriesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Alias != nil {
encoder.SetQuery("alias").String(*v.Alias)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteTimeSeriesInput(v *DeleteTimeSeriesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpDescribeAccessPolicy struct {
}
func (*awsRestjson1_serializeOpDescribeAccessPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAccessPolicy) 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.(*DescribeAccessPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies/{accessPolicyId}")
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_serializeOpHttpBindingsDescribeAccessPolicyInput(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_serializeOpHttpBindingsDescribeAccessPolicyInput(v *DescribeAccessPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccessPolicyId == nil || len(*v.AccessPolicyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member accessPolicyId must not be empty")}
}
if v.AccessPolicyId != nil {
if err := encoder.SetURI("accessPolicyId").String(*v.AccessPolicyId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeAction struct {
}
func (*awsRestjson1_serializeOpDescribeAction) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAction) 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.(*DescribeActionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/actions/{actionId}")
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_serializeOpHttpBindingsDescribeActionInput(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_serializeOpHttpBindingsDescribeActionInput(v *DescribeActionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ActionId == nil || len(*v.ActionId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member actionId must not be empty")}
}
if v.ActionId != nil {
if err := encoder.SetURI("actionId").String(*v.ActionId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeAsset struct {
}
func (*awsRestjson1_serializeOpDescribeAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*DescribeAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}")
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_serializeOpHttpBindingsDescribeAssetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeAssetInput(v *DescribeAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.ExcludeProperties {
encoder.SetQuery("excludeProperties").Boolean(v.ExcludeProperties)
}
return nil
}
type awsRestjson1_serializeOpDescribeAssetCompositeModel struct {
}
func (*awsRestjson1_serializeOpDescribeAssetCompositeModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAssetCompositeModel) 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.(*DescribeAssetCompositeModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/composite-models/{assetCompositeModelId}")
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_serializeOpHttpBindingsDescribeAssetCompositeModelInput(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_serializeOpHttpBindingsDescribeAssetCompositeModelInput(v *DescribeAssetCompositeModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetCompositeModelId == nil || len(*v.AssetCompositeModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetCompositeModelId must not be empty")}
}
if v.AssetCompositeModelId != nil {
if err := encoder.SetURI("assetCompositeModelId").String(*v.AssetCompositeModelId); err != nil {
return err
}
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeAssetModel struct {
}
func (*awsRestjson1_serializeOpDescribeAssetModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAssetModel) 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.(*DescribeAssetModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}")
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_serializeOpHttpBindingsDescribeAssetModelInput(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_serializeOpHttpBindingsDescribeAssetModelInput(v *DescribeAssetModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.AssetModelVersion != nil {
encoder.SetQuery("assetModelVersion").String(*v.AssetModelVersion)
}
if v.ExcludeProperties {
encoder.SetQuery("excludeProperties").Boolean(v.ExcludeProperties)
}
return nil
}
type awsRestjson1_serializeOpDescribeAssetModelCompositeModel struct {
}
func (*awsRestjson1_serializeOpDescribeAssetModelCompositeModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAssetModelCompositeModel) 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.(*DescribeAssetModelCompositeModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models/{assetModelCompositeModelId}")
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_serializeOpHttpBindingsDescribeAssetModelCompositeModelInput(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_serializeOpHttpBindingsDescribeAssetModelCompositeModelInput(v *DescribeAssetModelCompositeModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelCompositeModelId == nil || len(*v.AssetModelCompositeModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelCompositeModelId must not be empty")}
}
if v.AssetModelCompositeModelId != nil {
if err := encoder.SetURI("assetModelCompositeModelId").String(*v.AssetModelCompositeModelId); err != nil {
return err
}
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.AssetModelVersion != nil {
encoder.SetQuery("assetModelVersion").String(*v.AssetModelVersion)
}
return nil
}
type awsRestjson1_serializeOpDescribeAssetProperty struct {
}
func (*awsRestjson1_serializeOpDescribeAssetProperty) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeAssetProperty) 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.(*DescribeAssetPropertyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties/{propertyId}")
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_serializeOpHttpBindingsDescribeAssetPropertyInput(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_serializeOpHttpBindingsDescribeAssetPropertyInput(v *DescribeAssetPropertyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.PropertyId == nil || len(*v.PropertyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member propertyId must not be empty")}
}
if v.PropertyId != nil {
if err := encoder.SetURI("propertyId").String(*v.PropertyId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeBulkImportJob struct {
}
func (*awsRestjson1_serializeOpDescribeBulkImportJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeBulkImportJob) 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.(*DescribeBulkImportJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobs/{jobId}")
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_serializeOpHttpBindingsDescribeBulkImportJobInput(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_serializeOpHttpBindingsDescribeBulkImportJobInput(v *DescribeBulkImportJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("jobId").String(*v.JobId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeDashboard struct {
}
func (*awsRestjson1_serializeOpDescribeDashboard) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeDashboard) 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.(*DescribeDashboardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards/{dashboardId}")
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_serializeOpHttpBindingsDescribeDashboardInput(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_serializeOpHttpBindingsDescribeDashboardInput(v *DescribeDashboardInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DashboardId == nil || len(*v.DashboardId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member dashboardId must not be empty")}
}
if v.DashboardId != nil {
if err := encoder.SetURI("dashboardId").String(*v.DashboardId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeDataset struct {
}
func (*awsRestjson1_serializeOpDescribeDataset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*DescribeDatasetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}")
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_serializeOpHttpBindingsDescribeDatasetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeDatasetInput(v *DescribeDatasetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeDefaultEncryptionConfiguration struct {
}
func (*awsRestjson1_serializeOpDescribeDefaultEncryptionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeDefaultEncryptionConfiguration) 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.(*DescribeDefaultEncryptionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/configuration/account/encryption")
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_serializeOpHttpBindingsDescribeDefaultEncryptionConfigurationInput(v *DescribeDefaultEncryptionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDescribeGateway struct {
}
func (*awsRestjson1_serializeOpDescribeGateway) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeGateway) 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.(*DescribeGatewayInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}")
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_serializeOpHttpBindingsDescribeGatewayInput(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_serializeOpHttpBindingsDescribeGatewayInput(v *DescribeGatewayInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration struct {
}
func (*awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration) 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.(*DescribeGatewayCapabilityConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}/capability/{capabilityNamespace}")
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_serializeOpHttpBindingsDescribeGatewayCapabilityConfigurationInput(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_serializeOpHttpBindingsDescribeGatewayCapabilityConfigurationInput(v *DescribeGatewayCapabilityConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CapabilityNamespace == nil || len(*v.CapabilityNamespace) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member capabilityNamespace must not be empty")}
}
if v.CapabilityNamespace != nil {
if err := encoder.SetURI("capabilityNamespace").String(*v.CapabilityNamespace); err != nil {
return err
}
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeLoggingOptions struct {
}
func (*awsRestjson1_serializeOpDescribeLoggingOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeLoggingOptions) 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.(*DescribeLoggingOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/logging")
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_serializeOpHttpBindingsDescribeLoggingOptionsInput(v *DescribeLoggingOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDescribePortal struct {
}
func (*awsRestjson1_serializeOpDescribePortal) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribePortal) 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.(*DescribePortalInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals/{portalId}")
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_serializeOpHttpBindingsDescribePortalInput(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_serializeOpHttpBindingsDescribePortalInput(v *DescribePortalInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PortalId == nil || len(*v.PortalId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member portalId must not be empty")}
}
if v.PortalId != nil {
if err := encoder.SetURI("portalId").String(*v.PortalId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeProject struct {
}
func (*awsRestjson1_serializeOpDescribeProject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*DescribeProjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}")
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_serializeOpHttpBindingsDescribeProjectInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDescribeProjectInput(v *DescribeProjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDescribeStorageConfiguration struct {
}
func (*awsRestjson1_serializeOpDescribeStorageConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeStorageConfiguration) 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.(*DescribeStorageConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/configuration/account/storage")
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_serializeOpHttpBindingsDescribeStorageConfigurationInput(v *DescribeStorageConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDescribeTimeSeries struct {
}
func (*awsRestjson1_serializeOpDescribeTimeSeries) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDescribeTimeSeries) 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.(*DescribeTimeSeriesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries/describe")
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_serializeOpHttpBindingsDescribeTimeSeriesInput(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_serializeOpHttpBindingsDescribeTimeSeriesInput(v *DescribeTimeSeriesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Alias != nil {
encoder.SetQuery("alias").String(*v.Alias)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
type awsRestjson1_serializeOpDisassociateAssets struct {
}
func (*awsRestjson1_serializeOpDisassociateAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDisassociateAssets) 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.(*DisassociateAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/disassociate")
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_serializeOpHttpBindingsDisassociateAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDisassociateAssetsInput(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_serializeOpHttpBindingsDisassociateAssetsInput(v *DisassociateAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentDisassociateAssetsInput(v *DisassociateAssetsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChildAssetId != nil {
ok := object.Key("childAssetId")
ok.String(*v.ChildAssetId)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.HierarchyId != nil {
ok := object.Key("hierarchyId")
ok.String(*v.HierarchyId)
}
return nil
}
type awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty struct {
}
func (*awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDisassociateTimeSeriesFromAssetProperty) 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.(*DisassociateTimeSeriesFromAssetPropertyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries/disassociate")
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_serializeOpHttpBindingsDisassociateTimeSeriesFromAssetPropertyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDisassociateTimeSeriesFromAssetPropertyInput(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_serializeOpHttpBindingsDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeSeriesFromAssetPropertyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Alias != nil {
encoder.SetQuery("alias").String(*v.Alias)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
func awsRestjson1_serializeOpDocumentDisassociateTimeSeriesFromAssetPropertyInput(v *DisassociateTimeSeriesFromAssetPropertyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpExecuteAction struct {
}
func (*awsRestjson1_serializeOpExecuteAction) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpExecuteAction) 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.(*ExecuteActionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/actions")
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_serializeOpDocumentExecuteActionInput(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_serializeOpHttpBindingsExecuteActionInput(v *ExecuteActionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentExecuteActionInput(v *ExecuteActionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ActionDefinitionId != nil {
ok := object.Key("actionDefinitionId")
ok.String(*v.ActionDefinitionId)
}
if v.ActionPayload != nil {
ok := object.Key("actionPayload")
if err := awsRestjson1_serializeDocumentActionPayload(v.ActionPayload, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.TargetResource != nil {
ok := object.Key("targetResource")
if err := awsRestjson1_serializeDocumentTargetResource(v.TargetResource, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpExecuteQuery struct {
}
func (*awsRestjson1_serializeOpExecuteQuery) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpExecuteQuery) 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.(*ExecuteQueryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/queries/execution")
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_serializeOpDocumentExecuteQueryInput(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_serializeOpHttpBindingsExecuteQueryInput(v *ExecuteQueryInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentExecuteQueryInput(v *ExecuteQueryInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.QueryStatement != nil {
ok := object.Key("queryStatement")
ok.String(*v.QueryStatement)
}
return nil
}
type awsRestjson1_serializeOpGetAssetPropertyAggregates struct {
}
func (*awsRestjson1_serializeOpGetAssetPropertyAggregates) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAssetPropertyAggregates) 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.(*GetAssetPropertyAggregatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/aggregates")
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_serializeOpHttpBindingsGetAssetPropertyAggregatesInput(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_serializeOpHttpBindingsGetAssetPropertyAggregatesInput(v *GetAssetPropertyAggregatesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AggregateTypes != nil {
for i := range v.AggregateTypes {
encoder.AddQuery("aggregateTypes").String(string(v.AggregateTypes[i]))
}
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.EndDate != nil {
encoder.SetQuery("endDate").String(smithytime.FormatDateTime(*v.EndDate))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PropertyAlias != nil {
encoder.SetQuery("propertyAlias").String(*v.PropertyAlias)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
if v.Qualities != nil {
for i := range v.Qualities {
encoder.AddQuery("qualities").String(string(v.Qualities[i]))
}
}
if v.Resolution != nil {
encoder.SetQuery("resolution").String(*v.Resolution)
}
if v.StartDate != nil {
encoder.SetQuery("startDate").String(smithytime.FormatDateTime(*v.StartDate))
}
if len(v.TimeOrdering) > 0 {
encoder.SetQuery("timeOrdering").String(string(v.TimeOrdering))
}
return nil
}
type awsRestjson1_serializeOpGetAssetPropertyValue struct {
}
func (*awsRestjson1_serializeOpGetAssetPropertyValue) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAssetPropertyValue) 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.(*GetAssetPropertyValueInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/latest")
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_serializeOpHttpBindingsGetAssetPropertyValueInput(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_serializeOpHttpBindingsGetAssetPropertyValueInput(v *GetAssetPropertyValueInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.PropertyAlias != nil {
encoder.SetQuery("propertyAlias").String(*v.PropertyAlias)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
return nil
}
type awsRestjson1_serializeOpGetAssetPropertyValueHistory struct {
}
func (*awsRestjson1_serializeOpGetAssetPropertyValueHistory) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAssetPropertyValueHistory) 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.(*GetAssetPropertyValueHistoryInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/history")
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_serializeOpHttpBindingsGetAssetPropertyValueHistoryInput(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_serializeOpHttpBindingsGetAssetPropertyValueHistoryInput(v *GetAssetPropertyValueHistoryInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.EndDate != nil {
encoder.SetQuery("endDate").String(smithytime.FormatDateTime(*v.EndDate))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PropertyAlias != nil {
encoder.SetQuery("propertyAlias").String(*v.PropertyAlias)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
if v.Qualities != nil {
for i := range v.Qualities {
encoder.AddQuery("qualities").String(string(v.Qualities[i]))
}
}
if v.StartDate != nil {
encoder.SetQuery("startDate").String(smithytime.FormatDateTime(*v.StartDate))
}
if len(v.TimeOrdering) > 0 {
encoder.SetQuery("timeOrdering").String(string(v.TimeOrdering))
}
return nil
}
type awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues struct {
}
func (*awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues) 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.(*GetInterpolatedAssetPropertyValuesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/properties/interpolated")
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_serializeOpHttpBindingsGetInterpolatedAssetPropertyValuesInput(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_serializeOpHttpBindingsGetInterpolatedAssetPropertyValuesInput(v *GetInterpolatedAssetPropertyValuesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.EndTimeInSeconds != nil {
encoder.SetQuery("endTimeInSeconds").Long(*v.EndTimeInSeconds)
}
if v.EndTimeOffsetInNanos != nil {
encoder.SetQuery("endTimeOffsetInNanos").Integer(*v.EndTimeOffsetInNanos)
}
if v.IntervalInSeconds != nil {
encoder.SetQuery("intervalInSeconds").Long(*v.IntervalInSeconds)
}
if v.IntervalWindowInSeconds != nil {
encoder.SetQuery("intervalWindowInSeconds").Long(*v.IntervalWindowInSeconds)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PropertyAlias != nil {
encoder.SetQuery("propertyAlias").String(*v.PropertyAlias)
}
if v.PropertyId != nil {
encoder.SetQuery("propertyId").String(*v.PropertyId)
}
if len(v.Quality) > 0 {
encoder.SetQuery("quality").String(string(v.Quality))
}
if v.StartTimeInSeconds != nil {
encoder.SetQuery("startTimeInSeconds").Long(*v.StartTimeInSeconds)
}
if v.StartTimeOffsetInNanos != nil {
encoder.SetQuery("startTimeOffsetInNanos").Integer(*v.StartTimeOffsetInNanos)
}
if v.Type != nil {
encoder.SetQuery("type").String(*v.Type)
}
return nil
}
type awsRestjson1_serializeOpInvokeAssistant struct {
}
func (*awsRestjson1_serializeOpInvokeAssistant) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpInvokeAssistant) 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.(*InvokeAssistantInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assistant/invocation")
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_serializeOpDocumentInvokeAssistantInput(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_serializeOpHttpBindingsInvokeAssistantInput(v *InvokeAssistantInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentInvokeAssistantInput(v *InvokeAssistantInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConversationId != nil {
ok := object.Key("conversationId")
ok.String(*v.ConversationId)
}
if v.EnableTrace {
ok := object.Key("enableTrace")
ok.Boolean(v.EnableTrace)
}
if v.Message != nil {
ok := object.Key("message")
ok.String(*v.Message)
}
return nil
}
type awsRestjson1_serializeOpListAccessPolicies struct {
}
func (*awsRestjson1_serializeOpListAccessPolicies) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAccessPolicies) 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.(*ListAccessPoliciesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies")
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_serializeOpHttpBindingsListAccessPoliciesInput(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_serializeOpHttpBindingsListAccessPoliciesInput(v *ListAccessPoliciesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.IamArn != nil {
encoder.SetQuery("iamArn").String(*v.IamArn)
}
if v.IdentityId != nil {
encoder.SetQuery("identityId").String(*v.IdentityId)
}
if len(v.IdentityType) > 0 {
encoder.SetQuery("identityType").String(string(v.IdentityType))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.ResourceId != nil {
encoder.SetQuery("resourceId").String(*v.ResourceId)
}
if len(v.ResourceType) > 0 {
encoder.SetQuery("resourceType").String(string(v.ResourceType))
}
return nil
}
type awsRestjson1_serializeOpListActions struct {
}
func (*awsRestjson1_serializeOpListActions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListActions) 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.(*ListActionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/actions")
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_serializeOpHttpBindingsListActionsInput(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_serializeOpHttpBindingsListActionsInput(v *ListActionsInput, 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.TargetResourceId != nil {
encoder.SetQuery("targetResourceId").String(*v.TargetResourceId)
}
if len(v.TargetResourceType) > 0 {
encoder.SetQuery("targetResourceType").String(string(v.TargetResourceType))
}
return nil
}
type awsRestjson1_serializeOpListAssetModelCompositeModels struct {
}
func (*awsRestjson1_serializeOpListAssetModelCompositeModels) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssetModelCompositeModels) 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.(*ListAssetModelCompositeModelsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models")
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_serializeOpHttpBindingsListAssetModelCompositeModelsInput(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_serializeOpHttpBindingsListAssetModelCompositeModelsInput(v *ListAssetModelCompositeModelsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.AssetModelVersion != nil {
encoder.SetQuery("assetModelVersion").String(*v.AssetModelVersion)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAssetModelProperties struct {
}
func (*awsRestjson1_serializeOpListAssetModelProperties) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssetModelProperties) 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.(*ListAssetModelPropertiesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/properties")
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_serializeOpHttpBindingsListAssetModelPropertiesInput(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_serializeOpHttpBindingsListAssetModelPropertiesInput(v *ListAssetModelPropertiesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.AssetModelVersion != nil {
encoder.SetQuery("assetModelVersion").String(*v.AssetModelVersion)
}
if len(v.Filter) > 0 {
encoder.SetQuery("filter").String(string(v.Filter))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAssetModels struct {
}
func (*awsRestjson1_serializeOpListAssetModels) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssetModels) 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.(*ListAssetModelsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models")
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_serializeOpHttpBindingsListAssetModelsInput(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_serializeOpHttpBindingsListAssetModelsInput(v *ListAssetModelsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelTypes != nil {
for i := range v.AssetModelTypes {
encoder.AddQuery("assetModelTypes").String(string(v.AssetModelTypes[i]))
}
}
if v.AssetModelVersion != nil {
encoder.SetQuery("assetModelVersion").String(*v.AssetModelVersion)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAssetProperties struct {
}
func (*awsRestjson1_serializeOpListAssetProperties) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssetProperties) 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.(*ListAssetPropertiesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties")
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_serializeOpHttpBindingsListAssetPropertiesInput(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_serializeOpHttpBindingsListAssetPropertiesInput(v *ListAssetPropertiesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if len(v.Filter) > 0 {
encoder.SetQuery("filter").String(string(v.Filter))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAssetRelationships struct {
}
func (*awsRestjson1_serializeOpListAssetRelationships) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssetRelationships) 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.(*ListAssetRelationshipsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/assetRelationships")
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_serializeOpHttpBindingsListAssetRelationshipsInput(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_serializeOpHttpBindingsListAssetRelationshipsInput(v *ListAssetRelationshipsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if len(v.TraversalType) > 0 {
encoder.SetQuery("traversalType").String(string(v.TraversalType))
}
return nil
}
type awsRestjson1_serializeOpListAssets struct {
}
func (*awsRestjson1_serializeOpListAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*ListAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
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_serializeOpHttpBindingsListAssetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListAssetsInput(v *ListAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId != nil {
encoder.SetQuery("assetModelId").String(*v.AssetModelId)
}
if len(v.Filter) > 0 {
encoder.SetQuery("filter").String(string(v.Filter))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListAssociatedAssets struct {
}
func (*awsRestjson1_serializeOpListAssociatedAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAssociatedAssets) 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.(*ListAssociatedAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/hierarchies")
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_serializeOpHttpBindingsListAssociatedAssetsInput(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_serializeOpHttpBindingsListAssociatedAssetsInput(v *ListAssociatedAssetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.HierarchyId != nil {
encoder.SetQuery("hierarchyId").String(*v.HierarchyId)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if len(v.TraversalDirection) > 0 {
encoder.SetQuery("traversalDirection").String(string(v.TraversalDirection))
}
return nil
}
type awsRestjson1_serializeOpListBulkImportJobs struct {
}
func (*awsRestjson1_serializeOpListBulkImportJobs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListBulkImportJobs) 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.(*ListBulkImportJobsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/jobs")
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_serializeOpHttpBindingsListBulkImportJobsInput(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_serializeOpHttpBindingsListBulkImportJobsInput(v *ListBulkImportJobsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.Filter) > 0 {
encoder.SetQuery("filter").String(string(v.Filter))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListCompositionRelationships struct {
}
func (*awsRestjson1_serializeOpListCompositionRelationships) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListCompositionRelationships) 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.(*ListCompositionRelationshipsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composition-relationships")
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_serializeOpHttpBindingsListCompositionRelationshipsInput(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_serializeOpHttpBindingsListCompositionRelationshipsInput(v *ListCompositionRelationshipsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListDashboards struct {
}
func (*awsRestjson1_serializeOpListDashboards) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDashboards) 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.(*ListDashboardsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards")
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_serializeOpHttpBindingsListDashboardsInput(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_serializeOpHttpBindingsListDashboardsInput(v *ListDashboardsInput, 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.ProjectId != nil {
encoder.SetQuery("projectId").String(*v.ProjectId)
}
return nil
}
type awsRestjson1_serializeOpListDatasets struct {
}
func (*awsRestjson1_serializeOpListDatasets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDatasets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*ListDatasetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets")
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_serializeOpHttpBindingsListDatasetsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListDatasetsInput(v *ListDatasetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if len(v.SourceType) > 0 {
encoder.SetQuery("sourceType").String(string(v.SourceType))
}
return nil
}
type awsRestjson1_serializeOpListGateways struct {
}
func (*awsRestjson1_serializeOpListGateways) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListGateways) 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.(*ListGatewaysInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways")
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_serializeOpHttpBindingsListGatewaysInput(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_serializeOpHttpBindingsListGatewaysInput(v *ListGatewaysInput, 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_serializeOpListPortals struct {
}
func (*awsRestjson1_serializeOpListPortals) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListPortals) 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.(*ListPortalsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals")
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_serializeOpHttpBindingsListPortalsInput(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_serializeOpHttpBindingsListPortalsInput(v *ListPortalsInput, 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_serializeOpListProjectAssets struct {
}
func (*awsRestjson1_serializeOpListProjectAssets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListProjectAssets) 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.(*ListProjectAssetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}/assets")
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_serializeOpHttpBindingsListProjectAssetsInput(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_serializeOpHttpBindingsListProjectAssetsInput(v *ListProjectAssetsInput, 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.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListProjects struct {
}
func (*awsRestjson1_serializeOpListProjects) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListProjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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.(*ListProjectsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects")
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_serializeOpHttpBindingsListProjectsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
endTimer()
span.End()
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListProjectsInput(v *ListProjectsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.PortalId != nil {
encoder.SetQuery("portalId").String(*v.PortalId)
}
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")
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 {
encoder.SetQuery("resourceArn").String(*v.ResourceArn)
}
return nil
}
type awsRestjson1_serializeOpListTimeSeries struct {
}
func (*awsRestjson1_serializeOpListTimeSeries) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTimeSeries) 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.(*ListTimeSeriesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/timeseries")
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_serializeOpHttpBindingsListTimeSeriesInput(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_serializeOpHttpBindingsListTimeSeriesInput(v *ListTimeSeriesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AliasPrefix != nil {
encoder.SetQuery("aliasPrefix").String(*v.AliasPrefix)
}
if v.AssetId != nil {
encoder.SetQuery("assetId").String(*v.AssetId)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if len(v.TimeSeriesType) > 0 {
encoder.SetQuery("timeSeriesType").String(string(v.TimeSeriesType))
}
return nil
}
type awsRestjson1_serializeOpPutDefaultEncryptionConfiguration struct {
}
func (*awsRestjson1_serializeOpPutDefaultEncryptionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutDefaultEncryptionConfiguration) 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.(*PutDefaultEncryptionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/configuration/account/encryption")
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_serializeOpDocumentPutDefaultEncryptionConfigurationInput(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_serializeOpHttpBindingsPutDefaultEncryptionConfigurationInput(v *PutDefaultEncryptionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutDefaultEncryptionConfigurationInput(v *PutDefaultEncryptionConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.EncryptionType) > 0 {
ok := object.Key("encryptionType")
ok.String(string(v.EncryptionType))
}
if v.KmsKeyId != nil {
ok := object.Key("kmsKeyId")
ok.String(*v.KmsKeyId)
}
return nil
}
type awsRestjson1_serializeOpPutLoggingOptions struct {
}
func (*awsRestjson1_serializeOpPutLoggingOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutLoggingOptions) 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.(*PutLoggingOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/logging")
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}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutLoggingOptionsInput(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_serializeOpHttpBindingsPutLoggingOptionsInput(v *PutLoggingOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutLoggingOptionsInput(v *PutLoggingOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LoggingOptions != nil {
ok := object.Key("loggingOptions")
if err := awsRestjson1_serializeDocumentLoggingOptions(v.LoggingOptions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutStorageConfiguration struct {
}
func (*awsRestjson1_serializeOpPutStorageConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutStorageConfiguration) 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.(*PutStorageConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/configuration/account/storage")
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_serializeOpDocumentPutStorageConfigurationInput(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_serializeOpHttpBindingsPutStorageConfigurationInput(v *PutStorageConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutStorageConfigurationInput(v *PutStorageConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DisallowIngestNullNaN != nil {
ok := object.Key("disallowIngestNullNaN")
ok.Boolean(*v.DisallowIngestNullNaN)
}
if len(v.DisassociatedDataStorage) > 0 {
ok := object.Key("disassociatedDataStorage")
ok.String(string(v.DisassociatedDataStorage))
}
if v.MultiLayerStorage != nil {
ok := object.Key("multiLayerStorage")
if err := awsRestjson1_serializeDocumentMultiLayerStorage(v.MultiLayerStorage, ok); err != nil {
return err
}
}
if v.RetentionPeriod != nil {
ok := object.Key("retentionPeriod")
if err := awsRestjson1_serializeDocumentRetentionPeriod(v.RetentionPeriod, ok); err != nil {
return err
}
}
if len(v.StorageType) > 0 {
ok := object.Key("storageType")
ok.String(string(v.StorageType))
}
if len(v.WarmTier) > 0 {
ok := object.Key("warmTier")
ok.String(string(v.WarmTier))
}
if v.WarmTierRetentionPeriod != nil {
ok := object.Key("warmTierRetentionPeriod")
if err := awsRestjson1_serializeDocumentWarmTierRetentionPeriod(v.WarmTierRetentionPeriod, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
_, 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")
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 {
encoder.SetQuery("resourceArn").String(*v.ResourceArn)
}
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")
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 {
encoder.SetQuery("resourceArn").String(*v.ResourceArn)
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("tagKeys").String(v.TagKeys[i])
}
}
return nil
}
type awsRestjson1_serializeOpUpdateAccessPolicy struct {
}
func (*awsRestjson1_serializeOpUpdateAccessPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAccessPolicy) 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.(*UpdateAccessPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/access-policies/{accessPolicyId}")
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_serializeOpHttpBindingsUpdateAccessPolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAccessPolicyInput(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_serializeOpHttpBindingsUpdateAccessPolicyInput(v *UpdateAccessPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AccessPolicyId == nil || len(*v.AccessPolicyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member accessPolicyId must not be empty")}
}
if v.AccessPolicyId != nil {
if err := encoder.SetURI("accessPolicyId").String(*v.AccessPolicyId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAccessPolicyInput(v *UpdateAccessPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessPolicyIdentity != nil {
ok := object.Key("accessPolicyIdentity")
if err := awsRestjson1_serializeDocumentIdentity(v.AccessPolicyIdentity, ok); err != nil {
return err
}
}
if len(v.AccessPolicyPermission) > 0 {
ok := object.Key("accessPolicyPermission")
ok.String(string(v.AccessPolicyPermission))
}
if v.AccessPolicyResource != nil {
ok := object.Key("accessPolicyResource")
if err := awsRestjson1_serializeDocumentResource(v.AccessPolicyResource, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpUpdateAsset struct {
}
func (*awsRestjson1_serializeOpUpdateAsset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAsset) 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.(*UpdateAssetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}")
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_serializeOpHttpBindingsUpdateAssetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAssetInput(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_serializeOpHttpBindingsUpdateAssetInput(v *UpdateAssetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAssetInput(v *UpdateAssetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetDescription != nil {
ok := object.Key("assetDescription")
ok.String(*v.AssetDescription)
}
if v.AssetExternalId != nil {
ok := object.Key("assetExternalId")
ok.String(*v.AssetExternalId)
}
if v.AssetName != nil {
ok := object.Key("assetName")
ok.String(*v.AssetName)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpUpdateAssetModel struct {
}
func (*awsRestjson1_serializeOpUpdateAssetModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAssetModel) 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.(*UpdateAssetModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}")
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_serializeOpHttpBindingsUpdateAssetModelInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAssetModelInput(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_serializeOpHttpBindingsUpdateAssetModelInput(v *UpdateAssetModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.IfMatch != nil {
locationName := "If-Match"
encoder.SetHeader(locationName).String(*v.IfMatch)
}
if v.IfNoneMatch != nil {
locationName := "If-None-Match"
encoder.SetHeader(locationName).String(*v.IfNoneMatch)
}
if len(v.MatchForVersionType) > 0 {
locationName := "Match-For-Version-Type"
encoder.SetHeader(locationName).String(string(v.MatchForVersionType))
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAssetModelInput(v *UpdateAssetModelInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetModelCompositeModels != nil {
ok := object.Key("assetModelCompositeModels")
if err := awsRestjson1_serializeDocumentAssetModelCompositeModels(v.AssetModelCompositeModels, ok); err != nil {
return err
}
}
if v.AssetModelDescription != nil {
ok := object.Key("assetModelDescription")
ok.String(*v.AssetModelDescription)
}
if v.AssetModelExternalId != nil {
ok := object.Key("assetModelExternalId")
ok.String(*v.AssetModelExternalId)
}
if v.AssetModelHierarchies != nil {
ok := object.Key("assetModelHierarchies")
if err := awsRestjson1_serializeDocumentAssetModelHierarchies(v.AssetModelHierarchies, ok); err != nil {
return err
}
}
if v.AssetModelName != nil {
ok := object.Key("assetModelName")
ok.String(*v.AssetModelName)
}
if v.AssetModelProperties != nil {
ok := object.Key("assetModelProperties")
if err := awsRestjson1_serializeDocumentAssetModelProperties(v.AssetModelProperties, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpUpdateAssetModelCompositeModel struct {
}
func (*awsRestjson1_serializeOpUpdateAssetModelCompositeModel) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAssetModelCompositeModel) 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.(*UpdateAssetModelCompositeModelInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}/composite-models/{assetModelCompositeModelId}")
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_serializeOpHttpBindingsUpdateAssetModelCompositeModelInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAssetModelCompositeModelInput(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_serializeOpHttpBindingsUpdateAssetModelCompositeModelInput(v *UpdateAssetModelCompositeModelInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetModelCompositeModelId == nil || len(*v.AssetModelCompositeModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelCompositeModelId must not be empty")}
}
if v.AssetModelCompositeModelId != nil {
if err := encoder.SetURI("assetModelCompositeModelId").String(*v.AssetModelCompositeModelId); err != nil {
return err
}
}
if v.AssetModelId == nil || len(*v.AssetModelId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")}
}
if v.AssetModelId != nil {
if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil {
return err
}
}
if v.IfMatch != nil {
locationName := "If-Match"
encoder.SetHeader(locationName).String(*v.IfMatch)
}
if v.IfNoneMatch != nil {
locationName := "If-None-Match"
encoder.SetHeader(locationName).String(*v.IfNoneMatch)
}
if len(v.MatchForVersionType) > 0 {
locationName := "Match-For-Version-Type"
encoder.SetHeader(locationName).String(string(v.MatchForVersionType))
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAssetModelCompositeModelInput(v *UpdateAssetModelCompositeModelInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetModelCompositeModelDescription != nil {
ok := object.Key("assetModelCompositeModelDescription")
ok.String(*v.AssetModelCompositeModelDescription)
}
if v.AssetModelCompositeModelExternalId != nil {
ok := object.Key("assetModelCompositeModelExternalId")
ok.String(*v.AssetModelCompositeModelExternalId)
}
if v.AssetModelCompositeModelName != nil {
ok := object.Key("assetModelCompositeModelName")
ok.String(*v.AssetModelCompositeModelName)
}
if v.AssetModelCompositeModelProperties != nil {
ok := object.Key("assetModelCompositeModelProperties")
if err := awsRestjson1_serializeDocumentAssetModelProperties(v.AssetModelCompositeModelProperties, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
return nil
}
type awsRestjson1_serializeOpUpdateAssetProperty struct {
}
func (*awsRestjson1_serializeOpUpdateAssetProperty) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAssetProperty) 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.(*UpdateAssetPropertyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties/{propertyId}")
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_serializeOpHttpBindingsUpdateAssetPropertyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAssetPropertyInput(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_serializeOpHttpBindingsUpdateAssetPropertyInput(v *UpdateAssetPropertyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.AssetId == nil || len(*v.AssetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")}
}
if v.AssetId != nil {
if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil {
return err
}
}
if v.PropertyId == nil || len(*v.PropertyId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member propertyId must not be empty")}
}
if v.PropertyId != nil {
if err := encoder.SetURI("propertyId").String(*v.PropertyId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAssetPropertyInput(v *UpdateAssetPropertyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if len(v.PropertyNotificationState) > 0 {
ok := object.Key("propertyNotificationState")
ok.String(string(v.PropertyNotificationState))
}
if v.PropertyUnit != nil {
ok := object.Key("propertyUnit")
ok.String(*v.PropertyUnit)
}
return nil
}
type awsRestjson1_serializeOpUpdateDashboard struct {
}
func (*awsRestjson1_serializeOpUpdateDashboard) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateDashboard) 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.(*UpdateDashboardInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/dashboards/{dashboardId}")
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_serializeOpHttpBindingsUpdateDashboardInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateDashboardInput(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_serializeOpHttpBindingsUpdateDashboardInput(v *UpdateDashboardInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DashboardId == nil || len(*v.DashboardId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member dashboardId must not be empty")}
}
if v.DashboardId != nil {
if err := encoder.SetURI("dashboardId").String(*v.DashboardId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateDashboardInput(v *UpdateDashboardInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.DashboardDefinition != nil {
ok := object.Key("dashboardDefinition")
ok.String(*v.DashboardDefinition)
}
if v.DashboardDescription != nil {
ok := object.Key("dashboardDescription")
ok.String(*v.DashboardDescription)
}
if v.DashboardName != nil {
ok := object.Key("dashboardName")
ok.String(*v.DashboardName)
}
return nil
}
type awsRestjson1_serializeOpUpdateDataset struct {
}
func (*awsRestjson1_serializeOpUpdateDataset) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateDataset) 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.(*UpdateDatasetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/datasets/{datasetId}")
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_serializeOpHttpBindingsUpdateDatasetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateDatasetInput(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_serializeOpHttpBindingsUpdateDatasetInput(v *UpdateDatasetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.DatasetId == nil || len(*v.DatasetId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member datasetId must not be empty")}
}
if v.DatasetId != nil {
if err := encoder.SetURI("datasetId").String(*v.DatasetId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateDatasetInput(v *UpdateDatasetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.DatasetDescription != nil {
ok := object.Key("datasetDescription")
ok.String(*v.DatasetDescription)
}
if v.DatasetName != nil {
ok := object.Key("datasetName")
ok.String(*v.DatasetName)
}
if v.DatasetSource != nil {
ok := object.Key("datasetSource")
if err := awsRestjson1_serializeDocumentDatasetSource(v.DatasetSource, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateGateway struct {
}
func (*awsRestjson1_serializeOpUpdateGateway) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateGateway) 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.(*UpdateGatewayInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}")
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_serializeOpHttpBindingsUpdateGatewayInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateGatewayInput(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_serializeOpHttpBindingsUpdateGatewayInput(v *UpdateGatewayInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateGatewayInput(v *UpdateGatewayInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GatewayName != nil {
ok := object.Key("gatewayName")
ok.String(*v.GatewayName)
}
return nil
}
type awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration struct {
}
func (*awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration) 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.(*UpdateGatewayCapabilityConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}/capability")
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_serializeOpHttpBindingsUpdateGatewayCapabilityConfigurationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateGatewayCapabilityConfigurationInput(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_serializeOpHttpBindingsUpdateGatewayCapabilityConfigurationInput(v *UpdateGatewayCapabilityConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.GatewayId == nil || len(*v.GatewayId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")}
}
if v.GatewayId != nil {
if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateGatewayCapabilityConfigurationInput(v *UpdateGatewayCapabilityConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CapabilityConfiguration != nil {
ok := object.Key("capabilityConfiguration")
ok.String(*v.CapabilityConfiguration)
}
if v.CapabilityNamespace != nil {
ok := object.Key("capabilityNamespace")
ok.String(*v.CapabilityNamespace)
}
return nil
}
type awsRestjson1_serializeOpUpdatePortal struct {
}
func (*awsRestjson1_serializeOpUpdatePortal) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdatePortal) 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.(*UpdatePortalInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/portals/{portalId}")
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_serializeOpHttpBindingsUpdatePortalInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdatePortalInput(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_serializeOpHttpBindingsUpdatePortalInput(v *UpdatePortalInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PortalId == nil || len(*v.PortalId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member portalId must not be empty")}
}
if v.PortalId != nil {
if err := encoder.SetURI("portalId").String(*v.PortalId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdatePortalInput(v *UpdatePortalInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Alarms != nil {
ok := object.Key("alarms")
if err := awsRestjson1_serializeDocumentAlarms(v.Alarms, ok); err != nil {
return err
}
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.NotificationSenderEmail != nil {
ok := object.Key("notificationSenderEmail")
ok.String(*v.NotificationSenderEmail)
}
if v.PortalContactEmail != nil {
ok := object.Key("portalContactEmail")
ok.String(*v.PortalContactEmail)
}
if v.PortalDescription != nil {
ok := object.Key("portalDescription")
ok.String(*v.PortalDescription)
}
if v.PortalLogoImage != nil {
ok := object.Key("portalLogoImage")
if err := awsRestjson1_serializeDocumentImage(v.PortalLogoImage, ok); err != nil {
return err
}
}
if v.PortalName != nil {
ok := object.Key("portalName")
ok.String(*v.PortalName)
}
if len(v.PortalType) > 0 {
ok := object.Key("portalType")
ok.String(string(v.PortalType))
}
if v.PortalTypeConfiguration != nil {
ok := object.Key("portalTypeConfiguration")
if err := awsRestjson1_serializeDocumentPortalTypeConfiguration(v.PortalTypeConfiguration, ok); err != nil {
return err
}
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
return nil
}
type awsRestjson1_serializeOpUpdateProject struct {
}
func (*awsRestjson1_serializeOpUpdateProject) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateProject) 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.(*UpdateProjectInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}")
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_serializeOpHttpBindingsUpdateProjectInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateProjectInput(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_serializeOpHttpBindingsUpdateProjectInput(v *UpdateProjectInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ProjectId == nil || len(*v.ProjectId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")}
}
if v.ProjectId != nil {
if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateProjectInput(v *UpdateProjectInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.ProjectDescription != nil {
ok := object.Key("projectDescription")
ok.String(*v.ProjectDescription)
}
if v.ProjectName != nil {
ok := object.Key("projectName")
ok.String(*v.ProjectName)
}
return nil
}
func awsRestjson1_serializeDocumentActionPayload(v *types.ActionPayload, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.StringValue != nil {
ok := object.Key("stringValue")
ok.String(*v.StringValue)
}
return nil
}
func awsRestjson1_serializeDocumentAggregateTypes(v []types.AggregateType, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentAlarms(v *types.Alarms, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AlarmRoleArn != nil {
ok := object.Key("alarmRoleArn")
ok.String(*v.AlarmRoleArn)
}
if v.NotificationLambdaArn != nil {
ok := object.Key("notificationLambdaArn")
ok.String(*v.NotificationLambdaArn)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelCompositeModel(v *types.AssetModelCompositeModel, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.ExternalId != nil {
ok := object.Key("externalId")
ok.String(*v.ExternalId)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Properties != nil {
ok := object.Key("properties")
if err := awsRestjson1_serializeDocumentAssetModelProperties(v.Properties, ok); err != nil {
return err
}
}
if v.Type != nil {
ok := object.Key("type")
ok.String(*v.Type)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelCompositeModelDefinition(v *types.AssetModelCompositeModelDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.ExternalId != nil {
ok := object.Key("externalId")
ok.String(*v.ExternalId)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Properties != nil {
ok := object.Key("properties")
if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v.Properties, ok); err != nil {
return err
}
}
if v.Type != nil {
ok := object.Key("type")
ok.String(*v.Type)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelCompositeModelDefinitions(v []types.AssetModelCompositeModelDefinition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelCompositeModelDefinition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelCompositeModels(v []types.AssetModelCompositeModel, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelCompositeModel(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelHierarchies(v []types.AssetModelHierarchy, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelHierarchy(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelHierarchy(v *types.AssetModelHierarchy, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChildAssetModelId != nil {
ok := object.Key("childAssetModelId")
ok.String(*v.ChildAssetModelId)
}
if v.ExternalId != nil {
ok := object.Key("externalId")
ok.String(*v.ExternalId)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelHierarchyDefinition(v *types.AssetModelHierarchyDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ChildAssetModelId != nil {
ok := object.Key("childAssetModelId")
ok.String(*v.ChildAssetModelId)
}
if v.ExternalId != nil {
ok := object.Key("externalId")
ok.String(*v.ExternalId)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelHierarchyDefinitions(v []types.AssetModelHierarchyDefinition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelHierarchyDefinition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelProperties(v []types.AssetModelProperty, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelProperty(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelProperty(v *types.AssetModelProperty, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DataType) > 0 {
ok := object.Key("dataType")
ok.String(string(v.DataType))
}
if v.DataTypeSpec != nil {
ok := object.Key("dataTypeSpec")
ok.String(*v.DataTypeSpec)
}
if v.ExternalId != nil {
ok := object.Key("externalId")
ok.String(*v.ExternalId)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Path != nil {
ok := object.Key("path")
if err := awsRestjson1_serializeDocumentAssetModelPropertyPath(v.Path, ok); err != nil {
return err
}
}
if v.Type != nil {
ok := object.Key("type")
if err := awsRestjson1_serializeDocumentPropertyType(v.Type, ok); err != nil {
return err
}
}
if v.Unit != nil {
ok := object.Key("unit")
ok.String(*v.Unit)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelPropertyDefinition(v *types.AssetModelPropertyDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DataType) > 0 {
ok := object.Key("dataType")
ok.String(string(v.DataType))
}
if v.DataTypeSpec != nil {
ok := object.Key("dataTypeSpec")
ok.String(*v.DataTypeSpec)
}
if v.ExternalId != nil {
ok := object.Key("externalId")
ok.String(*v.ExternalId)
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Type != nil {
ok := object.Key("type")
if err := awsRestjson1_serializeDocumentPropertyType(v.Type, ok); err != nil {
return err
}
}
if v.Unit != nil {
ok := object.Key("unit")
ok.String(*v.Unit)
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v []types.AssetModelPropertyDefinition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelPropertyPath(v []types.AssetModelPropertyPathSegment, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetModelPropertyPathSegment(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetModelPropertyPathSegment(v *types.AssetModelPropertyPathSegment, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
func awsRestjson1_serializeDocumentAssetPropertyValue(v *types.AssetPropertyValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Quality) > 0 {
ok := object.Key("quality")
ok.String(string(v.Quality))
}
if v.Timestamp != nil {
ok := object.Key("timestamp")
if err := awsRestjson1_serializeDocumentTimeInNanos(v.Timestamp, ok); err != nil {
return err
}
}
if v.Value != nil {
ok := object.Key("value")
if err := awsRestjson1_serializeDocumentVariant(v.Value, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAssetPropertyValues(v []types.AssetPropertyValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAssetPropertyValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAttribute(v *types.Attribute, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValue != nil {
ok := object.Key("defaultValue")
ok.String(*v.DefaultValue)
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyAggregatesEntries(v []types.BatchGetAssetPropertyAggregatesEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyAggregatesEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyAggregatesEntry(v *types.BatchGetAssetPropertyAggregatesEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AggregateTypes != nil {
ok := object.Key("aggregateTypes")
if err := awsRestjson1_serializeDocumentAggregateTypes(v.AggregateTypes, ok); err != nil {
return err
}
}
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
if v.EndDate != nil {
ok := object.Key("endDate")
ok.Double(smithytime.FormatEpochSeconds(*v.EndDate))
}
if v.EntryId != nil {
ok := object.Key("entryId")
ok.String(*v.EntryId)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
if v.Qualities != nil {
ok := object.Key("qualities")
if err := awsRestjson1_serializeDocumentQualities(v.Qualities, ok); err != nil {
return err
}
}
if v.Resolution != nil {
ok := object.Key("resolution")
ok.String(*v.Resolution)
}
if v.StartDate != nil {
ok := object.Key("startDate")
ok.Double(smithytime.FormatEpochSeconds(*v.StartDate))
}
if len(v.TimeOrdering) > 0 {
ok := object.Key("timeOrdering")
ok.String(string(v.TimeOrdering))
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyValueEntries(v []types.BatchGetAssetPropertyValueEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyValueEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyValueEntry(v *types.BatchGetAssetPropertyValueEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
if v.EntryId != nil {
ok := object.Key("entryId")
ok.String(*v.EntryId)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyValueHistoryEntries(v []types.BatchGetAssetPropertyValueHistoryEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBatchGetAssetPropertyValueHistoryEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetAssetPropertyValueHistoryEntry(v *types.BatchGetAssetPropertyValueHistoryEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
if v.EndDate != nil {
ok := object.Key("endDate")
ok.Double(smithytime.FormatEpochSeconds(*v.EndDate))
}
if v.EntryId != nil {
ok := object.Key("entryId")
ok.String(*v.EntryId)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
if v.Qualities != nil {
ok := object.Key("qualities")
if err := awsRestjson1_serializeDocumentQualities(v.Qualities, ok); err != nil {
return err
}
}
if v.StartDate != nil {
ok := object.Key("startDate")
ok.Double(smithytime.FormatEpochSeconds(*v.StartDate))
}
if len(v.TimeOrdering) > 0 {
ok := object.Key("timeOrdering")
ok.String(string(v.TimeOrdering))
}
return nil
}
func awsRestjson1_serializeDocumentColumnNames(v []types.ColumnName, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentCsv(v *types.Csv, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ColumnNames != nil {
ok := object.Key("columnNames")
if err := awsRestjson1_serializeDocumentColumnNames(v.ColumnNames, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCustomerManagedS3Storage(v *types.CustomerManagedS3Storage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
if v.S3ResourceArn != nil {
ok := object.Key("s3ResourceArn")
ok.String(*v.S3ResourceArn)
}
return nil
}
func awsRestjson1_serializeDocumentDatasetSource(v *types.DatasetSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SourceDetail != nil {
ok := object.Key("sourceDetail")
if err := awsRestjson1_serializeDocumentSourceDetail(v.SourceDetail, ok); err != nil {
return err
}
}
if len(v.SourceFormat) > 0 {
ok := object.Key("sourceFormat")
ok.String(string(v.SourceFormat))
}
if len(v.SourceType) > 0 {
ok := object.Key("sourceType")
ok.String(string(v.SourceType))
}
return nil
}
func awsRestjson1_serializeDocumentErrorReportLocation(v *types.ErrorReportLocation, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bucket != nil {
ok := object.Key("bucket")
ok.String(*v.Bucket)
}
if v.Prefix != nil {
ok := object.Key("prefix")
ok.String(*v.Prefix)
}
return nil
}
func awsRestjson1_serializeDocumentExpressionVariable(v *types.ExpressionVariable, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Value != nil {
ok := object.Key("value")
if err := awsRestjson1_serializeDocumentVariableValue(v.Value, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentExpressionVariables(v []types.ExpressionVariable, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentExpressionVariable(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFile(v *types.File, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Bucket != nil {
ok := object.Key("bucket")
ok.String(*v.Bucket)
}
if v.Key != nil {
ok := object.Key("key")
ok.String(*v.Key)
}
if v.VersionId != nil {
ok := object.Key("versionId")
ok.String(*v.VersionId)
}
return nil
}
func awsRestjson1_serializeDocumentFileFormat(v *types.FileFormat, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Csv != nil {
ok := object.Key("csv")
if err := awsRestjson1_serializeDocumentCsv(v.Csv, ok); err != nil {
return err
}
}
if v.Parquet != nil {
ok := object.Key("parquet")
if err := awsRestjson1_serializeDocumentParquet(v.Parquet, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFiles(v []types.File, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentFile(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentForwardingConfig(v *types.ForwardingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.State) > 0 {
ok := object.Key("state")
ok.String(string(v.State))
}
return nil
}
func awsRestjson1_serializeDocumentGatewayPlatform(v *types.GatewayPlatform, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Greengrass != nil {
ok := object.Key("greengrass")
if err := awsRestjson1_serializeDocumentGreengrass(v.Greengrass, ok); err != nil {
return err
}
}
if v.GreengrassV2 != nil {
ok := object.Key("greengrassV2")
if err := awsRestjson1_serializeDocumentGreengrassV2(v.GreengrassV2, ok); err != nil {
return err
}
}
if v.SiemensIE != nil {
ok := object.Key("siemensIE")
if err := awsRestjson1_serializeDocumentSiemensIE(v.SiemensIE, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentGreengrass(v *types.Greengrass, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.GroupArn != nil {
ok := object.Key("groupArn")
ok.String(*v.GroupArn)
}
return nil
}
func awsRestjson1_serializeDocumentGreengrassV2(v *types.GreengrassV2, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.CoreDeviceOperatingSystem) > 0 {
ok := object.Key("coreDeviceOperatingSystem")
ok.String(string(v.CoreDeviceOperatingSystem))
}
if v.CoreDeviceThingName != nil {
ok := object.Key("coreDeviceThingName")
ok.String(*v.CoreDeviceThingName)
}
return nil
}
func awsRestjson1_serializeDocumentGroupIdentity(v *types.GroupIdentity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentIAMRoleIdentity(v *types.IAMRoleIdentity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("arn")
ok.String(*v.Arn)
}
return nil
}
func awsRestjson1_serializeDocumentIAMUserIdentity(v *types.IAMUserIdentity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("arn")
ok.String(*v.Arn)
}
return nil
}
func awsRestjson1_serializeDocumentIdentity(v *types.Identity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Group != nil {
ok := object.Key("group")
if err := awsRestjson1_serializeDocumentGroupIdentity(v.Group, ok); err != nil {
return err
}
}
if v.IamRole != nil {
ok := object.Key("iamRole")
if err := awsRestjson1_serializeDocumentIAMRoleIdentity(v.IamRole, ok); err != nil {
return err
}
}
if v.IamUser != nil {
ok := object.Key("iamUser")
if err := awsRestjson1_serializeDocumentIAMUserIdentity(v.IamUser, ok); err != nil {
return err
}
}
if v.User != nil {
ok := object.Key("user")
if err := awsRestjson1_serializeDocumentUserIdentity(v.User, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIDs(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_serializeDocumentImage(v *types.Image, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.File != nil {
ok := object.Key("file")
if err := awsRestjson1_serializeDocumentImageFile(v.File, ok); err != nil {
return err
}
}
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentImageFile(v *types.ImageFile, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("data")
ok.Base64EncodeBytes(v.Data)
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentJobConfiguration(v *types.JobConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FileFormat != nil {
ok := object.Key("fileFormat")
if err := awsRestjson1_serializeDocumentFileFormat(v.FileFormat, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentKendraSourceDetail(v *types.KendraSourceDetail, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KnowledgeBaseArn != nil {
ok := object.Key("knowledgeBaseArn")
ok.String(*v.KnowledgeBaseArn)
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
return nil
}
func awsRestjson1_serializeDocumentLoggingOptions(v *types.LoggingOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Level) > 0 {
ok := object.Key("level")
ok.String(string(v.Level))
}
return nil
}
func awsRestjson1_serializeDocumentMeasurement(v *types.Measurement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProcessingConfig != nil {
ok := object.Key("processingConfig")
if err := awsRestjson1_serializeDocumentMeasurementProcessingConfig(v.ProcessingConfig, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMeasurementProcessingConfig(v *types.MeasurementProcessingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ForwardingConfig != nil {
ok := object.Key("forwardingConfig")
if err := awsRestjson1_serializeDocumentForwardingConfig(v.ForwardingConfig, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMetric(v *types.Metric, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Expression != nil {
ok := object.Key("expression")
ok.String(*v.Expression)
}
if v.ProcessingConfig != nil {
ok := object.Key("processingConfig")
if err := awsRestjson1_serializeDocumentMetricProcessingConfig(v.ProcessingConfig, ok); err != nil {
return err
}
}
if v.Variables != nil {
ok := object.Key("variables")
if err := awsRestjson1_serializeDocumentExpressionVariables(v.Variables, ok); err != nil {
return err
}
}
if v.Window != nil {
ok := object.Key("window")
if err := awsRestjson1_serializeDocumentMetricWindow(v.Window, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMetricProcessingConfig(v *types.MetricProcessingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ComputeLocation) > 0 {
ok := object.Key("computeLocation")
ok.String(string(v.ComputeLocation))
}
return nil
}
func awsRestjson1_serializeDocumentMetricWindow(v *types.MetricWindow, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tumbling != nil {
ok := object.Key("tumbling")
if err := awsRestjson1_serializeDocumentTumblingWindow(v.Tumbling, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMultiLayerStorage(v *types.MultiLayerStorage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomerManagedS3Storage != nil {
ok := object.Key("customerManagedS3Storage")
if err := awsRestjson1_serializeDocumentCustomerManagedS3Storage(v.CustomerManagedS3Storage, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentParquet(v *types.Parquet, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
func awsRestjson1_serializeDocumentPortalResource(v *types.PortalResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentPortalTools(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_serializeDocumentPortalTypeConfiguration(v map[string]types.PortalTypeEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
mapVar := v[key]
if err := awsRestjson1_serializeDocumentPortalTypeEntry(&mapVar, om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPortalTypeEntry(v *types.PortalTypeEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PortalTools != nil {
ok := object.Key("portalTools")
if err := awsRestjson1_serializeDocumentPortalTools(v.PortalTools, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentProjectResource(v *types.ProjectResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentPropertyType(v *types.PropertyType, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Attribute != nil {
ok := object.Key("attribute")
if err := awsRestjson1_serializeDocumentAttribute(v.Attribute, ok); err != nil {
return err
}
}
if v.Measurement != nil {
ok := object.Key("measurement")
if err := awsRestjson1_serializeDocumentMeasurement(v.Measurement, ok); err != nil {
return err
}
}
if v.Metric != nil {
ok := object.Key("metric")
if err := awsRestjson1_serializeDocumentMetric(v.Metric, ok); err != nil {
return err
}
}
if v.Transform != nil {
ok := object.Key("transform")
if err := awsRestjson1_serializeDocumentTransform(v.Transform, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPropertyValueNullValue(v *types.PropertyValueNullValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ValueType) > 0 {
ok := object.Key("valueType")
ok.String(string(v.ValueType))
}
return nil
}
func awsRestjson1_serializeDocumentPutAssetPropertyValueEntries(v []types.PutAssetPropertyValueEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentPutAssetPropertyValueEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPutAssetPropertyValueEntry(v *types.PutAssetPropertyValueEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
if v.EntryId != nil {
ok := object.Key("entryId")
ok.String(*v.EntryId)
}
if v.PropertyAlias != nil {
ok := object.Key("propertyAlias")
ok.String(*v.PropertyAlias)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
if v.PropertyValues != nil {
ok := object.Key("propertyValues")
if err := awsRestjson1_serializeDocumentAssetPropertyValues(v.PropertyValues, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentQualities(v []types.Quality, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentResource(v *types.Resource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Portal != nil {
ok := object.Key("portal")
if err := awsRestjson1_serializeDocumentPortalResource(v.Portal, ok); err != nil {
return err
}
}
if v.Project != nil {
ok := object.Key("project")
if err := awsRestjson1_serializeDocumentProjectResource(v.Project, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentRetentionPeriod(v *types.RetentionPeriod, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NumberOfDays != nil {
ok := object.Key("numberOfDays")
ok.Integer(*v.NumberOfDays)
}
if v.Unlimited != nil {
ok := object.Key("unlimited")
ok.Boolean(*v.Unlimited)
}
return nil
}
func awsRestjson1_serializeDocumentSiemensIE(v *types.SiemensIE, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IotCoreThingName != nil {
ok := object.Key("iotCoreThingName")
ok.String(*v.IotCoreThingName)
}
return nil
}
func awsRestjson1_serializeDocumentSourceDetail(v *types.SourceDetail, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Kendra != nil {
ok := object.Key("kendra")
if err := awsRestjson1_serializeDocumentKendraSourceDetail(v.Kendra, ok); 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_serializeDocumentTargetResource(v *types.TargetResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AssetId != nil {
ok := object.Key("assetId")
ok.String(*v.AssetId)
}
return nil
}
func awsRestjson1_serializeDocumentTimeInNanos(v *types.TimeInNanos, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.OffsetInNanos != nil {
ok := object.Key("offsetInNanos")
ok.Integer(*v.OffsetInNanos)
}
if v.TimeInSeconds != nil {
ok := object.Key("timeInSeconds")
ok.Long(*v.TimeInSeconds)
}
return nil
}
func awsRestjson1_serializeDocumentTransform(v *types.Transform, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Expression != nil {
ok := object.Key("expression")
ok.String(*v.Expression)
}
if v.ProcessingConfig != nil {
ok := object.Key("processingConfig")
if err := awsRestjson1_serializeDocumentTransformProcessingConfig(v.ProcessingConfig, ok); err != nil {
return err
}
}
if v.Variables != nil {
ok := object.Key("variables")
if err := awsRestjson1_serializeDocumentExpressionVariables(v.Variables, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTransformProcessingConfig(v *types.TransformProcessingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ComputeLocation) > 0 {
ok := object.Key("computeLocation")
ok.String(string(v.ComputeLocation))
}
if v.ForwardingConfig != nil {
ok := object.Key("forwardingConfig")
if err := awsRestjson1_serializeDocumentForwardingConfig(v.ForwardingConfig, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTumblingWindow(v *types.TumblingWindow, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Interval != nil {
ok := object.Key("interval")
ok.String(*v.Interval)
}
if v.Offset != nil {
ok := object.Key("offset")
ok.String(*v.Offset)
}
return nil
}
func awsRestjson1_serializeDocumentUserIdentity(v *types.UserIdentity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Id != nil {
ok := object.Key("id")
ok.String(*v.Id)
}
return nil
}
func awsRestjson1_serializeDocumentVariableValue(v *types.VariableValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.HierarchyId != nil {
ok := object.Key("hierarchyId")
ok.String(*v.HierarchyId)
}
if v.PropertyId != nil {
ok := object.Key("propertyId")
ok.String(*v.PropertyId)
}
if v.PropertyPath != nil {
ok := object.Key("propertyPath")
if err := awsRestjson1_serializeDocumentAssetModelPropertyPath(v.PropertyPath, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentVariant(v *types.Variant, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BooleanValue != nil {
ok := object.Key("booleanValue")
ok.Boolean(*v.BooleanValue)
}
if v.DoubleValue != nil {
ok := object.Key("doubleValue")
switch {
case math.IsNaN(*v.DoubleValue):
ok.String("NaN")
case math.IsInf(*v.DoubleValue, 1):
ok.String("Infinity")
case math.IsInf(*v.DoubleValue, -1):
ok.String("-Infinity")
default:
ok.Double(*v.DoubleValue)
}
}
if v.IntegerValue != nil {
ok := object.Key("integerValue")
ok.Integer(*v.IntegerValue)
}
if v.NullValue != nil {
ok := object.Key("nullValue")
if err := awsRestjson1_serializeDocumentPropertyValueNullValue(v.NullValue, ok); err != nil {
return err
}
}
if v.StringValue != nil {
ok := object.Key("stringValue")
ok.String(*v.StringValue)
}
return nil
}
func awsRestjson1_serializeDocumentWarmTierRetentionPeriod(v *types.WarmTierRetentionPeriod, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.NumberOfDays != nil {
ok := object.Key("numberOfDays")
ok.Integer(*v.NumberOfDays)
}
if v.Unlimited != nil {
ok := object.Key("unlimited")
ok.Boolean(*v.Unlimited)
}
return nil
}