// Code generated by smithy-go-codegen DO NOT EDIT. package chimesdkmediapipelines import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "io/ioutil" "strings" ) type awsRestjson1_deserializeOpCreateMediaCapturePipeline struct { } func (*awsRestjson1_deserializeOpCreateMediaCapturePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateMediaCapturePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateMediaCapturePipeline(response, &metadata) } output := &CreateMediaCapturePipelineOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateMediaCapturePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateMediaCapturePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateMediaCapturePipelineOutput(v **CreateMediaCapturePipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateMediaCapturePipelineOutput if *v == nil { sv = &CreateMediaCapturePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaCapturePipeline": if err := awsRestjson1_deserializeDocumentMediaCapturePipeline(&sv.MediaCapturePipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateMediaConcatenationPipeline struct { } func (*awsRestjson1_deserializeOpCreateMediaConcatenationPipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateMediaConcatenationPipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateMediaConcatenationPipeline(response, &metadata) } output := &CreateMediaConcatenationPipelineOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateMediaConcatenationPipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateMediaConcatenationPipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateMediaConcatenationPipelineOutput(v **CreateMediaConcatenationPipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateMediaConcatenationPipelineOutput if *v == nil { sv = &CreateMediaConcatenationPipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaConcatenationPipeline": if err := awsRestjson1_deserializeDocumentMediaConcatenationPipeline(&sv.MediaConcatenationPipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateMediaInsightsPipeline struct { } func (*awsRestjson1_deserializeOpCreateMediaInsightsPipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateMediaInsightsPipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateMediaInsightsPipeline(response, &metadata) } output := &CreateMediaInsightsPipelineOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateMediaInsightsPipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateMediaInsightsPipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateMediaInsightsPipelineOutput(v **CreateMediaInsightsPipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateMediaInsightsPipelineOutput if *v == nil { sv = &CreateMediaInsightsPipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaInsightsPipeline": if err := awsRestjson1_deserializeDocumentMediaInsightsPipeline(&sv.MediaInsightsPipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateMediaInsightsPipelineConfiguration struct { } func (*awsRestjson1_deserializeOpCreateMediaInsightsPipelineConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateMediaInsightsPipelineConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateMediaInsightsPipelineConfiguration(response, &metadata) } output := &CreateMediaInsightsPipelineConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateMediaInsightsPipelineConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateMediaInsightsPipelineConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateMediaInsightsPipelineConfigurationOutput(v **CreateMediaInsightsPipelineConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateMediaInsightsPipelineConfigurationOutput if *v == nil { sv = &CreateMediaInsightsPipelineConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaInsightsPipelineConfiguration": if err := awsRestjson1_deserializeDocumentMediaInsightsPipelineConfiguration(&sv.MediaInsightsPipelineConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateMediaLiveConnectorPipeline struct { } func (*awsRestjson1_deserializeOpCreateMediaLiveConnectorPipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateMediaLiveConnectorPipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorCreateMediaLiveConnectorPipeline(response, &metadata) } output := &CreateMediaLiveConnectorPipelineOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentCreateMediaLiveConnectorPipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateMediaLiveConnectorPipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateMediaLiveConnectorPipelineOutput(v **CreateMediaLiveConnectorPipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateMediaLiveConnectorPipelineOutput if *v == nil { sv = &CreateMediaLiveConnectorPipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaLiveConnectorPipeline": if err := awsRestjson1_deserializeDocumentMediaLiveConnectorPipeline(&sv.MediaLiveConnectorPipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteMediaCapturePipeline struct { } func (*awsRestjson1_deserializeOpDeleteMediaCapturePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteMediaCapturePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteMediaCapturePipeline(response, &metadata) } output := &DeleteMediaCapturePipelineOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteMediaCapturePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteMediaInsightsPipelineConfiguration struct { } func (*awsRestjson1_deserializeOpDeleteMediaInsightsPipelineConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteMediaInsightsPipelineConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteMediaInsightsPipelineConfiguration(response, &metadata) } output := &DeleteMediaInsightsPipelineConfigurationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteMediaInsightsPipelineConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteMediaPipeline struct { } func (*awsRestjson1_deserializeOpDeleteMediaPipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteMediaPipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorDeleteMediaPipeline(response, &metadata) } output := &DeleteMediaPipelineOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteMediaPipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpGetMediaCapturePipeline struct { } func (*awsRestjson1_deserializeOpGetMediaCapturePipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetMediaCapturePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorGetMediaCapturePipeline(response, &metadata) } output := &GetMediaCapturePipelineOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentGetMediaCapturePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetMediaCapturePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetMediaCapturePipelineOutput(v **GetMediaCapturePipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetMediaCapturePipelineOutput if *v == nil { sv = &GetMediaCapturePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaCapturePipeline": if err := awsRestjson1_deserializeDocumentMediaCapturePipeline(&sv.MediaCapturePipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetMediaInsightsPipelineConfiguration struct { } func (*awsRestjson1_deserializeOpGetMediaInsightsPipelineConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetMediaInsightsPipelineConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorGetMediaInsightsPipelineConfiguration(response, &metadata) } output := &GetMediaInsightsPipelineConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentGetMediaInsightsPipelineConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetMediaInsightsPipelineConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetMediaInsightsPipelineConfigurationOutput(v **GetMediaInsightsPipelineConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetMediaInsightsPipelineConfigurationOutput if *v == nil { sv = &GetMediaInsightsPipelineConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaInsightsPipelineConfiguration": if err := awsRestjson1_deserializeDocumentMediaInsightsPipelineConfiguration(&sv.MediaInsightsPipelineConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetMediaPipeline struct { } func (*awsRestjson1_deserializeOpGetMediaPipeline) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetMediaPipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorGetMediaPipeline(response, &metadata) } output := &GetMediaPipelineOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentGetMediaPipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorGetMediaPipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetMediaPipelineOutput(v **GetMediaPipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetMediaPipelineOutput if *v == nil { sv = &GetMediaPipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaPipeline": if err := awsRestjson1_deserializeDocumentMediaPipeline(&sv.MediaPipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListMediaCapturePipelines struct { } func (*awsRestjson1_deserializeOpListMediaCapturePipelines) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListMediaCapturePipelines) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListMediaCapturePipelines(response, &metadata) } output := &ListMediaCapturePipelinesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListMediaCapturePipelinesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListMediaCapturePipelines(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListMediaCapturePipelinesOutput(v **ListMediaCapturePipelinesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListMediaCapturePipelinesOutput if *v == nil { sv = &ListMediaCapturePipelinesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaCapturePipelines": if err := awsRestjson1_deserializeDocumentMediaCapturePipelineSummaryList(&sv.MediaCapturePipelines, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListMediaInsightsPipelineConfigurations struct { } func (*awsRestjson1_deserializeOpListMediaInsightsPipelineConfigurations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListMediaInsightsPipelineConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListMediaInsightsPipelineConfigurations(response, &metadata) } output := &ListMediaInsightsPipelineConfigurationsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListMediaInsightsPipelineConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListMediaInsightsPipelineConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListMediaInsightsPipelineConfigurationsOutput(v **ListMediaInsightsPipelineConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListMediaInsightsPipelineConfigurationsOutput if *v == nil { sv = &ListMediaInsightsPipelineConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaInsightsPipelineConfigurations": if err := awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationSummaryList(&sv.MediaInsightsPipelineConfigurations, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListMediaPipelines struct { } func (*awsRestjson1_deserializeOpListMediaPipelines) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListMediaPipelines) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListMediaPipelines(response, &metadata) } output := &ListMediaPipelinesOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListMediaPipelinesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListMediaPipelines(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListMediaPipelinesOutput(v **ListMediaPipelinesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListMediaPipelinesOutput if *v == nil { sv = &ListMediaPipelinesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaPipelines": if err := awsRestjson1_deserializeDocumentMediaPipelineList(&sv.MediaPipelines, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Tags": if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateMediaInsightsPipelineConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateMediaInsightsPipelineConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateMediaInsightsPipelineConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpdateMediaInsightsPipelineConfiguration(response, &metadata) } output := &UpdateMediaInsightsPipelineConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsRestjson1_deserializeOpDocumentUpdateMediaInsightsPipelineConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateMediaInsightsPipelineConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateMediaInsightsPipelineConfigurationOutput(v **UpdateMediaInsightsPipelineConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateMediaInsightsPipelineConfigurationOutput if *v == nil { sv = &UpdateMediaInsightsPipelineConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "MediaInsightsPipelineConfiguration": if err := awsRestjson1_deserializeDocumentMediaInsightsPipelineConfiguration(&sv.MediaInsightsPipelineConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateMediaInsightsPipelineStatus struct { } func (*awsRestjson1_deserializeOpUpdateMediaInsightsPipelineStatus) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateMediaInsightsPipelineStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUpdateMediaInsightsPipelineStatus(response, &metadata) } output := &UpdateMediaInsightsPipelineStatusOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } func awsRestjson1_deserializeOpErrorUpdateMediaInsightsPipelineStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceFailureException", errorCode): return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottledClientException", errorCode): return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) case strings.EqualFold("UnauthorizedClientException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BadRequestException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentConflictException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ForbiddenException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceLimitExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorServiceFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceFailureException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentServiceFailureException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceUnavailableException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentServiceUnavailableException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorThrottledClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottledClientException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentThrottledClientException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorUnauthorizedClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UnauthorizedClientException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentUnauthorizedClientException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentActiveSpeakerOnlyConfiguration(v **types.ActiveSpeakerOnlyConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ActiveSpeakerOnlyConfiguration if *v == nil { sv = &types.ActiveSpeakerOnlyConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ActiveSpeakerPosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ActiveSpeakerPosition to be of type string, got %T instead", value) } sv.ActiveSpeakerPosition = types.ActiveSpeakerPosition(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAmazonTranscribeCallAnalyticsProcessorConfiguration(v **types.AmazonTranscribeCallAnalyticsProcessorConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AmazonTranscribeCallAnalyticsProcessorConfiguration if *v == nil { sv = &types.AmazonTranscribeCallAnalyticsProcessorConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CallAnalyticsStreamCategories": if err := awsRestjson1_deserializeDocumentCategoryNameList(&sv.CallAnalyticsStreamCategories, value); err != nil { return err } case "ContentIdentificationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContentType to be of type string, got %T instead", value) } sv.ContentIdentificationType = types.ContentType(jtv) } case "ContentRedactionType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContentType to be of type string, got %T instead", value) } sv.ContentRedactionType = types.ContentType(jtv) } case "EnablePartialResultsStabilization": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnablePartialResultsStabilization = jtv } case "FilterPartialResults": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.FilterPartialResults = jtv } case "LanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CallAnalyticsLanguageCode to be of type string, got %T instead", value) } sv.LanguageCode = types.CallAnalyticsLanguageCode(jtv) } case "LanguageModelName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ModelName to be of type string, got %T instead", value) } sv.LanguageModelName = ptr.String(jtv) } case "PartialResultsStability": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PartialResultsStability to be of type string, got %T instead", value) } sv.PartialResultsStability = types.PartialResultsStability(jtv) } case "PiiEntityTypes": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PiiEntityTypes to be of type string, got %T instead", value) } sv.PiiEntityTypes = ptr.String(jtv) } case "PostCallAnalyticsSettings": if err := awsRestjson1_deserializeDocumentPostCallAnalyticsSettings(&sv.PostCallAnalyticsSettings, value); err != nil { return err } case "VocabularyFilterMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VocabularyFilterMethod to be of type string, got %T instead", value) } sv.VocabularyFilterMethod = types.VocabularyFilterMethod(jtv) } case "VocabularyFilterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VocabularyFilterName to be of type string, got %T instead", value) } sv.VocabularyFilterName = ptr.String(jtv) } case "VocabularyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VocabularyName to be of type string, got %T instead", value) } sv.VocabularyName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAmazonTranscribeProcessorConfiguration(v **types.AmazonTranscribeProcessorConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AmazonTranscribeProcessorConfiguration if *v == nil { sv = &types.AmazonTranscribeProcessorConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ContentIdentificationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContentType to be of type string, got %T instead", value) } sv.ContentIdentificationType = types.ContentType(jtv) } case "ContentRedactionType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContentType to be of type string, got %T instead", value) } sv.ContentRedactionType = types.ContentType(jtv) } case "EnablePartialResultsStabilization": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.EnablePartialResultsStabilization = jtv } case "FilterPartialResults": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.FilterPartialResults = jtv } case "IdentifyLanguage": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IdentifyLanguage = jtv } case "LanguageCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CallAnalyticsLanguageCode to be of type string, got %T instead", value) } sv.LanguageCode = types.CallAnalyticsLanguageCode(jtv) } case "LanguageModelName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ModelName to be of type string, got %T instead", value) } sv.LanguageModelName = ptr.String(jtv) } case "LanguageOptions": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LanguageOptions to be of type string, got %T instead", value) } sv.LanguageOptions = ptr.String(jtv) } case "PartialResultsStability": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PartialResultsStability to be of type string, got %T instead", value) } sv.PartialResultsStability = types.PartialResultsStability(jtv) } case "PiiEntityTypes": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PiiEntityTypes to be of type string, got %T instead", value) } sv.PiiEntityTypes = ptr.String(jtv) } case "PreferredLanguage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CallAnalyticsLanguageCode to be of type string, got %T instead", value) } sv.PreferredLanguage = types.CallAnalyticsLanguageCode(jtv) } case "ShowSpeakerLabel": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.ShowSpeakerLabel = jtv } case "VocabularyFilterMethod": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VocabularyFilterMethod to be of type string, got %T instead", value) } sv.VocabularyFilterMethod = types.VocabularyFilterMethod(jtv) } case "VocabularyFilterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VocabularyFilterName to be of type string, got %T instead", value) } sv.VocabularyFilterName = ptr.String(jtv) } case "VocabularyFilterNames": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VocabularyFilterNames to be of type string, got %T instead", value) } sv.VocabularyFilterNames = ptr.String(jtv) } case "VocabularyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VocabularyName to be of type string, got %T instead", value) } sv.VocabularyName = ptr.String(jtv) } case "VocabularyNames": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VocabularyNames to be of type string, got %T instead", value) } sv.VocabularyNames = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentArtifactsConcatenationConfiguration(v **types.ArtifactsConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ArtifactsConcatenationConfiguration if *v == nil { sv = &types.ArtifactsConcatenationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Audio": if err := awsRestjson1_deserializeDocumentAudioConcatenationConfiguration(&sv.Audio, value); err != nil { return err } case "CompositedVideo": if err := awsRestjson1_deserializeDocumentCompositedVideoConcatenationConfiguration(&sv.CompositedVideo, value); err != nil { return err } case "Content": if err := awsRestjson1_deserializeDocumentContentConcatenationConfiguration(&sv.Content, value); err != nil { return err } case "DataChannel": if err := awsRestjson1_deserializeDocumentDataChannelConcatenationConfiguration(&sv.DataChannel, value); err != nil { return err } case "MeetingEvents": if err := awsRestjson1_deserializeDocumentMeetingEventsConcatenationConfiguration(&sv.MeetingEvents, value); err != nil { return err } case "TranscriptionMessages": if err := awsRestjson1_deserializeDocumentTranscriptionMessagesConcatenationConfiguration(&sv.TranscriptionMessages, value); err != nil { return err } case "Video": if err := awsRestjson1_deserializeDocumentVideoConcatenationConfiguration(&sv.Video, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentArtifactsConfiguration(v **types.ArtifactsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ArtifactsConfiguration if *v == nil { sv = &types.ArtifactsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Audio": if err := awsRestjson1_deserializeDocumentAudioArtifactsConfiguration(&sv.Audio, value); err != nil { return err } case "CompositedVideo": if err := awsRestjson1_deserializeDocumentCompositedVideoArtifactsConfiguration(&sv.CompositedVideo, value); err != nil { return err } case "Content": if err := awsRestjson1_deserializeDocumentContentArtifactsConfiguration(&sv.Content, value); err != nil { return err } case "Video": if err := awsRestjson1_deserializeDocumentVideoArtifactsConfiguration(&sv.Video, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAttendeeIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentAudioArtifactsConfiguration(v **types.AudioArtifactsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AudioArtifactsConfiguration if *v == nil { sv = &types.AudioArtifactsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "MuxType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AudioMuxType to be of type string, got %T instead", value) } sv.MuxType = types.AudioMuxType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAudioConcatenationConfiguration(v **types.AudioConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AudioConcatenationConfiguration if *v == nil { sv = &types.AudioConcatenationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AudioArtifactsConcatenationState to be of type string, got %T instead", value) } sv.State = types.AudioArtifactsConcatenationState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.BadRequestException if *v == nil { sv = &types.BadRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = types.ErrorCode(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCategoryNameList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CategoryName to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentChannelDefinition(v **types.ChannelDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChannelDefinition if *v == nil { sv = &types.ChannelDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "ChannelId": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ChannelId to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ChannelId = int32(i64) } case "ParticipantRole": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ParticipantRole to be of type string, got %T instead", value) } sv.ParticipantRole = types.ParticipantRole(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChannelDefinitions(v *[]types.ChannelDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ChannelDefinition if *v == nil { cv = []types.ChannelDefinition{} } else { cv = *v } for _, value := range shape { var col types.ChannelDefinition destAddr := &col if err := awsRestjson1_deserializeDocumentChannelDefinition(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentChimeSdkMeetingConcatenationConfiguration(v **types.ChimeSdkMeetingConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChimeSdkMeetingConcatenationConfiguration if *v == nil { sv = &types.ChimeSdkMeetingConcatenationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ArtifactsConfiguration": if err := awsRestjson1_deserializeDocumentArtifactsConcatenationConfiguration(&sv.ArtifactsConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChimeSdkMeetingConfiguration(v **types.ChimeSdkMeetingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChimeSdkMeetingConfiguration if *v == nil { sv = &types.ChimeSdkMeetingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ArtifactsConfiguration": if err := awsRestjson1_deserializeDocumentArtifactsConfiguration(&sv.ArtifactsConfiguration, value); err != nil { return err } case "SourceConfiguration": if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentChimeSdkMeetingLiveConnectorConfiguration(v **types.ChimeSdkMeetingLiveConnectorConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ChimeSdkMeetingLiveConnectorConfiguration if *v == nil { sv = &types.ChimeSdkMeetingLiveConnectorConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CompositedVideo": if err := awsRestjson1_deserializeDocumentCompositedVideoArtifactsConfiguration(&sv.CompositedVideo, value); err != nil { return err } case "MuxType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LiveConnectorMuxType to be of type string, got %T instead", value) } sv.MuxType = types.LiveConnectorMuxType(jtv) } case "SourceConfiguration": if err := awsRestjson1_deserializeDocumentSourceConfiguration(&sv.SourceConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCompositedVideoArtifactsConfiguration(v **types.CompositedVideoArtifactsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CompositedVideoArtifactsConfiguration if *v == nil { sv = &types.CompositedVideoArtifactsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "GridViewConfiguration": if err := awsRestjson1_deserializeDocumentGridViewConfiguration(&sv.GridViewConfiguration, value); err != nil { return err } case "Layout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LayoutOption to be of type string, got %T instead", value) } sv.Layout = types.LayoutOption(jtv) } case "Resolution": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ResolutionOption to be of type string, got %T instead", value) } sv.Resolution = types.ResolutionOption(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCompositedVideoConcatenationConfiguration(v **types.CompositedVideoConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.CompositedVideoConcatenationConfiguration if *v == nil { sv = &types.CompositedVideoConcatenationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) } sv.State = types.ArtifactsConcatenationState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConcatenationSink(v **types.ConcatenationSink, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConcatenationSink if *v == nil { sv = &types.ConcatenationSink{} } else { sv = *v } for key, value := range shape { switch key { case "S3BucketSinkConfiguration": if err := awsRestjson1_deserializeDocumentS3BucketSinkConfiguration(&sv.S3BucketSinkConfiguration, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConcatenationSinkType to be of type string, got %T instead", value) } sv.Type = types.ConcatenationSinkType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConcatenationSinkList(v *[]types.ConcatenationSink, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ConcatenationSink if *v == nil { cv = []types.ConcatenationSink{} } else { cv = *v } for _, value := range shape { var col types.ConcatenationSink destAddr := &col if err := awsRestjson1_deserializeDocumentConcatenationSink(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentConcatenationSource(v **types.ConcatenationSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConcatenationSource if *v == nil { sv = &types.ConcatenationSource{} } else { sv = *v } for key, value := range shape { switch key { case "MediaCapturePipelineSourceConfiguration": if err := awsRestjson1_deserializeDocumentMediaCapturePipelineSourceConfiguration(&sv.MediaCapturePipelineSourceConfiguration, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConcatenationSourceType to be of type string, got %T instead", value) } sv.Type = types.ConcatenationSourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConcatenationSourceList(v *[]types.ConcatenationSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.ConcatenationSource if *v == nil { cv = []types.ConcatenationSource{} } else { cv = *v } for _, value := range shape { var col types.ConcatenationSource destAddr := &col if err := awsRestjson1_deserializeDocumentConcatenationSource(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = types.ErrorCode(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentContentArtifactsConfiguration(v **types.ContentArtifactsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ContentArtifactsConfiguration if *v == nil { sv = &types.ContentArtifactsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "MuxType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContentMuxType to be of type string, got %T instead", value) } sv.MuxType = types.ContentMuxType(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArtifactsState to be of type string, got %T instead", value) } sv.State = types.ArtifactsState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentContentConcatenationConfiguration(v **types.ContentConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ContentConcatenationConfiguration if *v == nil { sv = &types.ContentConcatenationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) } sv.State = types.ArtifactsConcatenationState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDataChannelConcatenationConfiguration(v **types.DataChannelConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.DataChannelConcatenationConfiguration if *v == nil { sv = &types.DataChannelConcatenationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) } sv.State = types.ArtifactsConcatenationState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentExternalUserIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExternalUserIdType to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ForbiddenException if *v == nil { sv = &types.ForbiddenException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = types.ErrorCode(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFragmentSelector(v **types.FragmentSelector, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.FragmentSelector if *v == nil { sv = &types.FragmentSelector{} } else { sv = *v } for key, value := range shape { switch key { case "FragmentSelectorType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FragmentSelectorType to be of type string, got %T instead", value) } sv.FragmentSelectorType = types.FragmentSelectorType(jtv) } case "TimestampRange": if err := awsRestjson1_deserializeDocumentTimestampRange(&sv.TimestampRange, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentGridViewConfiguration(v **types.GridViewConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.GridViewConfiguration if *v == nil { sv = &types.GridViewConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ActiveSpeakerOnlyConfiguration": if err := awsRestjson1_deserializeDocumentActiveSpeakerOnlyConfiguration(&sv.ActiveSpeakerOnlyConfiguration, value); err != nil { return err } case "CanvasOrientation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CanvasOrientation to be of type string, got %T instead", value) } sv.CanvasOrientation = types.CanvasOrientation(jtv) } case "ContentShareLayout": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContentShareLayoutOption to be of type string, got %T instead", value) } sv.ContentShareLayout = types.ContentShareLayoutOption(jtv) } case "HorizontalLayoutConfiguration": if err := awsRestjson1_deserializeDocumentHorizontalLayoutConfiguration(&sv.HorizontalLayoutConfiguration, value); err != nil { return err } case "PresenterOnlyConfiguration": if err := awsRestjson1_deserializeDocumentPresenterOnlyConfiguration(&sv.PresenterOnlyConfiguration, value); err != nil { return err } case "VerticalLayoutConfiguration": if err := awsRestjson1_deserializeDocumentVerticalLayoutConfiguration(&sv.VerticalLayoutConfiguration, value); err != nil { return err } case "VideoAttribute": if err := awsRestjson1_deserializeDocumentVideoAttribute(&sv.VideoAttribute, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentHorizontalLayoutConfiguration(v **types.HorizontalLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.HorizontalLayoutConfiguration if *v == nil { sv = &types.HorizontalLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "TileAspectRatio": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TileAspectRatio to be of type string, got %T instead", value) } sv.TileAspectRatio = ptr.String(jtv) } case "TileCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TileCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TileCount = ptr.Int32(int32(i64)) } case "TileOrder": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TileOrder to be of type string, got %T instead", value) } sv.TileOrder = types.TileOrder(jtv) } case "TilePosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HorizontalTilePosition to be of type string, got %T instead", value) } sv.TilePosition = types.HorizontalTilePosition(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentIssueDetectionConfiguration(v **types.IssueDetectionConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.IssueDetectionConfiguration if *v == nil { sv = &types.IssueDetectionConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "RuleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RuleName to be of type string, got %T instead", value) } sv.RuleName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKeywordMatchConfiguration(v **types.KeywordMatchConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.KeywordMatchConfiguration if *v == nil { sv = &types.KeywordMatchConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Keywords": if err := awsRestjson1_deserializeDocumentKeywordMatchWordList(&sv.Keywords, value); err != nil { return err } case "Negate": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Negate = jtv } case "RuleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RuleName to be of type string, got %T instead", value) } sv.RuleName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKeywordMatchWordList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Keyword to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentKinesisDataStreamSinkConfiguration(v **types.KinesisDataStreamSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.KinesisDataStreamSinkConfiguration if *v == nil { sv = &types.KinesisDataStreamSinkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "InsightsTarget": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.InsightsTarget = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKinesisVideoStreamRecordingSourceRuntimeConfiguration(v **types.KinesisVideoStreamRecordingSourceRuntimeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.KinesisVideoStreamRecordingSourceRuntimeConfiguration if *v == nil { sv = &types.KinesisVideoStreamRecordingSourceRuntimeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FragmentSelector": if err := awsRestjson1_deserializeDocumentFragmentSelector(&sv.FragmentSelector, value); err != nil { return err } case "Streams": if err := awsRestjson1_deserializeDocumentRecordingStreamList(&sv.Streams, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKinesisVideoStreamSourceRuntimeConfiguration(v **types.KinesisVideoStreamSourceRuntimeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.KinesisVideoStreamSourceRuntimeConfiguration if *v == nil { sv = &types.KinesisVideoStreamSourceRuntimeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "MediaEncoding": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaEncoding to be of type string, got %T instead", value) } sv.MediaEncoding = types.MediaEncoding(jtv) } case "MediaSampleRate": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MediaSampleRateHertz to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MediaSampleRate = ptr.Int32(int32(i64)) } case "Streams": if err := awsRestjson1_deserializeDocumentStreams(&sv.Streams, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLambdaFunctionSinkConfiguration(v **types.LambdaFunctionSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LambdaFunctionSinkConfiguration if *v == nil { sv = &types.LambdaFunctionSinkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "InsightsTarget": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.InsightsTarget = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLiveConnectorRTMPConfiguration(v **types.LiveConnectorRTMPConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LiveConnectorRTMPConfiguration if *v == nil { sv = &types.LiveConnectorRTMPConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "AudioChannels": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AudioChannelsOption to be of type string, got %T instead", value) } sv.AudioChannels = types.AudioChannelsOption(jtv) } case "AudioSampleRate": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AudioSampleRateOption to be of type string, got %T instead", value) } sv.AudioSampleRate = ptr.String(jtv) } case "Url": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SensitiveString to be of type string, got %T instead", value) } sv.Url = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLiveConnectorSinkConfiguration(v **types.LiveConnectorSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LiveConnectorSinkConfiguration if *v == nil { sv = &types.LiveConnectorSinkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "RTMPConfiguration": if err := awsRestjson1_deserializeDocumentLiveConnectorRTMPConfiguration(&sv.RTMPConfiguration, value); err != nil { return err } case "SinkType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LiveConnectorSinkType to be of type string, got %T instead", value) } sv.SinkType = types.LiveConnectorSinkType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLiveConnectorSinkList(v *[]types.LiveConnectorSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.LiveConnectorSinkConfiguration if *v == nil { cv = []types.LiveConnectorSinkConfiguration{} } else { cv = *v } for _, value := range shape { var col types.LiveConnectorSinkConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentLiveConnectorSinkConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLiveConnectorSourceConfiguration(v **types.LiveConnectorSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LiveConnectorSourceConfiguration if *v == nil { sv = &types.LiveConnectorSourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ChimeSdkMeetingLiveConnectorConfiguration": if err := awsRestjson1_deserializeDocumentChimeSdkMeetingLiveConnectorConfiguration(&sv.ChimeSdkMeetingLiveConnectorConfiguration, value); err != nil { return err } case "SourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LiveConnectorSourceType to be of type string, got %T instead", value) } sv.SourceType = types.LiveConnectorSourceType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLiveConnectorSourceList(v *[]types.LiveConnectorSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.LiveConnectorSourceConfiguration if *v == nil { cv = []types.LiveConnectorSourceConfiguration{} } else { cv = *v } for _, value := range shape { var col types.LiveConnectorSourceConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentLiveConnectorSourceConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMediaCapturePipeline(v **types.MediaCapturePipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaCapturePipeline if *v == nil { sv = &types.MediaCapturePipeline{} } else { sv = *v } for key, value := range shape { switch key { case "ChimeSdkMeetingConfiguration": if err := awsRestjson1_deserializeDocumentChimeSdkMeetingConfiguration(&sv.ChimeSdkMeetingConfiguration, value); err != nil { return err } case "CreatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedTimestamp = ptr.Time(t) } case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } sv.MediaPipelineArn = ptr.String(jtv) } case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } sv.MediaPipelineId = ptr.String(jtv) } case "SinkArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.SinkArn = ptr.String(jtv) } case "SinkType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaPipelineSinkType to be of type string, got %T instead", value) } sv.SinkType = types.MediaPipelineSinkType(jtv) } case "SourceArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.SourceArn = ptr.String(jtv) } case "SourceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaPipelineSourceType to be of type string, got %T instead", value) } sv.SourceType = types.MediaPipelineSourceType(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaPipelineStatus to be of type string, got %T instead", value) } sv.Status = types.MediaPipelineStatus(jtv) } case "UpdatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedTimestamp = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaCapturePipelineSourceConfiguration(v **types.MediaCapturePipelineSourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaCapturePipelineSourceConfiguration if *v == nil { sv = &types.MediaCapturePipelineSourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "ChimeSdkMeetingConfiguration": if err := awsRestjson1_deserializeDocumentChimeSdkMeetingConcatenationConfiguration(&sv.ChimeSdkMeetingConfiguration, value); err != nil { return err } case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.MediaPipelineArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaCapturePipelineSummary(v **types.MediaCapturePipelineSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaCapturePipelineSummary if *v == nil { sv = &types.MediaCapturePipelineSummary{} } else { sv = *v } for key, value := range shape { switch key { case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } sv.MediaPipelineArn = ptr.String(jtv) } case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } sv.MediaPipelineId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaCapturePipelineSummaryList(v *[]types.MediaCapturePipelineSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.MediaCapturePipelineSummary if *v == nil { cv = []types.MediaCapturePipelineSummary{} } else { cv = *v } for _, value := range shape { var col types.MediaCapturePipelineSummary destAddr := &col if err := awsRestjson1_deserializeDocumentMediaCapturePipelineSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMediaConcatenationPipeline(v **types.MediaConcatenationPipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaConcatenationPipeline if *v == nil { sv = &types.MediaConcatenationPipeline{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedTimestamp = ptr.Time(t) } case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } sv.MediaPipelineArn = ptr.String(jtv) } case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } sv.MediaPipelineId = ptr.String(jtv) } case "Sinks": if err := awsRestjson1_deserializeDocumentConcatenationSinkList(&sv.Sinks, value); err != nil { return err } case "Sources": if err := awsRestjson1_deserializeDocumentConcatenationSourceList(&sv.Sources, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaPipelineStatus to be of type string, got %T instead", value) } sv.Status = types.MediaPipelineStatus(jtv) } case "UpdatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedTimestamp = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaInsightsPipeline(v **types.MediaInsightsPipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaInsightsPipeline if *v == nil { sv = &types.MediaInsightsPipeline{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedTimestamp = ptr.Time(t) } case "KinesisVideoStreamRecordingSourceRuntimeConfiguration": if err := awsRestjson1_deserializeDocumentKinesisVideoStreamRecordingSourceRuntimeConfiguration(&sv.KinesisVideoStreamRecordingSourceRuntimeConfiguration, value); err != nil { return err } case "KinesisVideoStreamSourceRuntimeConfiguration": if err := awsRestjson1_deserializeDocumentKinesisVideoStreamSourceRuntimeConfiguration(&sv.KinesisVideoStreamSourceRuntimeConfiguration, value); err != nil { return err } case "MediaInsightsPipelineConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.MediaInsightsPipelineConfigurationArn = ptr.String(jtv) } case "MediaInsightsRuntimeMetadata": if err := awsRestjson1_deserializeDocumentMediaInsightsRuntimeMetadata(&sv.MediaInsightsRuntimeMetadata, value); err != nil { return err } case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.MediaPipelineArn = ptr.String(jtv) } case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } sv.MediaPipelineId = ptr.String(jtv) } case "S3RecordingSinkRuntimeConfiguration": if err := awsRestjson1_deserializeDocumentS3RecordingSinkRuntimeConfiguration(&sv.S3RecordingSinkRuntimeConfiguration, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaPipelineStatus to be of type string, got %T instead", value) } sv.Status = types.MediaPipelineStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaInsightsPipelineConfiguration(v **types.MediaInsightsPipelineConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaInsightsPipelineConfiguration if *v == nil { sv = &types.MediaInsightsPipelineConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedTimestamp = ptr.Time(t) } case "Elements": if err := awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationElements(&sv.Elements, value); err != nil { return err } case "MediaInsightsPipelineConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.MediaInsightsPipelineConfigurationArn = ptr.String(jtv) } case "MediaInsightsPipelineConfigurationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } sv.MediaInsightsPipelineConfigurationId = ptr.String(jtv) } case "MediaInsightsPipelineConfigurationName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaInsightsPipelineConfigurationNameString to be of type string, got %T instead", value) } sv.MediaInsightsPipelineConfigurationName = ptr.String(jtv) } case "RealTimeAlertConfiguration": if err := awsRestjson1_deserializeDocumentRealTimeAlertConfiguration(&sv.RealTimeAlertConfiguration, value); err != nil { return err } case "ResourceAccessRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.ResourceAccessRoleArn = ptr.String(jtv) } case "UpdatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedTimestamp = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationElement(v **types.MediaInsightsPipelineConfigurationElement, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaInsightsPipelineConfigurationElement if *v == nil { sv = &types.MediaInsightsPipelineConfigurationElement{} } else { sv = *v } for key, value := range shape { switch key { case "AmazonTranscribeCallAnalyticsProcessorConfiguration": if err := awsRestjson1_deserializeDocumentAmazonTranscribeCallAnalyticsProcessorConfiguration(&sv.AmazonTranscribeCallAnalyticsProcessorConfiguration, value); err != nil { return err } case "AmazonTranscribeProcessorConfiguration": if err := awsRestjson1_deserializeDocumentAmazonTranscribeProcessorConfiguration(&sv.AmazonTranscribeProcessorConfiguration, value); err != nil { return err } case "KinesisDataStreamSinkConfiguration": if err := awsRestjson1_deserializeDocumentKinesisDataStreamSinkConfiguration(&sv.KinesisDataStreamSinkConfiguration, value); err != nil { return err } case "LambdaFunctionSinkConfiguration": if err := awsRestjson1_deserializeDocumentLambdaFunctionSinkConfiguration(&sv.LambdaFunctionSinkConfiguration, value); err != nil { return err } case "S3RecordingSinkConfiguration": if err := awsRestjson1_deserializeDocumentS3RecordingSinkConfiguration(&sv.S3RecordingSinkConfiguration, value); err != nil { return err } case "SnsTopicSinkConfiguration": if err := awsRestjson1_deserializeDocumentSnsTopicSinkConfiguration(&sv.SnsTopicSinkConfiguration, value); err != nil { return err } case "SqsQueueSinkConfiguration": if err := awsRestjson1_deserializeDocumentSqsQueueSinkConfiguration(&sv.SqsQueueSinkConfiguration, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaInsightsPipelineConfigurationElementType to be of type string, got %T instead", value) } sv.Type = types.MediaInsightsPipelineConfigurationElementType(jtv) } case "VoiceAnalyticsProcessorConfiguration": if err := awsRestjson1_deserializeDocumentVoiceAnalyticsProcessorConfiguration(&sv.VoiceAnalyticsProcessorConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationElements(v *[]types.MediaInsightsPipelineConfigurationElement, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.MediaInsightsPipelineConfigurationElement if *v == nil { cv = []types.MediaInsightsPipelineConfigurationElement{} } else { cv = *v } for _, value := range shape { var col types.MediaInsightsPipelineConfigurationElement destAddr := &col if err := awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationElement(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationSummary(v **types.MediaInsightsPipelineConfigurationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaInsightsPipelineConfigurationSummary if *v == nil { sv = &types.MediaInsightsPipelineConfigurationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "MediaInsightsPipelineConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.MediaInsightsPipelineConfigurationArn = ptr.String(jtv) } case "MediaInsightsPipelineConfigurationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } sv.MediaInsightsPipelineConfigurationId = ptr.String(jtv) } case "MediaInsightsPipelineConfigurationName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaInsightsPipelineConfigurationNameString to be of type string, got %T instead", value) } sv.MediaInsightsPipelineConfigurationName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationSummaryList(v *[]types.MediaInsightsPipelineConfigurationSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.MediaInsightsPipelineConfigurationSummary if *v == nil { cv = []types.MediaInsightsPipelineConfigurationSummary{} } else { cv = *v } for _, value := range shape { var col types.MediaInsightsPipelineConfigurationSummary destAddr := &col if err := awsRestjson1_deserializeDocumentMediaInsightsPipelineConfigurationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMediaInsightsRuntimeMetadata(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentMediaLiveConnectorPipeline(v **types.MediaLiveConnectorPipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaLiveConnectorPipeline if *v == nil { sv = &types.MediaLiveConnectorPipeline{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreatedTimestamp = ptr.Time(t) } case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } sv.MediaPipelineArn = ptr.String(jtv) } case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } sv.MediaPipelineId = ptr.String(jtv) } case "Sinks": if err := awsRestjson1_deserializeDocumentLiveConnectorSinkList(&sv.Sinks, value); err != nil { return err } case "Sources": if err := awsRestjson1_deserializeDocumentLiveConnectorSourceList(&sv.Sources, value); err != nil { return err } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MediaPipelineStatus to be of type string, got %T instead", value) } sv.Status = types.MediaPipelineStatus(jtv) } case "UpdatedTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.UpdatedTimestamp = ptr.Time(t) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaPipeline(v **types.MediaPipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaPipeline if *v == nil { sv = &types.MediaPipeline{} } else { sv = *v } for key, value := range shape { switch key { case "MediaCapturePipeline": if err := awsRestjson1_deserializeDocumentMediaCapturePipeline(&sv.MediaCapturePipeline, value); err != nil { return err } case "MediaConcatenationPipeline": if err := awsRestjson1_deserializeDocumentMediaConcatenationPipeline(&sv.MediaConcatenationPipeline, value); err != nil { return err } case "MediaInsightsPipeline": if err := awsRestjson1_deserializeDocumentMediaInsightsPipeline(&sv.MediaInsightsPipeline, value); err != nil { return err } case "MediaLiveConnectorPipeline": if err := awsRestjson1_deserializeDocumentMediaLiveConnectorPipeline(&sv.MediaLiveConnectorPipeline, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMediaPipelineList(v *[]types.MediaPipelineSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.MediaPipelineSummary if *v == nil { cv = []types.MediaPipelineSummary{} } else { cv = *v } for _, value := range shape { var col types.MediaPipelineSummary destAddr := &col if err := awsRestjson1_deserializeDocumentMediaPipelineSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentMediaPipelineSummary(v **types.MediaPipelineSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MediaPipelineSummary if *v == nil { sv = &types.MediaPipelineSummary{} } else { sv = *v } for key, value := range shape { switch key { case "MediaPipelineArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } sv.MediaPipelineArn = ptr.String(jtv) } case "MediaPipelineId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) } sv.MediaPipelineId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMeetingEventsConcatenationConfiguration(v **types.MeetingEventsConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.MeetingEventsConcatenationConfiguration if *v == nil { sv = &types.MeetingEventsConcatenationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) } sv.State = types.ArtifactsConcatenationState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.NotFoundException if *v == nil { sv = &types.NotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = types.ErrorCode(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPostCallAnalyticsSettings(v **types.PostCallAnalyticsSettings, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PostCallAnalyticsSettings if *v == nil { sv = &types.PostCallAnalyticsSettings{} } else { sv = *v } for key, value := range shape { switch key { case "ContentRedactionOutput": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ContentRedactionOutput to be of type string, got %T instead", value) } sv.ContentRedactionOutput = types.ContentRedactionOutput(jtv) } case "DataAccessRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.DataAccessRoleArn = ptr.String(jtv) } case "OutputEncryptionKMSKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.OutputEncryptionKMSKeyId = ptr.String(jtv) } case "OutputLocation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.OutputLocation = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPresenterOnlyConfiguration(v **types.PresenterOnlyConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.PresenterOnlyConfiguration if *v == nil { sv = &types.PresenterOnlyConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "PresenterPosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PresenterPosition to be of type string, got %T instead", value) } sv.PresenterPosition = types.PresenterPosition(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRealTimeAlertConfiguration(v **types.RealTimeAlertConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RealTimeAlertConfiguration if *v == nil { sv = &types.RealTimeAlertConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Disabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.Disabled = jtv } case "Rules": if err := awsRestjson1_deserializeDocumentRealTimeAlertRuleList(&sv.Rules, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRealTimeAlertRule(v **types.RealTimeAlertRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RealTimeAlertRule if *v == nil { sv = &types.RealTimeAlertRule{} } else { sv = *v } for key, value := range shape { switch key { case "IssueDetectionConfiguration": if err := awsRestjson1_deserializeDocumentIssueDetectionConfiguration(&sv.IssueDetectionConfiguration, value); err != nil { return err } case "KeywordMatchConfiguration": if err := awsRestjson1_deserializeDocumentKeywordMatchConfiguration(&sv.KeywordMatchConfiguration, value); err != nil { return err } case "SentimentConfiguration": if err := awsRestjson1_deserializeDocumentSentimentConfiguration(&sv.SentimentConfiguration, value); err != nil { return err } case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RealTimeAlertRuleType to be of type string, got %T instead", value) } sv.Type = types.RealTimeAlertRuleType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRealTimeAlertRuleList(v *[]types.RealTimeAlertRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.RealTimeAlertRule if *v == nil { cv = []types.RealTimeAlertRule{} } else { cv = *v } for _, value := range shape { var col types.RealTimeAlertRule destAddr := &col if err := awsRestjson1_deserializeDocumentRealTimeAlertRule(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentRecordingStreamConfiguration(v **types.RecordingStreamConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.RecordingStreamConfiguration if *v == nil { sv = &types.RecordingStreamConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "StreamArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KinesisVideoStreamArn to be of type string, got %T instead", value) } sv.StreamArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentRecordingStreamList(v *[]types.RecordingStreamConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.RecordingStreamConfiguration if *v == nil { cv = []types.RecordingStreamConfiguration{} } else { cv = *v } for _, value := range shape { var col types.RecordingStreamConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentRecordingStreamConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceLimitExceededException if *v == nil { sv = &types.ResourceLimitExceededException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = types.ErrorCode(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3BucketSinkConfiguration(v **types.S3BucketSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3BucketSinkConfiguration if *v == nil { sv = &types.S3BucketSinkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Destination": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Destination = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3RecordingSinkConfiguration(v **types.S3RecordingSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3RecordingSinkConfiguration if *v == nil { sv = &types.S3RecordingSinkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Destination": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Destination = ptr.String(jtv) } case "RecordingFileFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RecordingFileFormat to be of type string, got %T instead", value) } sv.RecordingFileFormat = types.RecordingFileFormat(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3RecordingSinkRuntimeConfiguration(v **types.S3RecordingSinkRuntimeConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.S3RecordingSinkRuntimeConfiguration if *v == nil { sv = &types.S3RecordingSinkRuntimeConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Destination": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.Destination = ptr.String(jtv) } case "RecordingFileFormat": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RecordingFileFormat to be of type string, got %T instead", value) } sv.RecordingFileFormat = types.RecordingFileFormat(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSelectedVideoStreams(v **types.SelectedVideoStreams, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SelectedVideoStreams if *v == nil { sv = &types.SelectedVideoStreams{} } else { sv = *v } for key, value := range shape { switch key { case "AttendeeIds": if err := awsRestjson1_deserializeDocumentAttendeeIdList(&sv.AttendeeIds, value); err != nil { return err } case "ExternalUserIds": if err := awsRestjson1_deserializeDocumentExternalUserIdList(&sv.ExternalUserIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSentimentConfiguration(v **types.SentimentConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SentimentConfiguration if *v == nil { sv = &types.SentimentConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "RuleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RuleName to be of type string, got %T instead", value) } sv.RuleName = ptr.String(jtv) } case "SentimentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SentimentType to be of type string, got %T instead", value) } sv.SentimentType = types.SentimentType(jtv) } case "TimePeriod": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected SentimentTimePeriodInSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TimePeriod = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceFailureException(v **types.ServiceFailureException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceFailureException if *v == nil { sv = &types.ServiceFailureException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = types.ErrorCode(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = types.ErrorCode(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSnsTopicSinkConfiguration(v **types.SnsTopicSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SnsTopicSinkConfiguration if *v == nil { sv = &types.SnsTopicSinkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "InsightsTarget": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.InsightsTarget = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSourceConfiguration(v **types.SourceConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SourceConfiguration if *v == nil { sv = &types.SourceConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SelectedVideoStreams": if err := awsRestjson1_deserializeDocumentSelectedVideoStreams(&sv.SelectedVideoStreams, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSqsQueueSinkConfiguration(v **types.SqsQueueSinkConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.SqsQueueSinkConfiguration if *v == nil { sv = &types.SqsQueueSinkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "InsightsTarget": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } sv.InsightsTarget = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStreamChannelDefinition(v **types.StreamChannelDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StreamChannelDefinition if *v == nil { sv = &types.StreamChannelDefinition{} } else { sv = *v } for key, value := range shape { switch key { case "ChannelDefinitions": if err := awsRestjson1_deserializeDocumentChannelDefinitions(&sv.ChannelDefinitions, value); err != nil { return err } case "NumberOfChannels": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NumberOfChannels to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.NumberOfChannels = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStreamConfiguration(v **types.StreamConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.StreamConfiguration if *v == nil { sv = &types.StreamConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "FragmentNumber": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected FragmentNumberString to be of type string, got %T instead", value) } sv.FragmentNumber = ptr.String(jtv) } case "StreamArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KinesisVideoStreamArn to be of type string, got %T instead", value) } sv.StreamArn = ptr.String(jtv) } case "StreamChannelDefinition": if err := awsRestjson1_deserializeDocumentStreamChannelDefinition(&sv.StreamChannelDefinition, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentStreams(v *[]types.StreamConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.StreamConfiguration if *v == nil { cv = []types.StreamConfiguration{} } else { cv = *v } for _, value := range shape { var col types.StreamConfiguration destAddr := &col if err := awsRestjson1_deserializeDocumentStreamConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.Tag if *v == nil { sv = &types.Tag{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []types.Tag if *v == nil { cv = []types.Tag{} } else { cv = *v } for _, value := range shape { var col types.Tag destAddr := &col if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentThrottledClientException(v **types.ThrottledClientException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ThrottledClientException if *v == nil { sv = &types.ThrottledClientException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = types.ErrorCode(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTimestampRange(v **types.TimestampRange, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TimestampRange if *v == nil { sv = &types.TimestampRange{} } else { sv = *v } for key, value := range shape { switch key { case "EndTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.EndTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "StartTimestamp": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.StartTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTranscriptionMessagesConcatenationConfiguration(v **types.TranscriptionMessagesConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.TranscriptionMessagesConcatenationConfiguration if *v == nil { sv = &types.TranscriptionMessagesConcatenationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) } sv.State = types.ArtifactsConcatenationState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnauthorizedClientException(v **types.UnauthorizedClientException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.UnauthorizedClientException if *v == nil { sv = &types.UnauthorizedClientException{} } else { sv = *v } for key, value := range shape { switch key { case "Code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.Code = types.ErrorCode(jtv) } case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequestId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVerticalLayoutConfiguration(v **types.VerticalLayoutConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VerticalLayoutConfiguration if *v == nil { sv = &types.VerticalLayoutConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "TileAspectRatio": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TileAspectRatio to be of type string, got %T instead", value) } sv.TileAspectRatio = ptr.String(jtv) } case "TileCount": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TileCount to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TileCount = ptr.Int32(int32(i64)) } case "TileOrder": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TileOrder to be of type string, got %T instead", value) } sv.TileOrder = types.TileOrder(jtv) } case "TilePosition": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VerticalTilePosition to be of type string, got %T instead", value) } sv.TilePosition = types.VerticalTilePosition(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVideoArtifactsConfiguration(v **types.VideoArtifactsConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VideoArtifactsConfiguration if *v == nil { sv = &types.VideoArtifactsConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "MuxType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VideoMuxType to be of type string, got %T instead", value) } sv.MuxType = types.VideoMuxType(jtv) } case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArtifactsState to be of type string, got %T instead", value) } sv.State = types.ArtifactsState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVideoAttribute(v **types.VideoAttribute, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VideoAttribute if *v == nil { sv = &types.VideoAttribute{} } else { sv = *v } for key, value := range shape { switch key { case "BorderColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BorderColor to be of type string, got %T instead", value) } sv.BorderColor = types.BorderColor(jtv) } case "BorderThickness": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected BorderThickness to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.BorderThickness = ptr.Int32(int32(i64)) } case "CornerRadius": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected CornerRadius to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.CornerRadius = ptr.Int32(int32(i64)) } case "HighlightColor": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HighlightColor to be of type string, got %T instead", value) } sv.HighlightColor = types.HighlightColor(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVideoConcatenationConfiguration(v **types.VideoConcatenationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VideoConcatenationConfiguration if *v == nil { sv = &types.VideoConcatenationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "State": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ArtifactsConcatenationState to be of type string, got %T instead", value) } sv.State = types.ArtifactsConcatenationState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVoiceAnalyticsProcessorConfiguration(v **types.VoiceAnalyticsProcessorConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.VoiceAnalyticsProcessorConfiguration if *v == nil { sv = &types.VoiceAnalyticsProcessorConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SpeakerSearchStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VoiceAnalyticsConfigurationStatus to be of type string, got %T instead", value) } sv.SpeakerSearchStatus = types.VoiceAnalyticsConfigurationStatus(jtv) } case "VoiceToneAnalysisStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VoiceAnalyticsConfigurationStatus to be of type string, got %T instead", value) } sv.VoiceToneAnalysisStatus = types.VoiceAnalyticsConfigurationStatus(jtv) } default: _, _ = key, value } } *v = sv return nil }